progress.h 773 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* SPDX-License-Identifier: GPL-2.0 */
  2. #ifndef _PERF_UI_PROGRESS_H_
  3. #define _PERF_UI_PROGRESS_H_ 1
  4. #include <linux/types.h>
  5. void ui_progress__finish(void);
  6. struct ui_progress {
  7. const char *title;
  8. u64 curr, next, step, total;
  9. bool size;
  10. };
  11. void __ui_progress__init(struct ui_progress *p, u64 total,
  12. const char *title, bool size);
  13. #define ui_progress__init(p, total, title) \
  14. __ui_progress__init(p, total, title, false)
  15. #define ui_progress__init_size(p, total, title) \
  16. __ui_progress__init(p, total, title, true)
  17. void ui_progress__update(struct ui_progress *p, u64 adv);
  18. struct ui_progress_ops {
  19. void (*init)(struct ui_progress *p);
  20. void (*update)(struct ui_progress *p);
  21. void (*finish)(void);
  22. };
  23. extern struct ui_progress_ops *ui_progress__ops;
  24. #endif