perf session: Warn when AUX data has been lost
authorAdrian Hunter <adrian.hunter@intel.com>
Fri, 25 Sep 2015 13:15:37 +0000 (16:15 +0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 28 Sep 2015 19:51:33 +0000 (16:51 -0300)
By default 'perf record' will postprocess the perf.data file to
determine build-ids.  When that happens, the number of lost perf events
is displayed.

Make that also happen for AUX events.

Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Link: http://lkml.kernel.org/r/1443186956-18718-7-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/util/event.h
tools/perf/util/session.c

index be5cbc7be889cd66fcdd3fe4365e2b994d9e1442..a0dbcbd4f6d82d6564d56e48c0672ea56cba45bc 100644 (file)
@@ -257,6 +257,7 @@ struct events_stats {
        u64 total_non_filtered_period;
        u64 total_lost;
        u64 total_lost_samples;
+       u64 total_aux_lost;
        u64 total_invalid_chains;
        u32 nr_events[PERF_RECORD_HEADER_MAX];
        u32 nr_non_filtered_samples;
index f5e000030a5eabeb52aa35791ed402f9775972fc..15c84cad213ab733d9d76af9e428442065f63a8b 100644 (file)
@@ -1101,6 +1101,9 @@ static int machines__deliver_event(struct machines *machines,
        case PERF_RECORD_UNTHROTTLE:
                return tool->unthrottle(tool, event, sample, machine);
        case PERF_RECORD_AUX:
+               if (tool->aux == perf_event__process_aux &&
+                   (event->aux.flags & PERF_AUX_FLAG_TRUNCATED))
+                       evlist->stats.total_aux_lost += 1;
                return tool->aux(tool, event, sample, machine);
        case PERF_RECORD_ITRACE_START:
                return tool->itrace_start(tool, event, sample, machine);
@@ -1346,6 +1349,13 @@ static void perf_session__warn_about_errors(const struct perf_session *session)
                }
        }
 
+       if (session->tool->aux == perf_event__process_aux &&
+           stats->total_aux_lost != 0) {
+               ui__warning("AUX data lost %" PRIu64 " times out of %u!\n\n",
+                           stats->total_aux_lost,
+                           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 "