perfetto icon indicating copy to clipboard operation
perfetto copied to clipboard

Introduction of Arm CPU telemetry solution

Open pan- opened this issue 1 year ago • 8 comments

Arm introduced a CPU telemetry solution for its cores starting with Arm Neoverse N1. The telemetry solution helps developers understand where CPU cycles are spent, identify performance bottlenecks, and improve execution efficiency.

The CPU telemetry solution is based on specification files tailored for each core. These specification files describe core-specific PMU events and derived metrics, identifying key performance bottlenecks. They also define a metric tree for exploring microarchitectural performance.

Arm has released a CLI tool named topdown_tool to capture these metrics and has integrated support into its own products, such as the Streamline Performance Analyzer.

This PR enables support for Arm's CPU telemetry solution in Perfetto, proposing the following changes:

  • A new filter for traced perf to limit capture to a specific CPUID.
  • Addition of a CpuInfoManager in the App to manage CPU description files.
  • A new support page to visualize and load CPU specification files.
  • A new recording section guiding users in configuring PMU captures. Users select metrics to capture, and the system selects the correct PMU events based on the chosen CPU. Multiple configurations can be created simultaneously—for example, to capture events on systems with heterogeneous cores.
  • A new telemetry plugin that analyses captured events, computing and displaying metrics based on CPU specification files.

Additionally, this PR introduces a flag allowing Perfetto to connect to an alternative well-known socket instead of the default system socket. This is convenient when working with an updated tracebox/traced_perf on production systems where updating Perfetto itself may not be feasible.

pan- avatar Jul 01 '25 19:07 pan-

Thanks a lot for this. It comes as a bit of a surprise (I didn't know this was happening) but it's certainly a welcome surprise :) You definitely put a lot of though into this.

I'd echo Lalit's request: could this be split in different PRs? It's going to make it faster to iterate, as there are a bunch of independent discussion to have (e.g. on the socket, i have some questions, and some comment son the UI side), but I would not block a whole PR to have all the discussions, otherwise we'll never converge.

Huge thanks for contributing to this! looks awesome overall

primiano avatar Jul 03 '25 15:07 primiano

I propose to have four PR:

  • The CPUID filtering for traced perf
  • The socket flag
  • The CPU manager + page + telemetry plugin as they can work standalone without the recording page
  • The split panel change used to make tab more usable as widgets.
  • The Recording page for PMUs.

Does that sounds right or would you like to subdivide the third item further ?

pan- avatar Jul 03 '25 19:07 pan-

I think that looks like a very reasonble starting point. Lets go with that and we can discuss on individual PRs if we need any more splitting.

LalitMaganti avatar Jul 03 '25 22:07 LalitMaganti

@pan- Hello, checking in on whether you're waiting on us for a review, or we're waiting for a new version of the patches? Just clarifying, not intending to hurry you.

From me personally, once the patch is ready for review, please split the src/profiling/... changes into a separate PR (there was https://github.com/google/perfetto/pull/2034, maybe reuse that).

rsavitski avatar Sep 19 '25 13:09 rsavitski

@rsavitski Thanks for coming back to us, we need to split this PR into multiple pull request. I will let you know once it is complete.

pan- avatar Sep 23 '25 14:09 pan-

Created PRs according to @pan- 's proposal.

The CPUID filtering for traced perf: #2034 The socket flag: #2036 The CPU manager + page + telemetry plugin: #5284 The drawer panel change used to make tab more usable as widgets: #5282 The Recording page for PMUs: #5286

abhmen01 avatar Mar 31 '26 14:03 abhmen01

@abhmen01 There seems to be some issues with your PR split. Some of them have duplicted contents (the same diffs on different PRs) and is becoming hard to figure out what goes where. Also I cannot fully tell which PRs are ready to be reviewed and which ones you are still iterating on.

Can you be more explicit on the ones that are ready for review?

primiano avatar Apr 01 '26 09:04 primiano

Hi @primiano #2034, #2036, #5282, and #5284 are mutually exclusive and may be reviewed independently. #5286 has dependencies on certain commits from the above PRs; therefore, those commits have been grouped with it.

abhmen01 avatar Apr 02 '26 16:04 abhmen01