lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Thu,  6 Oct 2022 19:29:19 +0300
From:   Vitaly Chikunov <vt@...linux.org>
To:     Jiri Olsa <jolsa@...nel.org>,
        Arnaldo Carvalho de Melo <acme@...hat.com>,
        Ian Rogers <irogers@...gle.com>,
        linux-perf-users@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     ldv@...linux.org, Vitaly Chikunov <vt@...linux.org>,
        Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>
Subject: [PATCH] libperf: Remove reference to non-uapi header

Fix build with libperf:

  $ gcc ./tools/lib/perf/Documentation/examples/counting.c -lperf
  In file included from ./tools/lib/perf/Documentation/examples/counting.c:8:
  /usr/include/perf/event.h:9:10: fatal error: linux/compiler.h: No such file or directory
      9 | #include <linux/compiler.h>
        |          ^~~~~~~~~~~~~~~~~~
  compilation terminated.

Fixes: b2f10cd4e805 ("perf cpumap: Fix alignment for masks in event encoding")
Cc: Ian Rogers <irogers@...gle.com>
Signed-off-by: Vitaly Chikunov <vt@...linux.org>
---
 tools/lib/perf/include/perf/event.h | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/tools/lib/perf/include/perf/event.h b/tools/lib/perf/include/perf/event.h
index 93bf93a59c99..4f6d658bf27c 100644
--- a/tools/lib/perf/include/perf/event.h
+++ b/tools/lib/perf/include/perf/event.h
@@ -6,7 +6,6 @@
 #include <linux/types.h>
 #include <linux/limits.h>
 #include <linux/bpf.h>
-#include <linux/compiler.h>
 #include <sys/types.h> /* pid_t */
 
 #define event_contains(obj, mem) ((obj).header.size > offsetof(typeof(obj), mem))
@@ -195,7 +194,7 @@ struct perf_record_mask_cpu_map64 {
 #pragma GCC diagnostic ignored "-Wpacked"
 #pragma GCC diagnostic ignored "-Wattributes"
 
-struct __packed perf_record_cpu_map_data {
+struct perf_record_cpu_map_data {
 	__u16			 type;
 	union {
 		/* Used when type == PERF_CPU_MAP__CPUS. */
@@ -205,7 +204,7 @@ struct __packed perf_record_cpu_map_data {
 		/* Used when type == PERF_CPU_MAP__MASK and long_size == 8. */
 		struct perf_record_mask_cpu_map64 mask64_data;
 	};
-};
+} __attribute__ ((__packed__));
 
 #pragma GCC diagnostic pop
 
-- 
2.33.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