Skip to contentSkip to conversation

compiler-clang: remove version check for BPF Tracing

PATCH Applied Nick Desaulniers 7 participants 9 messages Nov 4, 2020 – Nov 6, 2020

Subsystems (5)
lore
Share & tools
lore

Nick Desaulniers

author reviewer
#0 lore raw

PATCH 1/1 compiler-clang: remove version check for BPF Tracing

bpftrace parses the kernel headers and uses Clang under the hood. Remove the version check when __BPF_TRACING__ is defined (as bpftrace does) so that this tool can continue to parse kernel headers, even with older clang sources.

Fixes commit 1f7a44f63e6c ("compiler-clang: add build check for clang 10.0.1")
---
 include/linux/compiler-clang.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/compiler-clang.h +2 -0
index dd7233c48bf3..98cff1b4b088 100644
@@ -8,8 +8,10 @@
 		     + __clang_patchlevel__)
 
 #if CLANG_VERSION < 100001
+#ifndef __BPF_TRACING__
 # error Sorry, your version of Clang is too old - please use 10.0.1 or newer.
 #endif
+#endif
 
 /* Compiler specific definitions for Clang compiler */
 
Signature · 1 line
2.29.1.341.ge80a0c044ae-goog
Acked-by Tested-by on v1 1/1
#1 lore raw
Quoted 11 lines · Nick Desaulniers

bpftrace parses the kernel headers and uses Clang under the hood. Remove the version check when __BPF_TRACING__ is defined (as bpftrace does) so that this tool can continue to parse kernel headers, even with older clang sources.

Fixes commit 1f7a44f63e6c ("compiler-clang: add build check for clang 10.0.1")

---

Thank you, resolved my issue.

Quoted 22 lines
 include/linux/compiler-clang.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/compiler-clang.h +2 -0
index dd7233c48bf3..98cff1b4b088 100644
@@ -8,8 +8,10 @@
 		     + __clang_patchlevel__)
 
 #if CLANG_VERSION < 100001
+#ifndef __BPF_TRACING__
 # error Sorry, your version of Clang is too old - please use 10.0.1 or newer.
 #endif
+#endif
 
 /* Compiler specific definitions for Clang compiler */
 
Signature · 1 line
2.29.1.341.ge80a0c044ae-goog

/Jarkko

Acked-by
#2 lore raw
Quoted 17 lines · Jarkko Sakkinen
Quoted 11 lines · Nick Desaulniers

bpftrace parses the kernel headers and uses Clang under the hood. Remove the version check when __BPF_TRACING__ is defined (as bpftrace does) so that this tool can continue to parse kernel headers, even with older clang sources.

Fixes commit 1f7a44f63e6c ("compiler-clang: add build check for clang 10.0.1")

---

Quoted 4 lines

Thank you, resolved my issue.

#3 lore raw
In reply to Nick Desaulniers
Quoted 7 lines · On Wed, 4 Nov 2020 11:10:51 -0800 Nick Desaulniers <[email protected]>…

bpftrace parses the kernel headers and uses Clang under the hood. Remove the version check when __BPF_TRACING__ is defined (as bpftrace does) so that this tool can continue to parse kernel headers, even with older clang sources.

Fixes commit 1f7a44f63e6c ("compiler-clang: add build check for clang 10.0.1")

1f7a44f63e6c is only in 5.10-rcX, so I shall remove the cc:stable.

Acked-by on v1 1/1
#4 lore raw
In reply to Nick Desaulniers
Quoted 10 lines · Nick Desaulniers

bpftrace parses the kernel headers and uses Clang under the hood. Remove the version check when __BPF_TRACING__ is defined (as bpftrace does) so that this tool can continue to parse kernel headers, even with older clang sources.

Fixes commit 1f7a44f63e6c ("compiler-clang: add build check for clang 10.0.1")
Quoted 22 lines
---
 include/linux/compiler-clang.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/compiler-clang.h +2 -0
index dd7233c48bf3..98cff1b4b088 100644
@@ -8,8 +8,10 @@
 		     + __clang_patchlevel__)
 
 #if CLANG_VERSION < 100001
+#ifndef __BPF_TRACING__
 # error Sorry, your version of Clang is too old - please use 10.0.1 or newer.
 #endif
+#endif
 
 /* Compiler specific definitions for Clang compiler */
 
Signature · 1 line
2.29.1.341.ge80a0c044ae-goog
Acked-by on v1 1/1
#5 lore raw
In reply to Nick Desaulniers
Quoted 5 lines · Nick Desaulniers

bpftrace parses the kernel headers and uses Clang under the hood. Remove the version check when __BPF_TRACING__ is defined (as bpftrace does) so that this tool can continue to parse kernel headers, even with older clang sources.

Cheers,
Miguel

#6 lore raw
In reply to Nick Desaulniers
Quoted 20 lines · Nick Desaulniers

bpftrace parses the kernel headers and uses Clang under the hood. Remove the version check when __BPF_TRACING__ is defined (as bpftrace does) so that this tool can continue to parse kernel headers, even with older clang sources.

Fixes commit 1f7a44f63e6c ("compiler-clang: add build check for clang 10.0.1")
---
 include/linux/compiler-clang.h | 2 ++
 1 file changed, 2 insertions(+)
include/linux/compiler-clang.h +0 -0
index dd7233c48bf3..98cff1b4b088 100644

include/linux/compiler-clang.h line 14

Quoted 7 lines
include/linux/compiler-clang.h +2 -0
@@ -8,8 +8,10 @@
                     + __clang_patchlevel__)
 
 #if CLANG_VERSION < 100001
+#ifndef __BPF_TRACING__
 # error Sorry, your version of Clang is too old - please use 10.0.1 or newer.
 #endif
+#endif

I can take it through the bpf tree if no one objects.

author reviewer
#7 lore raw
Quoted 2 lines · Alexei Starovoitov

I can take it through the bpf tree if no one objects.

Doesn't matter to me. You'll need to coordinate with Andrew though, since I got the email that this was picked up into -mm:

Quoted 4 lines
Quoted 4 lines

This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/compiler-clang-remove-version-check-for-bpf-tracing.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/compiler-clang-remove-version-check-for-bpf-tracing.patch

Signature · 2 lines
Thanks,
~Nick Desaulniers
#8 lore raw
Quoted 12 lines · Nick Desaulniers
Quoted 2 lines · Alexei Starovoitov

I can take it through the bpf tree if no one objects.

Doesn't matter to me. You'll need to coordinate with Andrew though, since I got the email that this was picked up into -mm:

Quoted 4 lines
Quoted 4 lines

This patch should soon appear at
https://ozlabs.org/~akpm/mmots/broken-out/compiler-clang-remove-version-check-for-bpf-tracing.patch
and later at
https://ozlabs.org/~akpm/mmotm/broken-out/compiler-clang-remove-version-check-for-bpf-tracing.patch

Thanks a lot for quick response to everyone :-) This ebpf tracing has been a great help lately with the SGX patch set. Hope I get chance to contribute to this work at some point in future.

Quoted 3 lines
Signature · 2 lines
Thanks,
~Nick Desaulniers

/Jarkko