diff options
author | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
---|---|---|
committer | Scott Wood <scottwood@freescale.com> | 2014-04-07 23:49:35 (GMT) |
commit | 62b8c978ee6b8d135d9e7953221de58000dba986 (patch) | |
tree | 683b04b2e627f6710c22c151b23c8cc9a165315e /tools/perf/ui/progress.c | |
parent | 78fd82238d0e5716578c326404184a27ba67fd6e (diff) | |
download | linux-fsl-qoriq-62b8c978ee6b8d135d9e7953221de58000dba986.tar.xz |
Rewind v3.13-rc3+ (78fd82238d0e5716) to v3.12
Diffstat (limited to 'tools/perf/ui/progress.c')
-rw-r--r-- | tools/perf/ui/progress.c | 32 |
1 files changed, 10 insertions, 22 deletions
diff --git a/tools/perf/ui/progress.c b/tools/perf/ui/progress.c index a0f24c7..3ec69560 100644 --- a/tools/perf/ui/progress.c +++ b/tools/perf/ui/progress.c @@ -1,38 +1,26 @@ #include "../cache.h" #include "progress.h" -static void null_progress__update(struct ui_progress *p __maybe_unused) +static void nop_progress_update(u64 curr __maybe_unused, + u64 total __maybe_unused, + const char *title __maybe_unused) { } -static struct ui_progress_ops null_progress__ops = +static struct ui_progress default_progress_fns = { - .update = null_progress__update, + .update = nop_progress_update, }; -struct ui_progress_ops *ui_progress__ops = &null_progress__ops; +struct ui_progress *progress_fns = &default_progress_fns; -void ui_progress__update(struct ui_progress *p, u64 adv) +void ui_progress__update(u64 curr, u64 total, const char *title) { - p->curr += adv; - - if (p->curr >= p->next) { - p->next += p->step; - ui_progress__ops->update(p); - } -} - -void ui_progress__init(struct ui_progress *p, u64 total, const char *title) -{ - p->curr = 0; - p->next = p->step = total / 16; - p->total = total; - p->title = title; - + return progress_fns->update(curr, total, title); } void ui_progress__finish(void) { - if (ui_progress__ops->finish) - ui_progress__ops->finish(); + if (progress_fns->finish) + progress_fns->finish(); } |