From 6e608f9ce704181149d4db4bfc5e81071c83ccb1 Mon Sep 17 00:00:00 2001 From: Florian Lehner Date: Sat, 30 Jul 2022 14:04:55 +0200 Subject: [PATCH] unix: update perf_event_attr_go Fix issues when using PerfEventOpen() with PERF_ATTR_SIZE_VER6 or PERF_ATTR_SIZE_VER7 by updating struct perf_event_attr_go to include aux_sample_size and sig_data. Change-Id: I0192d59006ed6c67b19a448b797bf49894a24f72 Reviewed-on: https://go-review.googlesource.com/c/sys/+/420294 TryBot-Result: Gopher Robot Reviewed-by: Ian Lance Taylor Auto-Submit: Ian Lance Taylor Reviewed-by: Than McIntosh Run-TryBot: Ian Lance Taylor Run-TryBot: Tobias Klauser Reviewed-by: Tobias Klauser --- unix/linux/types.go | 4 ++++ unix/ztypes_linux.go | 3 +++ 2 files changed, 7 insertions(+) diff --git a/unix/linux/types.go b/unix/linux/types.go index aa0ce02b..9a39c352 100644 --- a/unix/linux/types.go +++ b/unix/linux/types.go @@ -402,6 +402,10 @@ struct perf_event_attr_go { __u32 aux_watermark; __u16 sample_max_stack; __u16 __reserved_2; + __u32 aux_sample_size; + __u32 __reserved_3; + + __u64 sig_data; }; // ustat is deprecated and glibc 2.28 removed ustat.h. Provide the type here for diff --git a/unix/ztypes_linux.go b/unix/ztypes_linux.go index 86984798..f6de1eed 100644 --- a/unix/ztypes_linux.go +++ b/unix/ztypes_linux.go @@ -945,6 +945,9 @@ type PerfEventAttr struct { Aux_watermark uint32 Sample_max_stack uint16 _ uint16 + Aux_sample_size uint32 + _ uint32 + Sig_data uint64 } type PerfEventMmapPage struct {