Skip to content

RFC perf-probe --cache and SDT support

Masami Hiramatsu lkml 3 versions – Applied

Status from this message: Applied.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 RFC Latest17 patches 6 repliesApplied
  2. v2 RFC16 patches 32 repliesApplied
  3. v1 RFC13 patches 0 repliesSuperseded

Patches in v3 Applied

#Subject and filesSizeRepliesApplied
1/17perf probe: Use strbuf for making strings in probe-event.ctools/perf/util/probe-event.c tools/perf/util/probe-event.h tools/perf/util/probe-finder.c+90 -1651 reply
2/17perf-buildid-cache: Use path/to/bin/buildid/elf instead of path/to/bin/buildidtools/perf/util/build-id.c tools/perf/util/dso.h tools/perf/util/symbol.c+52 -201 reply
3/17perf buildid: Introduce sysfs/filename__sprintf_build_idtools/perf/builtin-buildid-cache.c tools/perf/builtin-buildid-list.c tools/perf/util/build-id.c +1 more+47 -261 reply
4/17perf: Add lsdir to read a directorytools/perf/util/util.c tools/perf/util/util.h+38 -00 replies
5/17perf-buildid-cache: Use lsdir for looking up buildid cachestools/perf/util/build-id.c+5 -251 reply
6/17perf probe: Add --cache option to cache the probe definitionstools/perf/Documentation/perf-probe.txt tools/perf/builtin-probe.c tools/perf/util/build-id.c +5 more+448 -320 replies
7/17perf probe: Use cache entry if possibletools/perf/util/probe-event.c tools/perf/util/probe-file.c tools/perf/util/probe-file.h+91 -40 replies
8/17perf probe: Show all cached probestools/perf/Documentation/perf-probe.txt tools/perf/builtin-probe.c tools/perf/util/build-id.c +4 more+156 -70 replies
9/17perf probe: Remove caches when --cache is giventools/perf/Documentation/perf-probe.txt tools/perf/util/probe-event.c tools/perf/util/probe-file.c +1 more+54 -80 replies
10/17perf/sdt: ELF support for SDTtools/perf/util/symbol-elf.c tools/perf/util/symbol.h+274 -00 replies
11/17perf probe: Add group name supporttools/perf/util/probe-event.c+14 -90 replies
12/17perf-probe: Set default kprobe group name if it is not giventools/perf/util/probe-event.c+7 -30 replies
13/17perf buildid-cache: Scan and import user SDT events to probe cachetools/perf/util/build-id.c tools/perf/util/probe-file.c tools/perf/util/probe-file.h+90 -60 replies
14/17perf probe: Accept %sdt and %cached event nametools/perf/Documentation/perf-probe.txt tools/perf/util/probe-event.c tools/perf/util/probe-event.h +1 more+69 -220 replies
15/17perf-list: Show SDT eventstools/perf/builtin-list.c tools/perf/util/parse-events.c tools/perf/util/parse-events.h+88 -00 replies
16/17perf-list: Skip SDTs placed in invalid binariestools/perf/util/build-id.c tools/perf/util/build-id.h tools/perf/util/parse-events.c +2 more+30 -50 replies
17/17perf record: Support recording SDT eventstools/perf/builtin-probe.c tools/perf/util/parse-events.c tools/perf/util/probe-event.c +1 more+70 -110 replies

Reviews trailers per patch

1 of 17 patches has a Reviewed-by or Acked-by.

PatchNamhyung Kim
1/17
2/17
3/17
4/17
5/17
6/17
7/17
8/17
9/17
10/17A-b
11/17
12/17
13/17
14/17
15/17
16/17
17/17

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

Read the v3 thread

Cover letter [RFC PATCH perf/core v3 00/17] perf-probe --cache and SDT support

Hi,

Here is the 3rd version of the patchset for probe-cache and initial SDT support which are going to be perf-cache finally.

The previous version is here; https://lkml.org/lkml/2015/7/15/221

This version improves SDT support for perf-list and perf-record. It is still just a basic support (no wildcard support, nor @FILE/@BUILDID support). So this is an ongoing work report :)

As we discussed on the previous series, now all SDT events have "sdt_" prefix on the provider name. We also should support "@FILE" or "@BUILDID" suffixes for same-name SDTs.

perf-list shows only SDTs on existing binaries (no old/deleted files) and if the same-name events are shown, it adds "@FILE@BUILDID" suffixes after the events to clarify on which binary the SDT exists.

----

  # perf buildid-cache -a /usr/bin/gcc
  # perf list sdt

