All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC 00/10] perf: Add build id parsing fault detection/fix
@ 2021-06-22 15:39 Jiri Olsa
  2021-06-22 15:39 ` [PATCH 01/10] perf: Track build id faults for mmap2 event Jiri Olsa
                   ` (11 more replies)
  0 siblings, 12 replies; 21+ messages in thread
From: Jiri Olsa @ 2021-06-22 15:39 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo
  Cc: lkml, Peter Zijlstra, Ingo Molnar, Mark Rutland, Namhyung Kim,
	Alexander Shishkin, Michael Petlan, Ian Rogers

hi,
this *RFC* patchset adds support to detect faults during
mmap2's build id parsing and a way to fix such maps in
generated perf.data.

It adds support to record build id faults count for session
and store it in perf.data and perf inject support to find
these maps and reads build ids for them in user space.

It's probably best explained by the workflow:

  Record data with --buildid-mmap option:

    # perf record --buildid-mmap ...
    ...
    [ perf record: Woken up 1 times to write data ]
    [ perf record: Failed to parse 4 build ids]
    [ perf record: Captured and wrote 0.008 MB perf.data ]

  Check if there's any build id fault reported:

    # perf report --header-only
    ...
    # build id mmap stats: FAULTS 4, LOST 0, NOT FIXED

  There is, check the stats:

    # perf report --stat

    Aggregated stats:
             TOTAL events:        104
                      ....
           BUILD_ID fails:          4  (14.3%)

  Yep, let's fix it:

    # perf inject --buildid-mmap2 -i perf.data -o perf-fixed.data

  And verify:

    # perf report -i perf-fixed.data --stats

    Aggregated stats:
               TOTAL events:        104
                        ....

  Good, let's see how many we fixed:

    # perf report --header-only -i perf-fixed.data
    ...
    # build id mmap stats: FAULTS 4, LOST 0, FIXED(4)


I don't have a good way to test it, just by artificially
adding the faults in kernel code, but Ian and Namhyung
might have setup that could generate that.. would be great
to have a perf test for this.

Also available in here:
  git://git.kernel.org/pub/scm/linux/kernel/git/jolsa/perf.git
  perf/buildid_stats

thoughts?

thanks,
jirka


---
Jiri Olsa (10):
      perf: Track build id faults for mmap2 event
      perf: Move build_id_parse to check only regular files
      perf: Add new read_format bit to read build id faults
      perf: Add new read_format bit to read lost events
      tools: Sync perf_event.h uapi
      libperf: Do not allow PERF_FORMAT_GROUP in perf_evsel__read
      perf record: Add support to read build id fails
      perf record: Add new HEADER_BUILD_ID_MMAP feature
      perf report: Display build id fails stats
      perf inject: Add --buildid-mmap2 option to fix failed build ids

 include/linux/perf_event.h                         |  2 ++
 include/uapi/linux/perf_event.h                    | 20 +++++++++++++-------
 kernel/events/core.c                               | 49 +++++++++++++++++++++++++++++++++++++++++++------
 kernel/events/ring_buffer.c                        |  3 +++
 tools/include/uapi/linux/perf_event.h              | 20 +++++++++++++-------
 tools/lib/perf/evsel.c                             | 10 ++++++++++
 tools/lib/perf/include/perf/evsel.h                | 11 ++++++++++-
 tools/perf/Documentation/perf-inject.txt           |  3 +++
 tools/perf/Documentation/perf.data-file-format.txt | 19 +++++++++++++++++++
 tools/perf/builtin-inject.c                        | 45 +++++++++++++++++++++++++++++++++++++++++++--
 tools/perf/builtin-record.c                        | 97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/perf/builtin-report.c                        | 35 +++++++++++++++++++++++++++++++++++
 tools/perf/util/env.h                              |  6 ++++++
 tools/perf/util/evsel.c                            | 12 ++++++++++++
 tools/perf/util/header.c                           | 80 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tools/perf/util/header.h                           |  1 +
 tools/perf/util/map.h                              | 15 +++++++++++++++
 tools/perf/util/perf_event_attr_fprintf.c          |  3 ++-
 18 files changed, 407 insertions(+), 24 deletions(-)


^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2021-06-28  3:39 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-22 15:39 [RFC 00/10] perf: Add build id parsing fault detection/fix Jiri Olsa
2021-06-22 15:39 ` [PATCH 01/10] perf: Track build id faults for mmap2 event Jiri Olsa
2021-06-22 15:39 ` [PATCH 02/10] perf: Move build_id_parse to check only regular files Jiri Olsa
2021-06-22 15:39 ` [PATCH 03/10] perf: Add new read_format bit to read build id faults Jiri Olsa
2021-06-22 15:39 ` [PATCH 04/10] perf: Add new read_format bit to read lost events Jiri Olsa
2021-06-22 15:39 ` [PATCH 05/10] tools: Sync perf_event.h uapi Jiri Olsa
2021-06-22 15:39 ` [PATCH 06/10] libperf: Do not allow PERF_FORMAT_GROUP in perf_evsel__read Jiri Olsa
2021-06-22 15:39 ` [PATCH 07/10] perf record: Add support to read build id fails Jiri Olsa
2021-06-22 15:39 ` [PATCH 08/10] perf record: Add new HEADER_BUILD_ID_MMAP feature Jiri Olsa
2021-06-22 15:39 ` [PATCH 09/10] perf report: Display build id fails stats Jiri Olsa
2021-06-22 15:39 ` [PATCH 10/10] perf inject: Add --buildid-mmap2 option to fix failed build ids Jiri Olsa
2021-06-22 17:39 ` [RFC 00/10] perf: Add build id parsing fault detection/fix Arnaldo Carvalho de Melo
2021-06-22 17:47   ` Ian Rogers
2021-06-22 18:14     ` Arnaldo Carvalho de Melo
2021-06-22 21:19       ` Jiri Olsa
2021-06-23 19:48         ` Namhyung Kim
2021-06-24 11:44           ` Michael Petlan
2021-06-27 17:27             ` Jiri Olsa
2021-06-27 17:25           ` Jiri Olsa
2021-06-28  3:39             ` Namhyung Kim
2021-06-23 20:15 ` Namhyung Kim

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.