perf session: Report collisions in AUX records
authorSuzuki K Poulose <suzuki.poulose@arm.com>
Wed, 28 Jul 2021 09:12:19 +0000 (10:12 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Fri, 3 Sep 2021 11:29:55 +0000 (08:29 -0300)
Just like the other flags in the AUX records, report a summary of the
Collisions if there were any.

Signed-off-by: Suzuki Poulouse <suzuki.poulose@arm.com>
Reviewed-by: Leo Yan <leo.yan@linaro.org>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: James Clark <james.clark@arm.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Mike Leach <mike.leach@linaro.org>
Cc: Suzuki Poulouse <suzuki.poulose@arm.com>
Cc: coresight@lists.linaro.org
Cc: linux-arm-kernel@lists.infradead.org
LPU-Reference: 20210728091219.527886-1-suzuki.poulose@arm.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/events_stats.h
tools/perf/util/session.c

index 3480bafd414b851a771a63b8df53c639614540d1..1b00060922654d73568422236e60425a00919699 100644 (file)
@@ -30,6 +30,7 @@ struct events_stats {
        u64 total_lost_samples;
        u64 total_aux_lost;
        u64 total_aux_partial;
+       u64 total_aux_collision;
        u64 total_invalid_chains;
        u32 nr_events[PERF_RECORD_HEADER_MAX];
        u32 nr_lost_warned;
index d2e27ff96030283d76df289fe8add27054a37a3e..069c2cfdd3be6a7405196f697de057ea5377f9fa 100644 (file)
@@ -1541,6 +1541,8 @@ static int machines__deliver_event(struct machines *machines,
                                evlist->stats.total_aux_lost += 1;
                        if (event->aux.flags & PERF_AUX_FLAG_PARTIAL)
                                evlist->stats.total_aux_partial += 1;
+                       if (event->aux.flags & PERF_AUX_FLAG_COLLISION)
+                               evlist->stats.total_aux_collision += 1;
                }
                return tool->aux(tool, event, sample, machine);
        case PERF_RECORD_ITRACE_START:
@@ -1896,6 +1898,13 @@ static void perf_session__warn_about_errors(const struct perf_session *session)
                            "");
        }
 
+       if (session->tool->aux == perf_event__process_aux &&
+           stats->total_aux_collision != 0) {
+               ui__warning("AUX data detected collision  %" PRIu64 " times out of %u!\n\n",
+                           stats->total_aux_collision,
+                           stats->nr_events[PERF_RECORD_AUX]);
+       }
+
        if (stats->nr_unknown_events != 0) {
                ui__warning("Found %u unknown events!\n\n"
                            "Is this an older tool processing a perf.data "