List of pre-defined events (to be used in -e):

    sdt_libgcc:unwind                                  [SDT event]
    sdt_libstdcxx:catch                                [SDT event]
    sdt_libstdcxx:rethrow                              [SDT event]
    sdt_libstdcxx:throw                                [SDT event]
  # perf buildid-cache -a /usr/lib/libstdc++.so.6
  # perf list sdt

List of pre-defined events (to be used in -e):

    sdt_libgcc:unwind                                  [SDT event]
    sdt_libstdcxx:catch@/usr/bin/gcc@0x05d261236bbb    [SDT event]
    sdt_libstdcxx:catch@/usr/lib/libstdc++.so.6.0.19@0xcd6ac0e6236c [SDT event]
    sdt_libstdcxx:rethrow@/usr/bin/gcc@0x05d261236bbb  [SDT event]
    sdt_libstdcxx:rethrow@/usr/lib/libstdc++.so.6.0.19@0xcd6ac0e6236c [SDT event]
    sdt_libstdcxx:throw@/usr/bin/gcc@0x05d261236bbb    [SDT event]
    sdt_libstdcxx:throw@/usr/lib/libstdc++.so.6.0.19@0xcd6ac0e6236c [SDT event]

----

In this version, I used "@" separater for both FILE and BUILDID, but I think it is also possible to use "%" for BUILDID. (BTW, I've cut down the BUILDID to the first 12 chars, and added "0x")

TODOs:
- (perf record) Allow glob matching for SDT event to specify events.
- (perf record) Support @FILE/@BUILDID suffix to record specific SDTs.
- (perf record) Try to unregister SDT events after record.
- (perf probe) Allow glob matching for pre-cached events.
- (perf probe) Support @FILE/@BUILDID suffix for pre-cached events. (also removes -x option when using pre-cached events)
- (ftrace) Support multiple SDTs on single event.

Since multiple same SDTs are defined in a single binary (e.g. libc:setjump has 3 different entries on libc-2.17.so), we need the last feature on ftrace, so that a single uprobe event can occur several different probe points.

Thank you,

---

Hemant Kumar (1):
perf/sdt: ELF support for SDT

Masami Hiramatsu (16):
perf probe: Use strbuf for making strings in probe-event.c
perf-buildid-cache: Use path/to/bin/buildid/elf instead of path/to/bin/buildid perf buildid: Introduce sysfs/filename__sprintf_build_id
perf: Add lsdir to read a directory
perf-buildid-cache: Use lsdir for looking up buildid caches
perf probe: Add --cache option to cache the probe definitions perf probe: Use cache entry if possible
perf probe: Show all cached probes
perf probe: Remove caches when --cache is given
perf probe: Add group name support
perf-probe: Set default kprobe group name if it is not given perf buildid-cache: Scan and import user SDT events to probe cache perf probe: Accept %sdt and %cached event name
perf-list: Show SDT events
perf-list: Skip SDTs placed in invalid binaries
perf record: Support recording SDT events

 tools/perf/Documentation/perf-probe.txt |   14 +
 tools/perf/builtin-buildid-cache.c      |   14 -
 tools/perf/builtin-buildid-list.c       |   24 +
 tools/perf/builtin-list.c               |    3 
 tools/perf/builtin-probe.c              |    6 
 tools/perf/util/build-id.c              |  255 +++++++++++---
 tools/perf/util/build-id.h              |    8 
 tools/perf/util/dso.h                   |    5 
 tools/perf/util/parse-events.c          |  142 ++++++++
 tools/perf/util/parse-events.h          |    2 
 tools/perf/util/probe-event.c           |  574 ++++++++++++++++++++-----------
 tools/perf/util/probe-event.h           |   10 -
 tools/perf/util/probe-file.c            |  467 +++++++++++++++++++++++++
 tools/perf/util/probe-file.h            |   28 ++
 tools/perf/util/probe-finder.c          |   14 -
 tools/perf/util/symbol-elf.c            |  252 ++++++++++++++
 tools/perf/util/symbol.c                |    2 
 tools/perf/util/symbol.h                |   22 +
 tools/perf/util/util.c                  |   34 ++
 tools/perf/util/util.h                  |    4 
 20 files changed, 1580 insertions(+), 300 deletions(-)
Signature · 5 lines
Masami HIRAMATSU
Linux Technology Research Center, System Productivity Research Dept.
Center for Technology Innovation - Systems Engineering 
Hitachi, Ltd., Research & Development Group
E-mail: [email protected]