aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2015-08-09 02:45:24 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-08-10 16:20:26 -0400
commit4605bb55b91449a1a953a51f0334d3bc02351adb (patch)
tree8f8c997efda7bf335716d36d770520a3e84f900e
parent09af2a553577a6e53e40011a910be0f27ce56f3e (diff)
perf evlist: Be more specific on -F/--freq
Currently perf evlist -F shows the number as if it's always sampling frequency. But we now support per-event freq/period settings. So it'd better to show more detailed info whether it's freq or period. $ perf record -e 'cpu/config=1/,cpu/config=2,period=300000/' sleep 1 [ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 0.017 MB perf.data ] $ perf evlist -F cpu/config=1/: sample_freq=4000 cpu/config=2,period=300000/: sample_period=300000 Signed-off-by: Namhyung Kim <namhyung@kernel.org> Acked-by: Jiri Olsa <jolsa@kernel.org> Tested-by: Arnaldo Carvalho de Melo <acme@redhat.com> Cc: David Ahern <dsahern@gmail.com> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Link: http://lkml.kernel.org/r/1439102724-14079-2-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/evsel.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c
index f664a22b5fea..04fddddc6b6f 100644
--- a/tools/perf/util/evsel.c
+++ b/tools/perf/util/evsel.c
@@ -2158,8 +2158,13 @@ int perf_evsel__fprintf(struct perf_evsel *evsel,
2158 printed += perf_event_attr__fprintf(fp, &evsel->attr, 2158 printed += perf_event_attr__fprintf(fp, &evsel->attr,
2159 __print_attr__fprintf, &first); 2159 __print_attr__fprintf, &first);
2160 } else if (details->freq) { 2160 } else if (details->freq) {
2161 printed += comma_fprintf(fp, &first, " sample_freq=%" PRIu64, 2161 const char *term = "sample_freq";
2162 (u64)evsel->attr.sample_freq); 2162
2163 if (!evsel->attr.freq)
2164 term = "sample_period";
2165
2166 printed += comma_fprintf(fp, &first, " %s=%" PRIu64,
2167 term, (u64)evsel->attr.sample_freq);
2163 } 2168 }
2164out: 2169out:
2165 fputc('\n', fp); 2170 fputc('\n', fp);