linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/7] coresight: etm-perf: Fix pid tracing with VHE
@ 2021-02-02 16:38 Leo Yan
  2021-02-02 16:38 ` [PATCH v2 1/7] coresight: etm-perf: Clarify comment on perf options Leo Yan
                   ` (6 more replies)
  0 siblings, 7 replies; 28+ messages in thread
From: Leo Yan @ 2021-02-02 16:38 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Mathieu Poirier, Suzuki K Poulose,
	Mike Leach, Jonathan Corbet, Alexander Shishkin, John Garry,
	Will Deacon, Peter Zijlstra, Ingo Molnar, Mark Rutland,
	Jiri Olsa, Namhyung Kim, Daniel Kiss, Denis Nikitin, coresight,
	linux-arm-kernel, linux-doc, linux-kernel
  Cc: Leo Yan

This patch series is to support PID tracing with Virtualization Host
Extensions (VHE).

Since the patch series v1 was sent out for reviewing, we had some
discussion and finalized the solution which is implemented in this
version.  Simply to say, to be backward compatibility, and can both
support PID tracing for the kernel is running at either EL1 or EL2,
the two new PMU formats "contextid1" and "contextid2" are introduced,
which works as a switch to trace PID for EL1 kernel and EL2 kernel
respectively.

The existed PMU format "contextid" needs to be backward compatible for
users, it's changed to an alias for "contextid1" on EL1 kernel and for
"contextid2" on EL2 kernel.  Therefore, even without setting "contextid"
config, the perf tool can dynamically pick up the config for PID
tracing, so the user doesn't have to set the "contexid" config manually.

As results, we now have three PMU formats, for easier understanding the
implementation, just copy and paste the descriptions for these three PMU
formats from the patch 07/07:

  "contextid1": Available on both EL1 kernel and EL2 kernel.  When the
                kernel is running at EL1, "contextid1" enables the PID
                tracing; when the kernel is running at EL2, this enables
                tracing the PID of guest applications.

  "contextid2": Only usable when the kernel is running at EL2.  When
                selected, enables PID tracing on EL2 kernel.

  "contextid":  Will be an alias for the option that enables PID
                tracing.  I.e,
                contextid == contextid1, on EL1 kernel.
                contextid == contextid2, on EL2 kernel.

This patch series can be cleanly applied on perf/core branch:

  commit cd07e536b020 ("Merge remote-tracking branch 'torvalds/master' into perf/core")

... and applied on the mainline kernel:

  commit 88bb507a74ea ("Merge tag 'media/v5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media")

The patch series has been tested on Arm Juno-r2 board.  Verified the
kernel with EL1 and didn't find issue; though absenting the platform for
kernel with EL2, after some hacking in kernel driver and tool to emulate
the code paths for kernel on EL2, can see the code path is hit without
failure.


Changes from v1:
* Refactored PMU formats, added formats "contextid1"/"contextid2", and
  reworked format "contextid" (Suzuki/Mathieu);
* Refined the comments for perf configs (Leo/Mike);
* Added patch 07/07 for description PID tracing in docs;
* Found the issue for bitmap for option, extracted patch 03/07 for the
  fixing.

Changes from RFC:
* Added comments to clarify cases requested (Leo);
* Explain the change to generic flags for cs_etm_set_option() in the
  commit description;
* Stored PID format in metadata and passed it to decoder (Leo);
* Enhanced cs-etm for backward compatibility (Denis Nikitin).


Leo Yan (3):
  coresight: etm-perf: Clarify comment on perf options
  perf cs-etm: Add helper cs_etm__get_pid_fmt()
  Documentation: coresight: Add PID tracing description

Suzuki K Poulose (4):
  coresight: etm-perf: Support PID tracing for kernel at EL2
  perf cs-etm: Fix bitmap for option
  perf cs-etm: Support PID tracing in config
  perf cs-etm: Detect pid in VMID for kernel running at EL2

 Documentation/trace/coresight/coresight.rst   | 37 ++++++++++
 .../hwtracing/coresight/coresight-etm-perf.c  | 32 +++++++-
 .../coresight/coresight-etm4x-core.c          | 13 ++++
 include/linux/coresight-pmu.h                 | 20 +++--
 tools/include/linux/coresight-pmu.h           | 20 +++--
 tools/perf/arch/arm/util/cs-etm.c             | 73 +++++++++++++++----
 .../perf/util/cs-etm-decoder/cs-etm-decoder.c | 32 +++++++-
 tools/perf/util/cs-etm.c                      | 43 +++++++++++
 tools/perf/util/cs-etm.h                      |  1 +
 9 files changed, 239 insertions(+), 32 deletions(-)

-- 
2.25.1


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

end of thread, other threads:[~2021-02-06  0:02 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-02 16:38 [PATCH v2 0/7] coresight: etm-perf: Fix pid tracing with VHE Leo Yan
2021-02-02 16:38 ` [PATCH v2 1/7] coresight: etm-perf: Clarify comment on perf options Leo Yan
2021-02-02 23:00   ` Suzuki K Poulose
2021-02-04  3:36     ` Leo Yan
2021-02-02 16:38 ` [PATCH v2 2/7] coresight: etm-perf: Support PID tracing for kernel at EL2 Leo Yan
2021-02-02 23:06   ` Suzuki K Poulose
2021-02-05 13:47     ` Mike Leach
2021-02-02 16:38 ` [PATCH v2 3/7] perf cs-etm: Fix bitmap for option Leo Yan
2021-02-05 11:47   ` Mike Leach
2021-02-02 16:38 ` [PATCH v2 4/7] perf cs-etm: Support PID tracing in config Leo Yan
2021-02-05 13:48   ` Mike Leach
2021-02-02 16:38 ` [PATCH v2 5/7] perf cs-etm: Add helper cs_etm__get_pid_fmt() Leo Yan
2021-02-02 23:19   ` Suzuki K Poulose
2021-02-04  3:47     ` Leo Yan
2021-02-04 10:54       ` Suzuki K Poulose
2021-02-04 11:23         ` Leo Yan
2021-02-02 16:38 ` [PATCH v2 6/7] perf cs-etm: Detect pid in VMID for kernel running at EL2 Leo Yan
2021-02-02 23:29   ` Suzuki K Poulose
2021-02-04  4:00     ` Leo Yan
2021-02-04 10:57       ` Suzuki K Poulose
2021-02-02 16:38 ` [PATCH v2 7/7] Documentation: coresight: Add PID tracing description Leo Yan
2021-02-02 23:24   ` Suzuki K Poulose
2021-02-04  4:02     ` Leo Yan
2021-02-03 17:39   ` Mike Leach
2021-02-04  4:09     ` Leo Yan
2021-02-04 11:08       ` Suzuki K Poulose
2021-02-04 12:14         ` Mike Leach
2021-02-05  5:42           ` Leo Yan

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).