Skip to content

Commit b8494f1

Browse files
olsajiriacmel
authored andcommitted
perf ordered_events: Rework show_progress for __ordered_events__flush
Decide to use the progress bar one level higher, we will need this in following patch. Signed-off-by: Jiri Olsa <[email protected]> Acked-by: David S. Miller <[email protected]> Acked-by: Namhyung Kim <[email protected]> Cc: Alexander Shishkin <[email protected]> Cc: Peter Zijlstra <[email protected]> Link: http://lkml.kernel.org/n/[email protected] Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent dd2e18e commit b8494f1

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

tools/perf/util/ordered-events.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -219,13 +219,13 @@ int ordered_events__queue(struct ordered_events *oe, union perf_event *event,
219219
return 0;
220220
}
221221

222-
static int __ordered_events__flush(struct ordered_events *oe)
222+
static int __ordered_events__flush(struct ordered_events *oe,
223+
bool show_progress)
223224
{
224225
struct list_head *head = &oe->events;
225226
struct ordered_event *tmp, *iter;
226227
u64 limit = oe->next_flush;
227228
u64 last_ts = oe->last ? oe->last->timestamp : 0ULL;
228-
bool show_progress = limit == ULLONG_MAX;
229229
struct ui_progress prog;
230230
int ret;
231231

@@ -272,13 +272,15 @@ int ordered_events__flush(struct ordered_events *oe, enum oe_flush how)
272272
"HALF ",
273273
};
274274
int err;
275+
bool show_progress = false;
275276

276277
if (oe->nr_events == 0)
277278
return 0;
278279

279280
switch (how) {
280281
case OE_FLUSH__FINAL:
281282
oe->next_flush = ULLONG_MAX;
283+
show_progress = true;
282284
break;
283285

284286
case OE_FLUSH__HALF:
@@ -308,7 +310,7 @@ int ordered_events__flush(struct ordered_events *oe, enum oe_flush how)
308310
str[how], oe->nr_events);
309311
pr_oe_time(oe->max_timestamp, "max_timestamp\n");
310312

311-
err = __ordered_events__flush(oe);
313+
err = __ordered_events__flush(oe, show_progress);
312314

313315
if (!err) {
314316
if (how == OE_FLUSH__ROUND)

0 commit comments

Comments
 (0)