Skip to content

Commit bee9ca1

Browse files
committed
perf report TUI: Remove needless 'dummy' event from menu
Fixing the common case of: perf record perf report And getting just the cycles events. We now have a 'dummy' event to get perf metadata events that take place while we synthesize metadata records for pre-existing processes by traversing procfs, so we always have this extra 'dummy' evsel, but we don't have to offer it as there will be no samples on it, remove this distraction. Cc: Adrian Hunter <[email protected]> Cc: Ian Rogers <[email protected]> Cc: Jiri Olsa <[email protected]> Cc: Namhyung Kim <[email protected]> Link: https://lore.kernel.org/lkml/[email protected]/ Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
1 parent 4c95ad2 commit bee9ca1

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

tools/perf/ui/browsers/hists.c

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3603,6 +3603,23 @@ static int __perf_evlist__tui_browse_hists(struct evlist *evlist,
36033603
hbt, warn_lost_event);
36043604
}
36053605

3606+
static bool perf_evlist__single_entry(struct evlist *evlist)
3607+
{
3608+
int nr_entries = evlist->core.nr_entries;
3609+
3610+
if (nr_entries == 1)
3611+
return true;
3612+
3613+
if (nr_entries == 2) {
3614+
struct evsel *last = evlist__last(evlist);
3615+
3616+
if (evsel__is_dummy_event(last))
3617+
return true;
3618+
}
3619+
3620+
return false;
3621+
}
3622+
36063623
int perf_evlist__tui_browse_hists(struct evlist *evlist, const char *help,
36073624
struct hist_browser_timer *hbt,
36083625
float min_pcnt,
@@ -3613,7 +3630,7 @@ int perf_evlist__tui_browse_hists(struct evlist *evlist, const char *help,
36133630
int nr_entries = evlist->core.nr_entries;
36143631

36153632
single_entry:
3616-
if (nr_entries == 1) {
3633+
if (perf_evlist__single_entry(evlist)) {
36173634
struct evsel *first = evlist__first(evlist);
36183635

36193636
return perf_evsel__hists_browse(first, nr_entries, help,

0 commit comments

Comments
 (0)