diff options
author | Jiri Olsa <jolsa@kernel.org> | 2018-01-07 17:03:53 +0100 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-01-10 12:00:39 -0300 |
commit | 3d7c27b6dbca4c90e7d921b45c2240e7c3cb92a2 (patch) | |
tree | ecb6ee74ee84e5fa1e720f1994f6fc223014c345 /tools/perf/util | |
parent | 28a0b39877f5ed64ae9fadf95dddb90999309dee (diff) | |
download | blackbird-obmc-linux-3d7c27b6dbca4c90e7d921b45c2240e7c3cb92a2.tar.gz blackbird-obmc-linux-3d7c27b6dbca4c90e7d921b45c2240e7c3cb92a2.zip |
perf script: Add support to display lost events
Adding option to display lost events:
$ perf script --show-lost-events ...
mplayer 13810 [002] 468011.402396: 100 cycles:ppp: ff..
mplayer 13810 [002] 468011.402396: PERF_RECORD_LOST lost 3880
mplayer 13810 [002] 468011.402397: 100 cycles:ppp: ff..
Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20180107160356.28203-10-jolsa@kernel.org
[ Use PRIu64 when printing u64 values, fixing the build in some arches ]
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/event.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/perf/util/event.c b/tools/perf/util/event.c index 97a8ef9980db..44e603c27944 100644 --- a/tools/perf/util/event.c +++ b/tools/perf/util/event.c @@ -1435,6 +1435,11 @@ size_t perf_event__fprintf_switch(union perf_event *event, FILE *fp) event->context_switch.next_prev_tid); } +static size_t perf_event__fprintf_lost(union perf_event *event, FILE *fp) +{ + return fprintf(fp, " lost %" PRIu64 "\n", event->lost.lost); +} + size_t perf_event__fprintf(union perf_event *event, FILE *fp) { size_t ret = fprintf(fp, "PERF_RECORD_%s", @@ -1467,6 +1472,9 @@ size_t perf_event__fprintf(union perf_event *event, FILE *fp) case PERF_RECORD_SWITCH_CPU_WIDE: ret += perf_event__fprintf_switch(event, fp); break; + case PERF_RECORD_LOST: + ret += perf_event__fprintf_lost(event, fp); + break; default: ret += fprintf(fp, "\n"); } |