[PATCH 1/6] perf tools: Don't report zero period samples for slave events

From: Jiri Olsa
Date: Wed Feb 20 2019 - 07:28:37 EST


There's no reason to deliver sample for zero period.
It means there was no value for slave event since its
last group leader sample.

Link: http://lkml.kernel.org/n/tip-d5he0papol5dhwvfq33ess1p@xxxxxxxxxxxxxx
Signed-off-by: Jiri Olsa <jolsa@xxxxxxxxxx>
---
tools/perf/util/session.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index 18fb9c8cbf9c..c764bbc91009 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -1202,6 +1202,13 @@ static int deliver_sample_value(struct perf_evlist *evlist,
return 0;
}

+ /*
+ * There's no reason to deliver sample
+ * for zero period, bail out.
+ */
+ if (!sample->period)
+ return 0;
+
return tool->sample(tool, event, sample, sid->evsel, machine);
}

--
2.17.2