perf top browser: Show sample_freq in browser title line

The '--stdio' 'perf top' UI shows it, so lets remove this UI difference
and show it too in '--tui', will be useful for 'perf top --tui -F max'.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: https://lkml.kernel.org/n/tip-n3wd8n395uo4y9irst29pjic@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 67230479
...@@ -2223,7 +2223,7 @@ static int perf_evsel_browser_title(struct hist_browser *browser, ...@@ -2223,7 +2223,7 @@ static int perf_evsel_browser_title(struct hist_browser *browser,
u64 nr_events = hists->stats.total_period; u64 nr_events = hists->stats.total_period;
struct perf_evsel *evsel = hists_to_evsel(hists); struct perf_evsel *evsel = hists_to_evsel(hists);
const char *ev_name = perf_evsel__name(evsel); const char *ev_name = perf_evsel__name(evsel);
char buf[512]; char buf[512], sample_freq_str[64] = "";
size_t buflen = sizeof(buf); size_t buflen = sizeof(buf);
char ref[30] = " show reference callgraph, "; char ref[30] = " show reference callgraph, ";
bool enable_ref = false; bool enable_ref = false;
...@@ -2255,10 +2255,14 @@ static int perf_evsel_browser_title(struct hist_browser *browser, ...@@ -2255,10 +2255,14 @@ static int perf_evsel_browser_title(struct hist_browser *browser,
if (symbol_conf.show_ref_callgraph && if (symbol_conf.show_ref_callgraph &&
strstr(ev_name, "call-graph=no")) strstr(ev_name, "call-graph=no"))
enable_ref = true; enable_ref = true;
if (!is_report_browser(hbt))
scnprintf(sample_freq_str, sizeof(sample_freq_str), " %d Hz,", evsel->attr.sample_freq);
nr_samples = convert_unit(nr_samples, &unit); nr_samples = convert_unit(nr_samples, &unit);
printed = scnprintf(bf, size, printed = scnprintf(bf, size,
"Samples: %lu%c of event '%s',%sEvent count (approx.): %" PRIu64, "Samples: %lu%c of event '%s',%s%sEvent count (approx.): %" PRIu64,
nr_samples, unit, ev_name, enable_ref ? ref : " ", nr_events); nr_samples, unit, ev_name, sample_freq_str, enable_ref ? ref : " ", nr_events);
if (hists->uid_filter_str) if (hists->uid_filter_str)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment