How xinydev/telemetry-solution works
Purpose and Primary Entry Points
Arm Telemetry Solution is a performance-analysis repository for Arm CPU PMUs and CMN interconnect telemetry. Its central workflow is specification-driven collection, metric calculation, and Topdown bottleneck analysis. The primary executable is the Python Topdown CLI at tools/topdown_tool/topdown_tool/__main__.py, with orchestration in tools/topdown_tool/topdown_tool/probe/probe.py.
Telemetry Specifications as the Data Contract
Versioned JSON schemas and product specifications define raw events, derived metrics, groups, and methodology trees. CPU and CMN are distinct specification domains with a shared JSON-driven model:
• data/pmu/cpu/schemas/v1.2.schema.json
• data/pmu/cpu/specifications/neoverse/neoverse_v3_r0p0_pmu.json
• data/pmu/cmn/specifications/cmn_700_r0p0_pmu.json
The Topdown tool loads these specifications through tools/topdown_tool/topdown_tool/common/spec_loader.py; schemas/specifications are the boundary between Arm IP telemetry definitions and collection implementations.
Topdown Probe Layer
The probe layer selects and drives CPU or CMN analysis. CPU detection, model construction, telemetry-database handling, metric computation, and output rendering are separated under:
• tools/topdown_tool/topdown_tool/cpu_probe/cpu_detector.py
• tools/topdown_tool/topdown_tool/cpu_probe/cpu_factory.py
• tools/topdown_tool/topdown_tool/cpu_probe/cpu_probe.py
CPU flows are: detect target CPU → select matching specification → resolve event dependencies and methodology/group selection → collect counters → compute per-core/aggregate metrics → render CLI or CSV output. The metric decision tree implements Stage 1 Topdown and deeper metric-group analysis.
CMN Discovery, Modeling, and Scheduling
CMN analysis adds a hardware-topology boundary: static CMN revision specifications must be combined with discovered mesh instances, nodes, ports, and device types. The CMN subsystem models that topology and translates component events, filters, and watchpoints into collectable plans:
• tools/topdown_tool/topdown_tool/cmn_probe/cmn_factory.py
• tools/topdown_tool/topdown_tool/cmn_probe/cmn_model.py
• tools/topdown_tool/topdown_tool/cmn_probe/scheduler.py
multi_cmn_scheduler.py coordinates scheduling across CMN instances. CMN collection is constrained by hardware counter/watchpoint availability, unlike purely declarative metric definitions.
Collection and Target Runtime Boundary
The tool executes workloads while PMU collection backends acquire measurements. Workload modes isolate command, PID-tracked, and system-wide execution:
• tools/topdown_tool/topdown_tool/workload/command_workload.py
• tools/topdown_tool/topdown_tool/workload/pid_workload.py
• tools/topdown_tool/topdown_tool/workload/systemwide_workload.py
Linux collection integrates with perf via tools/topdown_tool/topdown_tool/perf/linux_perf.py; Windows support is represented by tools/topdown_tool/topdown_tool/perf/windows_perf.py and wperf_artifact_handler.py. Local and remote Linux command execution are abstracted in tools/topdown_tool/topdown_tool/common/command_runner/remote_linux.py, making host/target transport an explicit infrastructure boundary.
Supporting Toolchain and Validation Workloads
The repository also produces and consumes telemetry-adjacent artifacts. tools/perf_json_generator/generate.py generates Linux perf JSON metadata from mappings/categories, while tools/spe_parser/spe_parser/parser.py decodes SPE/perf input into CSV or Parquet-oriented analysis data.
Native benchmark suites validate the telemetry methodology by creating targeted CPU, cache, memory, lock, and interconnect pressure:
• benchmarks/ustress/Makefile
• benchmarks/sysstress/CMakeLists.txt
• benchmarks/matmul/Makefile
These C/C++/assembly workloads are independent of the Python analysis runtime but are intended inputs to Topdown/perf collection and metric validation.
Main entry points: linux_perf.py Linux perf backend · cpu_probe.py CPU Topdown probe · spec_loader.py Specification loader · probe.py Probe orchestrator
Components 23
Telemetry specifications
Versioned data contract for CPU and CMN telemetry.
- CPU JSON schema v1.2
data/pmu/cpu/schemas/v1.2.schema.json - Neoverse V3 PMU spec · Defines CPU events, metrics, groups, and methodology.
data/pmu/cpu/specifications/neoverse/neoverse_v3_r0p0_pmu.json - CMN-700 PMU spec · Defines static CMN events and metrics.
data/pmu/cmn/specifications/cmn_700_r0p0_pmu.json
Topdown analysis
Python CLI orchestration and CPU analysis.
- Topdown CLI
tools/topdown_tool/topdown_tool/__main__.py - Probe orchestrator · Selects CPU or CMN analysis flow.
tools/topdown_tool/topdown_tool/probe/probe.py - Specification loader · Loads telemetry definitions as the implementation boundary.
tools/topdown_tool/topdown_tool/common/spec_loader.py - CPU detector
tools/topdown_tool/topdown_tool/cpu_probe/cpu_detector.py - CPU model factory · Matches the target CPU to its specification.
tools/topdown_tool/topdown_tool/cpu_probe/cpu_factory.py - CPU Topdown probe · Resolves dependencies, computes metrics, and renders results.
tools/topdown_tool/topdown_tool/cpu_probe/cpu_probe.py - CLI / CSV results
CMN analysis
Topology-aware interconnect modeling and scheduling.
- CMN model factory
tools/topdown_tool/topdown_tool/cmn_probe/cmn_factory.py - CMN topology model · Combines static definitions with discovered mesh topology.
tools/topdown_tool/topdown_tool/cmn_probe/cmn_model.py - CMN scheduler · Fits events, filters, and watchpoints to hardware resources.
tools/topdown_tool/topdown_tool/cmn_probe/scheduler.py - Multi-CMN coordinator · Coordinates plans across CMN instances.
tools/topdown_tool/topdown_tool/cmn_probe/multi_cmn_scheduler.py
Collection runtime
Workload execution and platform PMU collection.
- Command workload
tools/topdown_tool/topdown_tool/workload/command_workload.py - PID workload
tools/topdown_tool/topdown_tool/workload/pid_workload.py - System-wide workload
tools/topdown_tool/topdown_tool/workload/systemwide_workload.py - Linux perf backend
tools/topdown_tool/topdown_tool/perf/linux_perf.py - Windows perf backend
tools/topdown_tool/topdown_tool/perf/windows_perf.py - Remote Linux runner · Abstracts local and remote command execution.
tools/topdown_tool/topdown_tool/common/command_runner/remote_linux.py
Supporting toolchain
Metadata generation, trace parsing, and validation workloads.
- Perf JSON generator · Generates Linux perf metadata from mappings and categories.
tools/perf_json_generator/generate.py - SPE parser · Decodes SPE/perf input into CSV or Parquet-oriented data.
tools/spe_parser/spe_parser/parser.py - Native stress benchmarks · CPU, cache, memory, lock, and interconnect pressure workloads.
benchmarks/ustress/Makefile
Connections 26
- CPU JSON schema v1.2 → Neoverse V3 PMU spec: validates
- Topdown CLI → Probe orchestrator: invokes
- Probe orchestrator → Specification loader: loads definitions
- Neoverse V3 PMU spec → Specification loader: CPU definitions
- CMN-700 PMU spec → Specification loader: CMN definitions
- Probe orchestrator → CPU detector: CPU flow
- CPU detector → CPU model factory: target identity
- Specification loader → CPU model factory: matched spec
- CPU model factory → CPU Topdown probe: CPU model
- CPU Topdown probe → CLI / CSV results: metrics and Topdown output
- Probe orchestrator → CMN model factory: CMN flow
- Specification loader → CMN model factory: CMN definitions
- CMN model factory → CMN topology model: static model
- CMN topology model → CMN scheduler: topology and events
- CMN scheduler → Multi-CMN coordinator: per-instance plans
- Multi-CMN coordinator → Linux perf backend: collection plan
- CPU Topdown probe → Linux perf backend: counter requests
- CPU Topdown probe → Windows perf backend: counter requests
- Command workload → Linux perf backend: measured command
- PID workload → Linux perf backend: measured PID
- System-wide workload → Linux perf backend: system measurement
- Remote Linux runner → Linux perf backend: remote execution
- Linux perf backend → CPU Topdown probe: counter samples
- Native stress benchmarks → Command workload: validation input
- Perf JSON generator → Linux perf backend: perf metadata
- Linux perf backend → SPE parser: SPE/perf input