bpf.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] compiler-clang: remove version check for BPF Tracing
@ 2020-11-04 19:10 Nick Desaulniers
  2020-11-04 20:33 ` Jarkko Sakkinen
                   ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Nick Desaulniers @ 2020-11-04 19:10 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Nick Desaulniers, stable, Chen Yu, Jarkko Sakkinen,
	Alexei Starovoitov, Daniel Borkmann, Martin KaFai Lau, Song Liu,
	Yonghong Song, Andrii Nakryiko, John Fastabend, KP Singh,
	Nathan Chancellor, Miguel Ojeda, Kees Cook, Marco Elver,
	Arvind Sankar, Randy Dunlap, Sami Tolvanen, Ingo Molnar,
	linux-kernel, netdev, bpf, clang-built-linux

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.

Cc: <stable@vger.kernel.org>
Fixes: commit 1f7a44f63e6c ("compiler-clang: add build check for clang 10.0.1")
Reported-by: Chen Yu <yu.chen.surf@gmail.com>
Reported-by: Jarkko Sakkinen <jarkko@kernel.org>
Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
---
 include/linux/compiler-clang.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
index dd7233c48bf3..98cff1b4b088 100644
--- a/include/linux/compiler-clang.h
+++ b/include/linux/compiler-clang.h
@@ -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 */
 
-- 
2.29.1.341.ge80a0c044ae-goog


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

* Re: [PATCH] compiler-clang: remove version check for BPF Tracing
  2020-11-04 19:10 [PATCH] compiler-clang: remove version check for BPF Tracing Nick Desaulniers
@ 2020-11-04 20:33 ` Jarkko Sakkinen
  2020-11-05  0:25   ` Song Liu
  2020-11-05  0:51 ` Andrew Morton
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 9+ messages in thread
From: Jarkko Sakkinen @ 2020-11-04 20:33 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Andrew Morton, stable, Chen Yu, Alexei Starovoitov,
	Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	Andrii Nakryiko, John Fastabend, KP Singh, Nathan Chancellor,
	Miguel Ojeda, Kees Cook, Marco Elver, Arvind Sankar,
	Randy Dunlap, Sami Tolvanen, Ingo Molnar, linux-kernel, netdev,
	bpf, clang-built-linux

On Wed, Nov 04, 2020 at 11:10:51AM -0800, Nick Desaulniers wrote:
> 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.
> 
> Cc: <stable@vger.kernel.org>
> Fixes: commit 1f7a44f63e6c ("compiler-clang: add build check for clang 10.0.1")
> Reported-by: Chen Yu <yu.chen.surf@gmail.com>
> Reported-by: Jarkko Sakkinen <jarkko@kernel.org>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> ---

Thank you, resolved my issue.

Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
Tested-by: Jarkko Sakkinen <jarkko@kernel.org>

>  include/linux/compiler-clang.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
> index dd7233c48bf3..98cff1b4b088 100644
> --- a/include/linux/compiler-clang.h
> +++ b/include/linux/compiler-clang.h
> @@ -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 */
>  
> -- 
> 2.29.1.341.ge80a0c044ae-goog
> 
> 

/Jarkko

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

* Re: [PATCH] compiler-clang: remove version check for BPF Tracing
  2020-11-04 20:33 ` Jarkko Sakkinen
@ 2020-11-05  0:25   ` Song Liu
  0 siblings, 0 replies; 9+ messages in thread
From: Song Liu @ 2020-11-05  0:25 UTC (permalink / raw)
  To: Jarkko Sakkinen
  Cc: Nick Desaulniers, Andrew Morton, stable, Chen Yu,
	Alexei Starovoitov, Daniel Borkmann, Martin Lau, Yonghong Song,
	Andrii Nakryiko, John Fastabend, KP Singh, Nathan Chancellor,
	Miguel Ojeda, Kees Cook, Marco Elver, Arvind Sankar,
	Randy Dunlap, Sami Tolvanen, Ingo Molnar, open list, Networking,
	bpf, clang-built-linux



> On Nov 4, 2020, at 12:33 PM, Jarkko Sakkinen <jarkko@kernel.org> wrote:
> 
> On Wed, Nov 04, 2020 at 11:10:51AM -0800, Nick Desaulniers wrote:
>> 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.
>> 
>> Cc: <stable@vger.kernel.org>
>> Fixes: commit 1f7a44f63e6c ("compiler-clang: add build check for clang 10.0.1")
>> Reported-by: Chen Yu <yu.chen.surf@gmail.com>
>> Reported-by: Jarkko Sakkinen <jarkko@kernel.org>
>> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
>> ---
> 
> Thank you, resolved my issue.
> 
> Acked-by: Jarkko Sakkinen <jarkko@kernel.org>
> Tested-by: Jarkko Sakkinen <jarkko@kernel.org>

