[lkml]   [2017]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[PATCH 48/83] perf script: Allow printing period for non freq mode groups
From: Andi Kleen <>

When using leader sampling the values of the not sampled but counted
events are shown by perf script in "period".

Currently printing period is only allowed when the main event has a
period, that is it is in frequency mode.

This implies that we cannot dump the values of counted events when the
leader event is not in frequency mode.

Just remove the check that the period must be set on all events. It will
just be printed as 0 instead if it's not available.

This fixes the following:

$ perf record -c 100000 -e '{cycles,branches}:S'
$ perf script -F event,period

Further commentary by Jiri Olsa:

The period will be the value of configured period, not 0:

int perf_evsel__parse_sample(struct ...
data->period = evsel->attr.sample_period;

$ perf record -c 100000
$ perf script -F event,period | head -3
Failed to open /tmp/, continuing without symbols
100000 cycles:ppp:
100000 cycles:ppp:

other than that I think we can remove that check, because we will have
always sane number in period

Signed-off-by: Andi Kleen <>
Acked-by: Jiri Olsa <>
Signed-off-by: Arnaldo Carvalho de Melo <>
tools/perf/builtin-script.c | 5 -----
1 file changed, 5 deletions(-)

diff --git a/tools/perf/builtin-script.c b/tools/perf/builtin-script.c
index 9b43bda45a41..ee7c7aaaae72 100644
--- a/tools/perf/builtin-script.c
+++ b/tools/perf/builtin-script.c
@@ -423,11 +423,6 @@ static int perf_evsel__check_attr(struct perf_evsel *evsel,
PERF_OUTPUT_CPU, allow_user_set))
return -EINVAL;

- perf_evsel__check_stype(evsel, PERF_SAMPLE_PERIOD, "PERIOD",
- return -EINVAL;
perf_evsel__check_stype(evsel, PERF_SAMPLE_REGS_INTR, "IREGS",
 \ /
  Last update: 2017-11-17 21:47    [W:0.256 / U:4.116 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site