Commit-ID:  529c1a9e18c3b470d2eff7879923eda40b1431db
Gitweb:     https://git.kernel.org/tip/529c1a9e18c3b470d2eff7879923eda40b1431db
Author:     Jiri Olsa <jo...@kernel.org>
AuthorDate: Wed, 20 Feb 2019 13:27:55 +0100
Committer:  Arnaldo Carvalho de Melo <a...@redhat.com>
CommitDate: Wed, 20 Feb 2019 16:07:51 -0300

perf session: Don't report zero period samples for slave events

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

Signed-off-by: Jiri Olsa <jo...@kernel.org>
Cc: Alexander Shishkin <alexander.shish...@linux.intel.com>
Cc: Andi Kleen <a...@linux.intel.com>
Cc: Namhyung Kim <namhy...@kernel.org>
Cc: Peter Zijlstra <pet...@infradead.org>
Link: http://lkml.kernel.org/r/20190220122800.864-2-jo...@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <a...@redhat.com>
---
 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);
 }
 

Reply via email to