All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>, Jiri Olsa <jolsa@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH 0/5] perf record: Put a copy of kcore into the perf.data directory
Date: Fri,  4 Oct 2019 11:31:16 +0300	[thread overview]
Message-ID: <20191004083121.12182-1-adrian.hunter@intel.com> (raw)

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

             reply	other threads:[~2019-10-04  8:32 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-04  8:31 Adrian Hunter [this message]
2019-10-04  8:31 ` [PATCH 1/5] perf data: Correctly identify directory data files Adrian Hunter
2019-11-12 11:18   ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-10-04  8:31 ` [PATCH 2/5] perf data: Move perf_dir_version into data.h Adrian Hunter
2019-11-12 11:18   ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-10-04  8:31 ` [PATCH 3/5] perf data: Rename directory "header" file to "data" Adrian Hunter
2019-11-12 11:18   ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-10-04  8:31 ` [PATCH 4/5] perf tools: Support single perf.data file directory Adrian Hunter
2019-10-07 11:20   ` Jiri Olsa
2019-10-07 12:06     ` Adrian Hunter
2019-10-21 12:42       ` Adrian Hunter
2019-10-21 13:46         ` Arnaldo Carvalho de Melo
2019-10-21 13:52           ` Jiri Olsa
2019-10-21 14:03         ` Arnaldo Carvalho de Melo
2019-11-12 11:18     ` [tip: perf/core] perf session: Fix indent in perf_session__new()" tip-bot2 for Jiri Olsa
2019-11-12 11:18   ` [tip: perf/core] perf data: Support single perf.data file directory tip-bot2 for Adrian Hunter
2019-10-04  8:31 ` [PATCH 5/5] perf record: Put a copy of kcore into the perf.data directory Adrian Hunter
2019-10-07 11:20   ` Jiri Olsa
2019-10-07 12:06     ` Adrian Hunter
2019-10-07 11:20   ` Jiri Olsa
2019-10-07 12:14     ` Adrian Hunter
2019-11-12 11:18   ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-10-07 12:55 ` [PATCH 0/5] " Jiri Olsa
2019-10-21 14:36 ` Arnaldo Carvalho de Melo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191004083121.12182-1-adrian.hunter@intel.com \
    --to=adrian.hunter@intel.com \
    --cc=acme@kernel.org \
    --cc=jolsa@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.