Page MenuHomeFreeBSD

HWT: Arm Statistical Profiling Extension (SPE) support
Needs ReviewPublic

Authored by zachary.leaf_arm.com on Aug 7 2024, 2:49 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Nov 4, 2:13 AM
Unknown Object (File)
Mon, Oct 28, 6:15 PM
Unknown Object (File)
Sep 30 2024, 9:00 AM
Unknown Object (File)
Sep 30 2024, 8:58 AM
Unknown Object (File)
Sep 24 2024, 1:44 PM
Unknown Object (File)
Sep 19 2024, 3:34 PM
Unknown Object (File)
Sep 8 2024, 11:11 AM
Unknown Object (File)
Sep 7 2024, 10:31 AM
Subscribers

Details

Reviewers
andrew
manu
br
Summary

Statistical Profiling Extension support (SPE) for HWT framework

This depends on hwt patch

Co-authored-by: Andrew Turner <andrew@FreeBSD.org>
Sponsored by: Arm Ltd
Sponsored by: The FreeBSD Foundation (early driver)

Test Plan

Test with hwt utility

  1. Profile on cores 0,1,2,3 using a buffer size of 1MiB saving raw SPE records to a file ~/spe_recs

./hwt -c spe -s 0,1,2,3 -b 1048576 -r -w ~/spe_recs

Currently only MODE_CPU is supported for profiling all activity on each core specified by -s. By default hwt utility will configure SPE to store the current PID in the context field in the raw SPE records. This means records can be filtered by PID after capture to get a per process view. Building the hwt utility with the ARM_SPE_CTX_CPU_ID flag will instead place the cpu_id into the context field.

Minimum buffer size is 8192 bytes, however larger buffer size of 1MiB+ is recommend to minimise the number of buffer full interrupts. See code comment at the top of sys/arm64/spe/arm_spe_backend.c.

Currently there is no support for decoding raw SPE records in hwt, however the raw records can be decoded with the spe-parser[1] tool.

spe-parser -d ~/spe_recs -t csv

1: https://gitlab.arm.com/telemetry-solution/telemetry-solution/-/tree/main/tools/spe_parser

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

br requested review of this revision.Aug 7 2024, 2:49 PM
br added a parent revision: D40466: Hardware Trace (HWT) framework.
br added a reviewer: br.
zachary.leaf_arm.com retitled this revision from SPE support to HWT: Arm Statistical Profiling Extension (SPE) support.Aug 27 2024, 8:31 AM
zachary.leaf_arm.com edited the summary of this revision. (Show Details)
zachary.leaf_arm.com edited the test plan for this revision. (Show Details)