Acked-by: Song Liu <songliubraving@fb.com>


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

* Re: [PATCH] compiler-clang: remove version check for BPF Tracing
  2020-11-04 19:10 [PATCH] compiler-clang: remove version check for BPF Tracing Nick Desaulniers
  2020-11-04 20:33 ` Jarkko Sakkinen
@ 2020-11-05  0:51 ` Andrew Morton
  2020-11-05  0:56 ` Nathan Chancellor
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Andrew Morton @ 2020-11-05  0:51 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: stable, Chen Yu, Jarkko Sakkinen, Alexei Starovoitov,
	Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	Andrii Nakryiko, John Fastabend, KP Singh, Nathan Chancellor,
	Miguel Ojeda, Kees Cook, Marco Elver, Arvind Sankar,
	Randy Dunlap, Sami Tolvanen, Ingo Molnar, linux-kernel, netdev,
	bpf, clang-built-linux

On Wed,  4 Nov 2020 11:10:51 -0800 Nick Desaulniers <ndesaulniers@google.com> wrote:

> 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.
> 
> Cc: <stable@vger.kernel.org>
> 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.

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

* Re: [PATCH] compiler-clang: remove version check for BPF Tracing
  2020-11-04 19:10 [PATCH] compiler-clang: remove version check for BPF Tracing Nick Desaulniers
  2020-11-04 20:33 ` Jarkko Sakkinen
  2020-11-05  0:51 ` Andrew Morton
@ 2020-11-05  0:56 ` Nathan Chancellor
  2020-11-05  2:22 ` Miguel Ojeda
  2020-11-06  4:16 ` Alexei Starovoitov
  4 siblings, 0 replies; 9+ messages in thread
From: Nathan Chancellor @ 2020-11-05  0:56 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Andrew Morton, stable, Chen Yu, Jarkko Sakkinen,
	Alexei Starovoitov, Daniel Borkmann, Martin KaFai Lau, Song Liu,
	Yonghong Song, Andrii Nakryiko, John Fastabend, KP Singh,
	Miguel Ojeda, Kees Cook, Marco Elver, Arvind Sankar,
	Randy Dunlap, Sami Tolvanen, Ingo Molnar, linux-kernel, netdev,
	bpf, clang-built-linux

On Wed, Nov 04, 2020 at 11:10:51AM -0800, Nick Desaulniers wrote:
> 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.
> 
> Cc: <stable@vger.kernel.org>
> Fixes: commit 1f7a44f63e6c ("compiler-clang: add build check for clang 10.0.1")
> Reported-by: Chen Yu <yu.chen.surf@gmail.com>
> Reported-by: Jarkko Sakkinen <jarkko@kernel.org>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

Acked-by: Nathan Chancellor <natechancellor@gmail.com>

> ---
>  include/linux/compiler-clang.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
> index dd7233c48bf3..98cff1b4b088 100644
> --- a/include/linux/compiler-clang.h
> +++ b/include/linux/compiler-clang.h
> @@ -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 */
>  
> -- 
> 2.29.1.341.ge80a0c044ae-goog
> 

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

* Re: [PATCH] compiler-clang: remove version check for BPF Tracing
  2020-11-04 19:10 [PATCH] compiler-clang: remove version check for BPF Tracing Nick Desaulniers
                   ` (2 preceding siblings ...)
  2020-11-05  0:56 ` Nathan Chancellor
@ 2020-11-05  2:22 ` Miguel Ojeda
  2020-11-06  4:16 ` Alexei Starovoitov
  4 siblings, 0 replies; 9+ messages in thread
From: Miguel Ojeda @ 2020-11-05  2:22 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Andrew Morton, Chen Yu, Jarkko Sakkinen, Alexei Starovoitov,
	Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	Andrii Nakryiko, John Fastabend, KP Singh, Nathan Chancellor,
	Kees Cook, Marco Elver, Arvind Sankar, Randy Dunlap,
	Sami Tolvanen, Ingo Molnar, linux-kernel, Network Development,
	bpf, clang-built-linux

On Wed, Nov 4, 2020 at 8:11 PM Nick Desaulniers <ndesaulniers@google.com> wrote:
>
> 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.

Acked-by: Miguel Ojeda <ojeda@kernel.org>

Cheers,
Miguel

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

* Re: [PATCH] compiler-clang: remove version check for BPF Tracing
  2020-11-04 19:10 [PATCH] compiler-clang: remove version check for BPF Tracing Nick Desaulniers
                   ` (3 preceding siblings ...)
  2020-11-05  2:22 ` Miguel Ojeda
