Skip to content

perf tools: Show per-event lost sample count (v2)

Namhyung Kim linux-perf-users lkml 1 version Applied

Status from this message: Thanks, applied.

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 2 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5perf tools: Print LOST read format in the verbose modetools/perf/util/perf_event_attr_fprintf.c+1 -10 replies
2/5perf record: Set PERF_FORMAT_LOST by defaulttools/perf/util/evsel.c tools/perf/util/evsel.h+10 -10 replies
3/5perf record: Read and inject LOST_SAMPLES eventstools/perf/builtin-record.c+64 -00 replies
4/5perf hist: Add nr_lost_samples to hist_statstools/perf/util/events_stats.h tools/perf/util/hist.c tools/perf/util/hist.h+7 -00 replies
5/5perf report: Show per-event LOST SAMPLES stattools/perf/builtin-report.c tools/perf/util/hist.c+24 -30 replies

Reviews trailers per patch

None of the 5 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchAdrian Hunter
SeriesR-b
1/5
2/5
3/5
4/5
5/5

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCHSET 0/5] perf tools: Show per-event lost sample count (v2)

Hello,

Now we have PERF_FORMAT_LOST support, add it to perf record and report so that it can show number of lost samples per event. This can be useful if you want to reconstruct number of events from the samples like when using -c option.

Changes in v2)
* fix id_hdr_size calculation (Adrian)
* fix a memory leak
* display lost samples even if no samples

Currently it adds PERF_RECORD_LOST_SAMPLES at the end of perf data after reading event values by read(2). The perf record unconditionally sets the lost bit if the kernel supports it. Users can see the number with perf report --stat.

You can get the code from 'perf/report-lost-v2' brach on

git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git

Thanks,
Namhyung

Namhyung Kim (5):
perf tools: Print LOST read format in the verbose mode perf record: Set PERF_FORMAT_LOST by default perf record: Read and inject LOST_SAMPLES events perf hist: Add nr_lost_samples to hist_stats perf report: Show per-event LOST SAMPLES stat

 tools/perf/builtin-record.c               | 64 +++++++++++++++++++++++
 tools/perf/builtin-report.c               | 17 ++++++
 tools/perf/util/events_stats.h            |  1 +
 tools/perf/util/evsel.c                   | 10 +++-
 tools/perf/util/evsel.h                   |  1 +
 tools/perf/util/hist.c                    | 15 ++++--
 tools/perf/util/hist.h                    |  1 +
 tools/perf/util/perf_event_attr_fprintf.c |  2 +-
 8 files changed, 106 insertions(+), 5 deletions(-)

base-commit: 6c3bd8d3e01d9014312caa52e4ef1c29d5249648

Signature · 1 line
2.37.2.789.g6183377224-goog