blob: 717d39d3052b8080ff90af9e6cbb715dbd15f203 [file] [log] [blame]
Arnaldo Carvalho de Melo34cea7f2010-08-08 19:56:47 -03001#ifndef _PERF_UI_PROGRESS_H_
2#define _PERF_UI_PROGRESS_H_ 1
3
Borislav Petkovd944c4e2014-04-25 21:31:02 +02004#include <linux/types.h>
Arnaldo Carvalho de Melo34cea7f2010-08-08 19:56:47 -03005
Arnaldo Carvalho de Melo4d3001f2013-10-23 15:40:38 -03006void ui_progress__finish(void);
Arnaldo Carvalho de Melo48000a12014-12-17 17:24:45 -03007
Arnaldo Carvalho de Melo4d3001f2013-10-23 15:40:38 -03008struct ui_progress {
9 const char *title;
10 u64 curr, next, step, total;
11};
Arnaldo Carvalho de Melo48000a12014-12-17 17:24:45 -030012
Arnaldo Carvalho de Melo4d3001f2013-10-23 15:40:38 -030013void ui_progress__init(struct ui_progress *p, u64 total, const char *title);
14void ui_progress__update(struct ui_progress *p, u64 adv);
15
Arnaldo Carvalho de Melo4779a2e2013-10-23 14:08:48 -030016struct ui_progress_ops {
Arnaldo Carvalho de Melo4d3001f2013-10-23 15:40:38 -030017 void (*update)(struct ui_progress *p);
Namhyung Kima5580f32012-11-13 22:30:34 +090018 void (*finish)(void);
Namhyung Kim688f2f52012-11-13 22:30:32 +090019};
20
Arnaldo Carvalho de Melo4779a2e2013-10-23 14:08:48 -030021extern struct ui_progress_ops *ui_progress__ops;
Namhyung Kim688f2f52012-11-13 22:30:32 +090022
Arnaldo Carvalho de Melo34cea7f2010-08-08 19:56:47 -030023#endif