linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v7 0/6] perf: add ability to sample interrupted machine state
@ 2014-09-24 11:48 Stephane Eranian
  2014-09-24 11:48 ` [PATCH v7 1/6] perf: add ability to sample machine state on interrupt Stephane Eranian
                   ` (6 more replies)
  0 siblings, 7 replies; 23+ messages in thread
From: Stephane Eranian @ 2014-09-24 11:48 UTC (permalink / raw)
  To: linux-kernel; +Cc: peterz, mingo, ak, jolsa, acme, cebbert.lkml

This short patch series add the ability to sample the interrupted
machine state for each hardware sample. This is useful to analyze
the state after certain events, for instance for function value
profiling after a call instruction.

The patch extends the interface with a new PERF_SAMPLE_REGS_INTR 
smaple_type flag. The register to sample can be named in the
sample_regs_intr bitmask for each event. The name and bit
position for each register is architecture dependent and
provided, just like for PERF_SAMPLE_REGS_USER by asm/perf_regs.h.

The support is similar to PERF_SAMPLE_REGS_USER.

On Intel x86, the series includes support for capturing the
PEBS state as well. When precise sampling is used, the interrupted
state is collect from the PEBS records, at least partially.
The PEBS machine state is a subset of the machine state.

The series provides access to this new feature in perf record
with the -I option. It is possible to display the sampled
register values using perf report -D.

This patch series is the fundation for a future series adding
function value profiling.

In V2, we address the issues raised during reviews:
 - add sample parsing test
 - shorten perf record option to --intr-regs
 - added man page for perf record -I/--intr-regs option
 - refactor register printf code between user and intr regs
 - rebase to v3.16-rc3

In V3, we rebase to 3.16.0+ and made the modifications suggested
by PeterZ. We also integrated his patch to improve the layout
of perf_sample_data.

In V4, we rebase to 3.17-rc3 and we fix the ABI change issue 
reported by Namhyung Kim.

In V5, the patch is rebased to 3.17-rc4 and the bugs reported
on LKML about the PEBS machine state copying code have been fixed
(a few registers were missing).

In V6, we added the missing copy of the eflags from the PEBS
mahcine state (reported by Andi). We fixed some formatting
issues. We rebased to 3.17-rc6.

In V7, we fix the eflags compilation error, we added
the #ifndef CONFIG_X86_32 to enable 32-bit compilations.
Still relative to 3.17-rc6

Peter Zijlstra (1):
  perf: improve perf_sample_data struct layout

Stephane Eranian (5):
  perf: add ability to sample machine state on interrupt
  perf/x86: add support for sampling PEBS machine state registers
  perf tools: add core support for sampling intr machine state regs
  perf/tests: add interrupted state sample parsing test
  perf record: add new -I option to sample interrupted machine state

 arch/x86/kernel/cpu/perf_event_intel_ds.c |   23 ++++++++++++
 include/linux/perf_event.h                |   37 ++++++++++---------
 include/uapi/linux/perf_event.h           |   15 +++++++-
 kernel/events/core.c                      |   51 ++++++++++++++++++++++++--
 tools/perf/Documentation/perf-record.txt  |    6 ++++
 tools/perf/builtin-record.c               |    2 ++
 tools/perf/perf.h                         |    1 +
 tools/perf/tests/sample-parsing.c         |   55 +++++++++++++++++++++--------
 tools/perf/util/event.h                   |    1 +
 tools/perf/util/evsel.c                   |   46 +++++++++++++++++++++++-
 tools/perf/util/header.c                  |    1 +
 tools/perf/util/session.c                 |   44 ++++++++++++++++++++---
 12 files changed, 240 insertions(+), 42 deletions(-)

-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 23+ messages in thread

end of thread, other threads:[~2014-12-12  8:19 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-24 11:48 [PATCH v7 0/6] perf: add ability to sample interrupted machine state Stephane Eranian
2014-09-24 11:48 ` [PATCH v7 1/6] perf: add ability to sample machine state on interrupt Stephane Eranian
2014-11-16 12:35   ` [tip:perf/core] perf: Add " tip-bot for Stephane Eranian
2014-11-21 21:26   ` [PATCH v7 1/6] perf: add " Arnaldo Carvalho de Melo
2014-12-09 13:30     ` Arnaldo Carvalho de Melo
2014-12-09 13:39       ` Arnaldo Carvalho de Melo
2014-12-09 13:53         ` perf tests: Fix attr tests size values interrupt Jiri Olsa
2014-12-09 13:59           ` Arnaldo Carvalho de Melo
2014-12-12  8:18           ` [tip:perf/urgent] perf tests: Fix attr tests size values to cope with machine state on interrupt ABI changes tip-bot for Jiri Olsa
2014-09-24 11:48 ` [PATCH v7 2/6] perf/x86: add support for sampling PEBS machine state registers Stephane Eranian
2014-11-16 12:35   ` [tip:perf/core] perf/x86: Add " tip-bot for Stephane Eranian
2014-09-24 11:48 ` [PATCH v7 3/6] perf tools: add core support for sampling intr machine state regs Stephane Eranian
2014-11-16 12:36   ` [tip:perf/core] perf tools: Add " tip-bot for Stephane Eranian
2014-09-24 11:48 ` [PATCH v7 4/6] perf/tests: add interrupted state sample parsing test Stephane Eranian
2014-11-16 12:36   ` [tip:perf/core] perf/tests: Add " tip-bot for Stephane Eranian
2014-09-24 11:48 ` [PATCH v7 5/6] perf record: add new -I option to sample interrupted machine state Stephane Eranian
2014-11-16 12:36   ` [tip:perf/core] perf record: Add " tip-bot for Stephane Eranian
2014-09-24 11:48 ` [PATCH v7 6/6] perf: improve perf_sample_data struct layout Stephane Eranian
2014-11-16 12:37   ` [tip:perf/core] perf: Improve the " tip-bot for Peter Zijlstra
2014-09-25  9:26 ` [PATCH v7 0/6] perf: add ability to sample interrupted machine state Peter Zijlstra
2014-09-25 10:32   ` Stephane Eranian
2014-09-25 14:29     ` Peter Zijlstra
2014-09-25 16:22       ` Stephane Eranian

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).