diff options
| author | Dapeng Mi <dapeng1.mi@linux.intel.com> | 2026-09-14 09:40:43 +0800 |
|---|---|---|
| committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2026-09-14 15:32:52 -0300 |
| commit | eb89aef367e4701038869e1ddfa719463524e3e3 (patch) | |
| tree | 6ffa304564aba244d08f14d6dbbfbf226766551a /tools/perf | |
| parent | 7846bf499da3fe5da834630cab693955fe147d66 (diff) | |
perf headers: Sync perf_event.h/perf_regs.h with the kernel headers
Sync the UAPI header changes of supporting SIMD/eGPRs/SSP sampling into
corresponding tools UAPI headers.
Additionally, support the new introduced perf_event_attr fields in the
perf_event_attr__fprintf and perf_event__attr_swap() helpers, and add
sanity check for the new introduced __reserved_4 field in
perf_attr_check().
Co-developed-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Kan Liang <kan.liang@linux.intel.com>
Signed-off-by: Dapeng Mi <dapeng1.mi@linux.intel.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf')
| -rw-r--r-- | tools/perf/util/header.c | 3 | ||||
| -rw-r--r-- | tools/perf/util/perf_event_attr_fprintf.c | 11 | ||||
| -rw-r--r-- | tools/perf/util/session.c | 7 |
3 files changed, 19 insertions, 2 deletions
diff --git a/tools/perf/util/header.c b/tools/perf/util/header.c index c7f2c29f02b0..ec2935c0ed04 100644 --- a/tools/perf/util/header.c +++ b/tools/perf/util/header.c @@ -2185,7 +2185,8 @@ static void free_event_desc(struct evsel *events) static bool perf_attr_check(struct perf_event_attr *attr) { - if (attr->__reserved_1 || attr->__reserved_2 || attr->__reserved_3) { + if (attr->__reserved_1 || attr->__reserved_2 || + attr->__reserved_3 || attr->__reserved_4) { pr_warning("Reserved bits are set unexpectedly. " "Please update perf tool.\n"); return false; diff --git a/tools/perf/util/perf_event_attr_fprintf.c b/tools/perf/util/perf_event_attr_fprintf.c index cc817294ad3d..2e8be9a357dc 100644 --- a/tools/perf/util/perf_event_attr_fprintf.c +++ b/tools/perf/util/perf_event_attr_fprintf.c @@ -407,8 +407,17 @@ int perf_event_attr__fprintf(FILE *fp, struct perf_event_attr *attr, } if (attr_size >= offsetof(struct perf_event_attr, config4)) PRINT_ATTRf(config3, p_hex); - if (attr_size > offsetof(struct perf_event_attr, config4)) + if (attr_size >= offsetof(struct perf_event_attr, sample_simd_regs_enabled)) PRINT_ATTRf(config4, p_hex); + if (attr_size > offsetof(struct perf_event_attr, sample_simd_vec_reg_user)) { + PRINT_ATTRf(sample_simd_regs_enabled, p_unsigned); + PRINT_ATTRf(sample_simd_pred_reg_qwords, p_unsigned); + PRINT_ATTRf(sample_simd_pred_reg_intr, p_hex); + PRINT_ATTRf(sample_simd_pred_reg_user, p_hex); + PRINT_ATTRf(sample_simd_vec_reg_qwords, p_unsigned); + PRINT_ATTRf(sample_simd_vec_reg_intr, p_hex); + PRINT_ATTRf(sample_simd_vec_reg_user, p_hex); + } return ret; } diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c index 212506aa8baa..c7ac0e7c5c04 100644 --- a/tools/perf/util/session.c +++ b/tools/perf/util/session.c @@ -639,6 +639,13 @@ do { \ bswap_field_64(sig_data); bswap_field_64(config3); bswap_field_64(config4); + bswap_field_16(sample_simd_regs_enabled); + bswap_field_16(sample_simd_pred_reg_qwords); + bswap_field_16(sample_simd_vec_reg_qwords); + bswap_field_32(sample_simd_pred_reg_intr); + bswap_field_32(sample_simd_pred_reg_user); + bswap_field_64(sample_simd_vec_reg_intr); + bswap_field_64(sample_simd_vec_reg_user); /* * After read_format are bitfields. Check read_format because |
