diff options
author | Blake Jones <blakejones@google.com> | 2025-06-12 12:49:37 -0700 |
---|---|---|
committer | Namhyung Kim <namhyung@kernel.org> | 2025-06-20 14:48:49 -0700 |
commit | fdc3441f2d317b40ace0936ee040a6c895d60014 (patch) | |
tree | d6c3c35449af0d7a1608b7bf4559663dc14e4dca /tools/perf/builtin-record.c | |
parent | ab38e84ba9a80581e055408e0f8c0158998fa4b9 (diff) |
perf record: collect BPF metadata from new programs
This collects metadata for any BPF programs that were loaded during a
"perf record" run, and emits it at the end of the run.
Signed-off-by: Blake Jones <blakejones@google.com>
Link: https://lore.kernel.org/r/20250612194939.162730-4-blakejones@google.com
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/builtin-record.c')
-rw-r--r-- | tools/perf/builtin-record.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 0b566f300569..53971b9de3ba 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -2162,6 +2162,14 @@ out: return err; } +static void record__synthesize_final_bpf_metadata(struct record *rec __maybe_unused) +{ +#ifdef HAVE_LIBBPF_SUPPORT + perf_event__synthesize_final_bpf_metadata(rec->session, + process_synthesized_event); +#endif +} + static int record__process_signal_event(union perf_event *event __maybe_unused, void *data) { struct record *rec = data; @@ -2807,6 +2815,8 @@ static int __cmd_record(struct record *rec, int argc, const char **argv) trigger_off(&auxtrace_snapshot_trigger); trigger_off(&switch_output_trigger); + record__synthesize_final_bpf_metadata(rec); + if (opts->auxtrace_snapshot_on_exit) record__auxtrace_snapshot_exit(rec); |