]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf tools: Minimal DEFERRED_CALLCHAIN support
authorNamhyung Kim <namhyung@kernel.org>
Thu, 20 Nov 2025 23:48:00 +0000 (15:48 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 3 Dec 2025 00:13:32 +0000 (16:13 -0800)
commitf4e3381648be205365cb475512ee536e108e060e
tree3e9c7eede37183b3d5d392426ffe959733a2b4f6
parent22b0ceee1c48178ed3a69a17ea36150ab1f1eb9a
perf tools: Minimal DEFERRED_CALLCHAIN support

Add a new event type for deferred callchains and a new callback for the
struct perf_tool.  For now it doesn't actually handle the deferred
callchains but it just marks the sample if it has the PERF_CONTEXT_
USER_DEFFERED in the callchain array.

At least, perf report can dump the raw data with this change.  Actually
this requires the next commit to enable attr.defer_callchain, but if you
already have a data file, it'll show the following result.

  $ perf report -D
  ...
  0x2158@perf.data [0x40]: event: 22
  .
  . ... raw event: size 64 bytes
  .  0000:  16 00 00 00 02 00 40 00 06 00 00 00 0b 00 00 00  ......@.........
  .  0010:  03 00 00 00 00 00 00 00 a7 7f 33 fe 18 7f 00 00  ..........3.....
  .  0020:  0f 0e 33 fe 18 7f 00 00 48 14 33 fe 18 7f 00 00  ..3.....H.3.....
  .  0030:  08 09 00 00 08 09 00 00 e6 7a e7 35 1c 00 00 00  .........z.5....

  121163447014 0x2158 [0x40]: PERF_RECORD_CALLCHAIN_DEFERRED(IP, 0x2): 2312/2312: 0xb00000006
  ... FP chain: nr:3
  .....  0: 00007f18fe337fa7
  .....  1: 00007f18fe330e0f
  .....  2: 00007f18fe331448
  : unhandled!

Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/lib/perf/include/perf/event.h
tools/perf/util/event.c
tools/perf/util/evsel.c
tools/perf/util/machine.c
tools/perf/util/perf_event_attr_fprintf.c
tools/perf/util/sample.h
tools/perf/util/session.c
tools/perf/util/tool.c
tools/perf/util/tool.h