Test with [[ https://reviews.freebsd.org/D40728 | 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 [[ https://gitlab.arm.com/telemetry-solution/telemetry-solution/-/tree/main/tools/spe_parser | spe-parser ]][1] tool.
1: https://gitlab.arm.com/telemetry-solution/telemetry-solution/-/tree/main/tools/spe_parser