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)
Fri, Dec 20, 9:54 AM
Unknown Object (File)
Mon, Dec 16, 11:05 AM
Unknown Object (File)
Fri, Dec 13, 1:24 PM
Unknown Object (File)
Nov 24 2024, 4:57 PM
Unknown Object (File)
Nov 22 2024, 1:16 PM
Unknown Object (File)
Nov 22 2024, 4:34 AM
Unknown Object (File)
Nov 14 2024, 6:45 AM
Unknown Object (File)
Nov 8 2024, 12:14 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)