When using dynamically assigned CoreSight trace IDs the drivers can output the ID / CPU association as a PERF_RECORD_AUX_OUTPUT_HW_ID packet. Update cs-etm decoder to handle this packet by setting the CPU/Trace ID mapping.
Showing the changes to tools/include/linux (1 of 3 files). Show all
Unified · Split
| @@ -31,6 +31,9 @@ · 30 unmodified lines | ||
| 31 | 31 | */ |
| 32 | 32 | #define CORESIGHT_TRACE_ID_UNUSED_FLAG BIT(31) |
| 33 | 33 | |
| 34 | +/* Value to set for unused trace ID values */ | |
| 35 | +#define CORESIGHT_TRACE_ID_UNUSED_VAL 0x7F | |
| 36 | + | |
| 34 | 37 | /* |
| 35 | 38 | * Below are the definition of bit offsets for perf option, and works as |
| 36 | 39 | * arbitrary values for all ETM versions. |
| @@ -55,4 +58,16 @@ · 18 unmodified lines | ||
| 55 | 58 | #define ETM4_CFG_BIT_RETSTK 12 |
| 56 | 59 | #define ETM4_CFG_BIT_VMID_OPT 15 |
| 57 | 60 | |
| 61 | +/* | |
| 62 | + * Interpretation of the PERF_RECORD_AUX_OUTPUT_HW_ID payload. | |
| 63 | + * Used to associate a CPU with the CoreSight Trace ID. | |
| 64 | + * [07:00] - Trace ID - uses 8 bits to make value easy to read in file. | |
| 65 | + * [59:08] - Unused (SBZ) | |
| 66 | + * [63:60] - Version | |
| 67 | + */ | |
| 68 | +#define CS_AUX_HW_ID_TRACE_ID_MASK GENMASK_ULL(7, 0) | |
| 69 | +#define CS_AUX_HW_ID_VERSION_MASK GENMASK_ULL(63, 60) | |
| 70 | + | |
| 71 | +#define CS_AUX_HW_ID_CURR_VERSION 0 | |
| 72 | + | |
| 58 | 73 | #endif |