diff options
author | Namhyung Kim <namhyung.kim@lge.com> | 2012-11-02 01:50:05 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2012-11-05 12:03:58 -0500 |
commit | 9783adf777a445a1e9d0db4857a3a896a9f42d4a (patch) | |
tree | 0d3256acbcdba290afa018cce86456f21febe58b /tools/perf/builtin-top.c | |
parent | 48ed0ece1b8063313284812ef048b26c3c4250af (diff) |
perf tools: Introduce struct hist_browser_timer
Currently various hist browser functions receive 3 arguments for
refreshing histogram but only used from a few places. Also it's only
for perf top command so that it can be NULL for other (and probably
most) cases. Pack them into a struct in order to reduce number of those
unused arguments.
This is a mechanical change and does not intend a functional change.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Tested-by: David Ahern <dsahern@gmail.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Irina Tirdea <irina.tirdea@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1351835406-15208-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/builtin-top.c')
-rw-r--r-- | tools/perf/builtin-top.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index f2ecd498c72d..102b43c9905d 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c | |||
@@ -582,6 +582,11 @@ static void *display_thread_tui(void *arg) | |||
582 | struct perf_evsel *pos; | 582 | struct perf_evsel *pos; |
583 | struct perf_top *top = arg; | 583 | struct perf_top *top = arg; |
584 | const char *help = "For a higher level overview, try: perf top --sort comm,dso"; | 584 | const char *help = "For a higher level overview, try: perf top --sort comm,dso"; |
585 | struct hist_browser_timer hbt = { | ||
586 | .timer = perf_top__sort_new_samples, | ||
587 | .arg = top, | ||
588 | .refresh = top->delay_secs, | ||
589 | }; | ||
585 | 590 | ||
586 | perf_top__sort_new_samples(top); | 591 | perf_top__sort_new_samples(top); |
587 | 592 | ||
@@ -593,9 +598,7 @@ static void *display_thread_tui(void *arg) | |||
593 | list_for_each_entry(pos, &top->evlist->entries, node) | 598 | list_for_each_entry(pos, &top->evlist->entries, node) |
594 | pos->hists.uid_filter_str = top->target.uid_str; | 599 | pos->hists.uid_filter_str = top->target.uid_str; |
595 | 600 | ||
596 | perf_evlist__tui_browse_hists(top->evlist, help, | 601 | perf_evlist__tui_browse_hists(top->evlist, help, &hbt); |
597 | perf_top__sort_new_samples, | ||
598 | top, top->delay_secs); | ||
599 | 602 | ||
600 | exit_browser(0); | 603 | exit_browser(0); |
601 | exit(0); | 604 | exit(0); |