From: Adrian Hunter <adrian.hunter@intel.com>
To: Arnaldo Carvalho de Melo <acme@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>, linux-kernel@vger.kernel.org
Subject: [PATCH 00/15] perf tools: Add support for AUX area sampling
Date: Fri, 15 Nov 2019 14:42:10 +0200 [thread overview]
Message-ID: <20191115124225.5247-1-adrian.hunter@intel.com> (raw)
Hi
The kernel changes for AUX area sampling are now in tip, so here are the
tools' patches.
AUX area sampling allows bytes from a AUX area buffer to be copied onto
samples of other events.
Here is the Intel PT documentation from patch "perf intel-pt: Add support
for recording AUX area":
perf record AUX area sampling option
------------------------
To select Intel PT "sampling" the AUX area sampling option can be used:
--aux-sample
Optionally it can be followed by the sample size in bytes e.g.
--aux-sample=8192
In addition, the Intel PT event to sample must be defined e.g.
-e intel_pt//u
Samples on other events will be created containing Intel PT data e.g. the
following will create Intel PT samples on the branch-misses event, note the
events must be grouped using {}:
perf record --aux-sample -e '{intel_pt//u,branch-misses:u}'
An alternative to '--aux-sample' is to add the config term 'aux-sample-size' to
events. In this case, the grouping is implied e.g.
perf record -e intel_pt//u -e branch-misses/aux-sample-size=8192/u
is the same as:
perf record -e '{intel_pt//u,branch-misses/aux-sample-size=8192/u}'
but allows for also using an address filter e.g.:
perf record -e intel_pt//u --filter 'filter * @/bin/ls' -e branch-misses/aux-sample-size=8192/u -- ls
It is important to select a sample size that is big enough to contain at least
one PSB packet. If not a warning will be displayed:
Intel PT sample size (%zu) may be too small for PSB period (%zu)
The calculation used for that is: if sample_size <= psb_period + 256 display the
warning. When sampling is used, psb_period defaults to 0 (2KiB).
The default sample size is 4KiB.
The sample size is passed in aux_sample_size in struct perf_event_attr. The
sample size is limited by the maximum event size which is 64KiB. It is
difficult to know how big the event might be without the trace sample attached,
but the tool validates that the sample size is not greater than 60KiB.
Adrian Hunter (15):
perf tools: Add kernel AUX area sampling definitions
perf tools: Add AUX area sample parsing
perf tools: Add a function to test for kernel support for AUX area sampling
perf auxtrace: Move perf_evsel__find_pmu()
perf auxtrace: Add support for AUX area sample recording
perf record: Add support for AUX area sampling
perf record: Add aux-sample-size config term
perf inject: Cut AUX area samples
perf auxtrace: Add support for dumping AUX area samples
perf session: Add facility to peek at all events
perf auxtrace: Add support for queuing AUX area samples
perf pmu: When using default config, record which bits of config were changed by the user
perf intel-pt: Add support for recording AUX area samples
perf intel-pt: Add support for decoding AUX area samples
perf intel-bts: Does not support AUX area sampling
tools/include/uapi/linux/perf_event.h | 10 +-
tools/perf/Documentation/intel-pt.txt | 59 +++++-
tools/perf/Documentation/perf-record.txt | 9 +
tools/perf/arch/x86/util/auxtrace.c | 4 +
tools/perf/arch/x86/util/intel-bts.c | 5 +
tools/perf/arch/x86/util/intel-pt.c | 81 +++++++-
tools/perf/builtin-inject.c | 29 +++
tools/perf/builtin-record.c | 21 +-
tools/perf/tests/attr/base-record | 2 +-
tools/perf/tests/attr/base-stat | 2 +-
tools/perf/tests/sample-parsing.c | 16 +-
tools/perf/util/auxtrace.c | 322 ++++++++++++++++++++++++++++--
tools/perf/util/auxtrace.h | 42 ++++
tools/perf/util/event.h | 6 +
tools/perf/util/evlist.h | 1 +
tools/perf/util/evsel.c | 31 +++
tools/perf/util/evsel_config.h | 13 ++
tools/perf/util/intel-pt.c | 109 +++++++++-
tools/perf/util/parse-events.c | 56 +++++-
tools/perf/util/parse-events.h | 1 +
tools/perf/util/parse-events.l | 1 +
tools/perf/util/perf_event_attr_fprintf.c | 3 +-
tools/perf/util/pmu.c | 10 +
tools/perf/util/pmu.h | 2 +
tools/perf/util/record.c | 30 +++
tools/perf/util/record.h | 2 +
tools/perf/util/session.c | 38 +++-
tools/perf/util/session.h | 5 +
tools/perf/util/synthetic-events.c | 12 ++
29 files changed, 894 insertions(+), 28 deletions(-)
Regards
Adrian
next reply other threads:[~2019-11-15 12:43 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-15 12:42 Adrian Hunter [this message]
2019-11-15 12:42 ` [PATCH 01/15] perf tools: Add kernel AUX area sampling definitions Adrian Hunter
2019-11-21 13:57 ` Arnaldo Carvalho de Melo
2019-11-15 12:42 ` [PATCH 02/15] perf tools: Add AUX area sample parsing Adrian Hunter
2019-11-23 8:15 ` [tip: perf/core] perf tools: Add kernel AUX area sampling definitions tip-bot2 for Adrian Hunter
2019-11-15 12:42 ` [PATCH 03/15] perf tools: Add a function to test for kernel support for AUX area sampling Adrian Hunter
2019-11-23 8:15 ` [tip: perf/core] perf record: " tip-bot2 for Adrian Hunter
2019-11-15 12:42 ` [PATCH 04/15] perf auxtrace: Move perf_evsel__find_pmu() Adrian Hunter
2019-11-23 8:15 ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-11-15 12:42 ` [PATCH 05/15] perf auxtrace: Add support for AUX area sample recording Adrian Hunter
2019-11-23 8:15 ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-11-15 12:42 ` [PATCH 06/15] perf record: Add support for AUX area sampling Adrian Hunter
2019-11-23 8:15 ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-11-15 12:42 ` [PATCH 07/15] perf record: Add aux-sample-size config term Adrian Hunter
2019-11-23 8:15 ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-11-15 12:42 ` [PATCH 08/15] perf inject: Cut AUX area samples Adrian Hunter
2019-11-23 8:15 ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-11-15 12:42 ` [PATCH 09/15] perf auxtrace: Add support for dumping " Adrian Hunter
2019-11-23 8:15 ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-11-15 12:42 ` [PATCH 10/15] perf session: Add facility to peek at all events Adrian Hunter
2019-11-23 8:15 ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-11-15 12:42 ` [PATCH 11/15] perf auxtrace: Add support for queuing AUX area samples Adrian Hunter
2019-11-23 8:15 ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-11-15 12:42 ` [PATCH 12/15] perf pmu: When using default config, record which bits of config were changed by the user Adrian Hunter
2019-11-23 8:15 ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-11-15 12:42 ` [PATCH 13/15] perf intel-pt: Add support for recording AUX area samples Adrian Hunter
2019-11-21 14:28 ` Arnaldo Carvalho de Melo
2019-11-21 14:31 ` Arnaldo Carvalho de Melo
2019-11-21 14:31 ` Arnaldo Carvalho de Melo
2019-11-23 8:15 ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-11-15 12:42 ` [PATCH 14/15] perf intel-pt: Add support for decoding " Adrian Hunter
2019-11-23 8:15 ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-11-15 12:42 ` [PATCH 15/15] perf intel-bts: Does not support AUX area sampling Adrian Hunter
2019-11-23 8:15 ` [tip: perf/core] " tip-bot2 for Adrian Hunter
2019-11-21 13:03 ` [PATCH 00/15] perf tools: Add support for " Adrian Hunter
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=20191115124225.5247-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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox