diff options
author | Jiri Olsa <jolsa@kernel.org> | 2014-06-19 07:41:13 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2014-06-19 15:13:14 -0400 |
commit | dd00d486ddb7f181cf9487f6aceb1066bc6b0b6a (patch) | |
tree | c45aa187fb17853e573bf7907f091ed2f1b8414c /tools/perf/ui | |
parent | 5089f20ee7104bd219cafefa62d83f53e75cc44c (diff) |
perf hists browser: Remove ev_name argument from perf_evsel__hists_browse
Removing ev_name argument from perf_evsel__hists_browse function,
because it's not needed. We can get the name out of the 'struct
perf_evsel' which is passed as argument as well.
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Corey Ashford <cjashfor@linux.vnet.ibm.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1403178076-14072-3-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui')
-rw-r--r-- | tools/perf/ui/browsers/hists.c | 25 |
1 files changed, 11 insertions, 14 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c index 52c03fbbba17..1bd35e8ed9f1 100644 --- a/tools/perf/ui/browsers/hists.c +++ b/tools/perf/ui/browsers/hists.c | |||
@@ -32,8 +32,7 @@ struct hist_browser { | |||
32 | 32 | ||
33 | extern void hist_browser__init_hpp(void); | 33 | extern void hist_browser__init_hpp(void); |
34 | 34 | ||
35 | static int hists__browser_title(struct hists *hists, char *bf, size_t size, | 35 | static int hists__browser_title(struct hists *hists, char *bf, size_t size); |
36 | const char *ev_name); | ||
37 | static void hist_browser__update_nr_entries(struct hist_browser *hb); | 36 | static void hist_browser__update_nr_entries(struct hist_browser *hb); |
38 | 37 | ||
39 | static struct rb_node *hists__filter_entries(struct rb_node *nd, | 38 | static struct rb_node *hists__filter_entries(struct rb_node *nd, |
@@ -345,7 +344,7 @@ static void ui_browser__warn_lost_events(struct ui_browser *browser) | |||
345 | "Or reduce the sampling frequency."); | 344 | "Or reduce the sampling frequency."); |
346 | } | 345 | } |
347 | 346 | ||
348 | static int hist_browser__run(struct hist_browser *browser, const char *ev_name, | 347 | static int hist_browser__run(struct hist_browser *browser, |
349 | struct hist_browser_timer *hbt) | 348 | struct hist_browser_timer *hbt) |
350 | { | 349 | { |
351 | int key; | 350 | int key; |
@@ -356,7 +355,7 @@ static int hist_browser__run(struct hist_browser *browser, const char *ev_name, | |||
356 | browser->b.nr_entries = hist_browser__nr_entries(browser); | 355 | browser->b.nr_entries = hist_browser__nr_entries(browser); |
357 | 356 | ||
358 | hist_browser__refresh_dimensions(browser); | 357 | hist_browser__refresh_dimensions(browser); |
359 | hists__browser_title(browser->hists, title, sizeof(title), ev_name); | 358 | hists__browser_title(browser->hists, title, sizeof(title)); |
360 | 359 | ||
361 | if (ui_browser__show(&browser->b, title, | 360 | if (ui_browser__show(&browser->b, title, |
362 | "Press '?' for help on key bindings") < 0) | 361 | "Press '?' for help on key bindings") < 0) |
@@ -383,7 +382,7 @@ static int hist_browser__run(struct hist_browser *browser, const char *ev_name, | |||
383 | ui_browser__warn_lost_events(&browser->b); | 382 | ui_browser__warn_lost_events(&browser->b); |
384 | } | 383 | } |
385 | 384 | ||
386 | hists__browser_title(browser->hists, title, sizeof(title), ev_name); | 385 | hists__browser_title(browser->hists, title, sizeof(title)); |
387 | ui_browser__show_title(&browser->b, title); | 386 | ui_browser__show_title(&browser->b, title); |
388 | continue; | 387 | continue; |
389 | } | 388 | } |
@@ -1212,8 +1211,7 @@ static struct thread *hist_browser__selected_thread(struct hist_browser *browser | |||
1212 | return browser->he_selection->thread; | 1211 | return browser->he_selection->thread; |
1213 | } | 1212 | } |
1214 | 1213 | ||
1215 | static int hists__browser_title(struct hists *hists, char *bf, size_t size, | 1214 | static int hists__browser_title(struct hists *hists, char *bf, size_t size) |
1216 | const char *ev_name) | ||
1217 | { | 1215 | { |
1218 | char unit; | 1216 | char unit; |
1219 | int printed; | 1217 | int printed; |
@@ -1222,6 +1220,7 @@ static int hists__browser_title(struct hists *hists, char *bf, size_t size, | |||
1222 | unsigned long nr_samples = hists->stats.nr_events[PERF_RECORD_SAMPLE]; | 1220 | unsigned long nr_samples = hists->stats.nr_events[PERF_RECORD_SAMPLE]; |
1223 | u64 nr_events = hists->stats.total_period; | 1221 | u64 nr_events = hists->stats.total_period; |
1224 | struct perf_evsel *evsel = hists_to_evsel(hists); | 1222 | struct perf_evsel *evsel = hists_to_evsel(hists); |
1223 | const char *ev_name = perf_evsel__name(evsel); | ||
1225 | char buf[512]; | 1224 | char buf[512]; |
1226 | size_t buflen = sizeof(buf); | 1225 | size_t buflen = sizeof(buf); |
1227 | 1226 | ||
@@ -1389,7 +1388,7 @@ static void hist_browser__update_nr_entries(struct hist_browser *hb) | |||
1389 | } | 1388 | } |
1390 | 1389 | ||
1391 | static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | 1390 | static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, |
1392 | const char *helpline, const char *ev_name, | 1391 | const char *helpline, |
1393 | bool left_exits, | 1392 | bool left_exits, |
1394 | struct hist_browser_timer *hbt, | 1393 | struct hist_browser_timer *hbt, |
1395 | float min_pcnt, | 1394 | float min_pcnt, |
@@ -1464,7 +1463,7 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events, | |||
1464 | 1463 | ||
1465 | nr_options = 0; | 1464 | nr_options = 0; |
1466 | 1465 | ||
1467 | key = hist_browser__run(browser, ev_name, hbt); | 1466 | key = hist_browser__run(browser, hbt); |
1468 | 1467 | ||
1469 | if (browser->he_selection != NULL) { | 1468 | if (browser->he_selection != NULL) { |
1470 | thread = hist_browser__selected_thread(browser); | 1469 | thread = hist_browser__selected_thread(browser); |
@@ -1832,7 +1831,7 @@ static int perf_evsel_menu__run(struct perf_evsel_menu *menu, | |||
1832 | { | 1831 | { |
1833 | struct perf_evlist *evlist = menu->b.priv; | 1832 | struct perf_evlist *evlist = menu->b.priv; |
1834 | struct perf_evsel *pos; | 1833 | struct perf_evsel *pos; |
1835 | const char *ev_name, *title = "Available samples"; | 1834 | const char *title = "Available samples"; |
1836 | int delay_secs = hbt ? hbt->refresh : 0; | 1835 | int delay_secs = hbt ? hbt->refresh : 0; |
1837 | int key; | 1836 | int key; |
1838 | 1837 | ||
@@ -1865,9 +1864,8 @@ browse_hists: | |||
1865 | */ | 1864 | */ |
1866 | if (hbt) | 1865 | if (hbt) |
1867 | hbt->timer(hbt->arg); | 1866 | hbt->timer(hbt->arg); |
1868 | ev_name = perf_evsel__name(pos); | ||
1869 | key = perf_evsel__hists_browse(pos, nr_events, help, | 1867 | key = perf_evsel__hists_browse(pos, nr_events, help, |
1870 | ev_name, true, hbt, | 1868 | true, hbt, |
1871 | menu->min_pcnt, | 1869 | menu->min_pcnt, |
1872 | menu->env); | 1870 | menu->env); |
1873 | ui_browser__show_title(&menu->b, title); | 1871 | ui_browser__show_title(&menu->b, title); |
@@ -1971,10 +1969,9 @@ int perf_evlist__tui_browse_hists(struct perf_evlist *evlist, const char *help, | |||
1971 | single_entry: | 1969 | single_entry: |
1972 | if (nr_entries == 1) { | 1970 | if (nr_entries == 1) { |
1973 | struct perf_evsel *first = perf_evlist__first(evlist); | 1971 | struct perf_evsel *first = perf_evlist__first(evlist); |
1974 | const char *ev_name = perf_evsel__name(first); | ||
1975 | 1972 | ||
1976 | return perf_evsel__hists_browse(first, nr_entries, help, | 1973 | return perf_evsel__hists_browse(first, nr_entries, help, |
1977 | ev_name, false, hbt, min_pcnt, | 1974 | false, hbt, min_pcnt, |
1978 | env); | 1975 | env); |
1979 | } | 1976 | } |
1980 | 1977 | ||