Skip to content

perf record: Put a copy of kcore into the perf.data directory

Adrian Hunter lkml 1 version Applied

Status from this message: Applied, thanks a lot,

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 12 repliesApplied

Patches in v1 Applied

#Subject and filesSizeRepliesApplied
1/5perf data: Correctly identify directory data filestools/perf/util/data.c+1 -10 replies
2/5perf data: Move perf_dir_version into data.htools/perf/util/data.h tools/perf/util/header.h+4 -40 replies
3/5perf data: Rename directory "header" file to "data"tools/perf/util/data.c tools/perf/util/util.c+2 -20 replies
4/5perf tools: Support single perf.data file directorytools/perf/Documentation/perf.data-directory-format.txt tools/perf/builtin-record.c tools/perf/util/data.c +1 more+43 -26 replies
5/5perf record: Put a copy of kcore into the perf.data directorytools/perf/Documentation/perf-record.txt tools/perf/Documentation/perf.data-directory-format.txt tools/perf/builtin-record.c +5 more+147 -04 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.

PatchJiri Olsa
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 [PATCH 0/5] perf record: Put a copy of kcore into the perf.data directory

Hi

Here are patches to add a new 'perf record' option '--kcore' which will put a copy of /proc/kcore, kallsyms and modules into a perf.data directory. Note, that without the --kcore option, output goes to a file as previously. The tools' -o and -i options work with either a file name or directory name.

Example:

 $ sudo perf record --kcore uname
 $ sudo tree perf.data
 perf.data
 ├── kcore_dir
 │   ├── kallsyms
 │   ├── kcore
 │   └── modules
 └── data
 $ sudo perf script -v
 build id event received for vmlinux: 1eaa285996affce2d74d8e66dcea09a80c9941de
 build id event received for [vdso]: 8bbaf5dc62a9b644b4d4e4539737e104e4a84541
 Samples for 'cycles' event do not have CPU attribute set. Skipping 'cpu' field.
 Using CPUID GenuineIntel-6-8E-A
 Using perf.data/kcore_dir/kcore for kernel data
 Using perf.data/kcore_dir/kallsyms for symbols
             perf 19058 506778.423729:          1 cycles:  ffffffffa2caa548 native_write_msr+0x8 (vmlinux)
             perf 19058 506778.423733:          1 cycles:  ffffffffa2caa548 native_write_msr+0x8 (vmlinux)
             perf 19058 506778.423734:          7 cycles:  ffffffffa2caa548 native_write_msr+0x8 (vmlinux)
             perf 19058 506778.423736:        117 cycles:  ffffffffa2caa54a native_write_msr+0xa (vmlinux)
             perf 19058 506778.423738:       2092 cycles:  ffffffffa2c9b7b0 native_apic_msr_write+0x0 (vmlinux)
             perf 19058 506778.423740:      37380 cycles:  ffffffffa2f121d0 perf_event_addr_filters_exec+0x0 (vmlinux)
            uname 19058 506778.423751:     582673 cycles:  ffffffffa303a407 propagate_protected_usage+0x147 (vmlinux)
            uname 19058 506778.423892:    2241841 cycles:  ffffffffa2cae0c9 unwind_next_frame.part.5+0x79 (vmlinux)
            uname 19058 506778.424430:    2457397 cycles:  ffffffffa3019232 check_memory_region+0x52 (vmlinux)

Adrian Hunter (5):
perf data: Correctly identify directory data files perf data: Move perf_dir_version into data.h
perf data: Rename directory "header" file to "data" perf tools: Support single perf.data file directory perf record: Put a copy of kcore into the perf.data directory

 tools/perf/Documentation/perf-record.txt           |  3 ++
 .../Documentation/perf.data-directory-format.txt   | 63 ++++++++++++++++++++++
 tools/perf/builtin-record.c                        | 54 ++++++++++++++++++-
 tools/perf/util/data.c                             | 46 ++++++++++++++--
 tools/perf/util/data.h                             | 12 +++++
 tools/perf/util/header.h                           |  4 --
 tools/perf/util/record.h                           |  1 +
 tools/perf/util/session.c                          |  4 ++
 tools/perf/util/util.c                             | 19 ++++++-
 9 files changed, 197 insertions(+), 9 deletions(-)
 create mode 100644 tools/perf/Documentation/perf.data-directory-format.txt

Regards
Adrian