perf top: Move perf_top__reset_sample_counters() to after counts display
tip-bot for Jiri Olsa
merge botCommit-ID: a1dcb76e592a63b0c9213924b80c6021f56bdaae Gitweb: https://git.kernel.org/tip/a1dcb76e592a63b0c9213924b80c6021f56bdaae Author: Jiri Olsa <[email protected]> AuthorDate: Tue, 13 Nov 2018 11:15:34 +0100 Committer: Arnaldo Carvalho de Melo <[email protected]> CommitDate: Thu, 6 Dec 2018 14:12:34 -0300
perf top: Move perf_top__reset_sample_counters() to after counts display
Move the perf_top__reset_sample_counters() call to right after we display the counters so we can see the updated numbers for longer.
Acked-by David S. Miller <[email protected]>
Acked-by Namhyung Kim <[email protected]>
Cc Alexander Shishkin <[email protected]>
Cc Peter Zijlstra <[email protected]>
Signed-off-by Jiri Olsa <[email protected]>
--- tools/perf/builtin-top.c | 4 ---- tools/perf/ui/browsers/hists.c | 3 +++ tools/perf/util/top.c | 1 + 3 files changed, 4 insertions(+), 4 deletions(-)
tools/perf/builtin-top.c +0 -4
@@ -273,8 +273,6 @@ static void perf_top__print_sym_table(struct perf_top *top)perf_top__header_snprintf (top, bf,sizeof (bf));printf ("%s\n" , bf); -perf_top__reset_sample_counters (top); -printf ("%-*.*s\n" , win_width, win_width, graph_dotted_line); if (!top->record_opts.overwrite &&
@@ -573,8 +571,6 @@ static void perf_top__sort_new_samples(void *arg)if (t->lost || t->drop)pr_warning ("Too slow to read ring buffer (change period (-c/-F) or limit CPUs (-C)\n" ); - -perf_top__reset_sample_counters (t); }static void stop_top (void )
tools/perf/ui/browsers/hists.c +3 -0
@@ -2229,8 +2229,11 @@ static int hists_browser__scnprintf_title(struct hist_browser *browser, char *bfif (top->zero) printed +=scnprintf (bf + printed, size - printed," [z]" ); + +perf_top__reset_sample_counters (top); } +return printed; }
tools/perf/util/top.c +1 -0
@@ -107,6 +107,7 @@ size_t perf_top__header_snprintf(struct perf_top *top, char *bf, size_t size) top->evlist->cpus->nr > 1 ? "s" : ""); } +perf_top__reset_sample_counters (top);return ret; }