Skip to content

Commit a38f48e

Browse files
ahunter6acmel
authored andcommitted
perf session: Warn when AUX data has been lost
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>
1 parent 83e1986 commit a38f48e

2 files changed

Lines changed: 11 additions & 0 deletions

File tree

‎tools/perf/util/event.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ struct events_stats {
257257
u64 total_non_filtered_period;
258258
u64 total_lost;
259259
u64 total_lost_samples;
260+
u64 total_aux_lost;
260261
u64 total_invalid_chains;
261262
u32 nr_events[PERF_RECORD_HEADER_MAX];
262263
u32 nr_non_filtered_samples;

‎tools/perf/util/session.c‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,6 +1101,9 @@ static int machines__deliver_event(struct machines *machines,
11011101
case PERF_RECORD_UNTHROTTLE:
11021102
return tool->unthrottle(tool, event, sample, machine);
11031103
case PERF_RECORD_AUX:
1104+
if (tool->aux == perf_event__process_aux &&
1105+
(event->aux.flags & PERF_AUX_FLAG_TRUNCATED))
1106+
evlist->stats.total_aux_lost += 1;
11041107
return tool->aux(tool, event, sample, machine);
11051108
case PERF_RECORD_ITRACE_START:
11061109
return tool->itrace_start(tool, event, sample, machine);
@@ -1346,6 +1349,13 @@ static void perf_session__warn_about_errors(const struct perf_session *session)
13461349
}
13471350
}
13481351

1352+
if (session->tool->aux == perf_event__process_aux &&
1353+
stats->total_aux_lost != 0) {
1354+
ui__warning("AUX data lost %" PRIu64 " times out of %u!\n\n",
1355+
stats->total_aux_lost,
1356+
stats->nr_events[PERF_RECORD_AUX]);
1357+
}
1358+
13491359
if (stats->nr_unknown_events != 0) {
13501360
ui__warning("Found %u unknown events!\n\n"
13511361
"Is this an older tool processing a perf.data "

0 commit comments

Comments
 (0)