bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] perf trace: Avoid compile error wrt redefining bool
@ 2023-09-13 18:49 Ian Rogers
  2023-09-17  5:25 ` Namhyung Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Ian Rogers @ 2023-09-13 18:49 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Namhyung Kim,
	Ian Rogers, Adrian Hunter, Leo Yan, linux-perf-users,
	linux-kernel, bpf

Make part of an existing TODO conditional to avoid the following build
error:
```
tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c:26:14: error: cannot combine with previous 'char' declaration specifier
   26 | typedef char bool;
      |              ^
include/stdbool.h:20:14: note: expanded from macro 'bool'
   20 | #define bool _Bool
      |              ^
tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c:26:1: error: typedef requires a name [-Werror,-Wmissing-declarations]
   26 | typedef char bool;
      | ^~~~~~~~~~~~~~~~~
2 errors generated.
```

Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c b/tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c
index 90ce22f9c1a9..939ec769bf4a 100644
--- a/tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c
+++ b/tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c
@@ -23,7 +23,9 @@
 #define MAX_CPUS  4096
 
 // FIXME: These should come from system headers
+#ifndef bool
 typedef char bool;
+#endif
 typedef int pid_t;
 typedef long long int __s64;
 typedef __s64 time64_t;
-- 
2.42.0.283.g2d96d420d3-goog


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v1] perf trace: Avoid compile error wrt redefining bool
  2023-09-13 18:49 [PATCH v1] perf trace: Avoid compile error wrt redefining bool Ian Rogers
@ 2023-09-17  5:25 ` Namhyung Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Namhyung Kim @ 2023-09-17  5:25 UTC (permalink / raw)
  To: Ian Rogers
  Cc: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Mark Rutland, Alexander Shishkin, Jiri Olsa, Adrian Hunter,
	Leo Yan, linux-perf-users, linux-kernel, bpf

On Wed, Sep 13, 2023 at 11:50 AM Ian Rogers <irogers@google.com> wrote:
>
> Make part of an existing TODO conditional to avoid the following build
> error:
> ```
> tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c:26:14: error: cannot combine with previous 'char' declaration specifier
>    26 | typedef char bool;
>       |              ^
> include/stdbool.h:20:14: note: expanded from macro 'bool'
>    20 | #define bool _Bool
>       |              ^
> tools/perf/util/bpf_skel/augmented_raw_syscalls.bpf.c:26:1: error: typedef requires a name [-Werror,-Wmissing-declarations]
>    26 | typedef char bool;
>       | ^~~~~~~~~~~~~~~~~
> 2 errors generated.
> ```
>
> Signed-off-by: Ian Rogers <irogers@google.com>

Applied to perf-tools, thanks!

Namhyung

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-09-17  5:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-13 18:49 [PATCH v1] perf trace: Avoid compile error wrt redefining bool Ian Rogers
2023-09-17  5:25 ` Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).