@ 2020-11-06  4:16 ` Alexei Starovoitov
  2020-11-06 18:52   ` Nick Desaulniers
  4 siblings, 1 reply; 9+ messages in thread
From: Alexei Starovoitov @ 2020-11-06  4:16 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Andrew Morton, stable, Chen Yu, Jarkko Sakkinen,
	Alexei Starovoitov, Daniel Borkmann, Martin KaFai Lau, Song Liu,
	Yonghong Song, Andrii Nakryiko, John Fastabend, KP Singh,
	Nathan Chancellor, Miguel Ojeda, Kees Cook, Marco Elver,
	Arvind Sankar, Randy Dunlap, Sami Tolvanen, Ingo Molnar, LKML,
	Network Development, bpf, Clang-Built-Linux ML

On Wed, Nov 4, 2020 at 11:11 AM Nick Desaulniers
<ndesaulniers@google.com> wrote:
>
> 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.
>
> Cc: <stable@vger.kernel.org>
> Fixes: commit 1f7a44f63e6c ("compiler-clang: add build check for clang 10.0.1")
> Reported-by: Chen Yu <yu.chen.surf@gmail.com>
> Reported-by: Jarkko Sakkinen <jarkko@kernel.org>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>
> ---
>  include/linux/compiler-clang.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/include/linux/compiler-clang.h b/include/linux/compiler-clang.h
> index dd7233c48bf3..98cff1b4b088 100644
> --- a/include/linux/compiler-clang.h
> +++ b/include/linux/compiler-clang.h
> @@ -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.

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

* Re: [PATCH] compiler-clang: remove version check for BPF Tracing
  2020-11-06  4:16 ` Alexei Starovoitov
@ 2020-11-06 18:52   ` Nick Desaulniers
  2020-11-06 22:32     ` Jarkko Sakkinen
  0 siblings, 1 reply; 9+ messages in thread
From: Nick Desaulniers @ 2020-11-06 18:52 UTC (permalink / raw)
  To: Alexei Starovoitov, Andrew Morton
  Cc: stable, Chen Yu, Jarkko Sakkinen, Alexei Starovoitov,
	Daniel Borkmann, Martin KaFai Lau, Song Liu, Yonghong Song,
	Andrii Nakryiko, John Fastabend, KP Singh, Nathan Chancellor,
	Miguel Ojeda, Kees Cook, Marco Elver, Arvind Sankar,
	Randy Dunlap, Sami Tolvanen, Ingo Molnar, LKML,
	Network Development, bpf, Clang-Built-Linux ML

On Thu, Nov 5, 2020 at 8:16 PM Alexei Starovoitov
<alexei.starovoitov@gmail.com> wrote:
>
> 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:

>> 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,
~Nick Desaulniers

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

* Re: [PATCH] compiler-clang: remove version check for BPF Tracing
  2020-11-06 18:52   ` Nick Desaulniers
@ 2020-11-06 22:32     ` Jarkko Sakkinen
  0 siblings, 0 replies; 9+ messages in thread
From: Jarkko Sakkinen @ 2020-11-06 22:32 UTC (permalink / raw)
  To: Nick Desaulniers
  Cc: Alexei Starovoitov, Andrew Morton, stable, Chen Yu,
	Alexei Starovoitov, Daniel Borkmann, Martin KaFai Lau, Song Liu,
	Yonghong Song, Andrii Nakryiko, John Fastabend, KP Singh,
	Nathan Chancellor, Miguel Ojeda, Kees Cook, Marco Elver,
	Arvind Sankar, Randy Dunlap, Sami Tolvanen, Ingo Molnar, LKML,
	Network Development, bpf, Clang-Built-Linux ML

On Fri, Nov 06, 2020 at 10:52:50AM -0800, Nick Desaulniers wrote:
> On Thu, Nov 5, 2020 at 8:16 PM Alexei Starovoitov
> <alexei.starovoitov@gmail.com> wrote:
> >
> > 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:
> 
> >> 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.

> -- 
> Thanks,
> ~Nick Desaulniers

/Jarkko

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

end of thread, other threads:[~2020-11-06 22:32 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-04 19:10 [PATCH] compiler-clang: remove version check for BPF Tracing Nick Desaulniers
2020-11-04 20:33 ` Jarkko Sakkinen
2020-11-05  0:25   ` Song Liu
2020-11-05  0:51 ` Andrew Morton
2020-11-05  0:56 ` Nathan Chancellor
2020-11-05  2:22 ` Miguel Ojeda
2020-11-06  4:16 ` Alexei Starovoitov
2020-11-06 18:52   ` Nick Desaulniers
2020-11-06 22:32     ` Jarkko Sakkinen

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).