linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] perf bpf filter: Fix a broken perf sample data naming in BPF
@ 2023-05-25  0:03 Namhyung Kim
  2023-05-25 17:54 ` Andrii Nakryiko
  2023-05-26  6:53 ` John Fastabend
  0 siblings, 2 replies; 4+ messages in thread
From: Namhyung Kim @ 2023-05-25  0:03 UTC (permalink / raw)
  To: Arnaldo Carvalho de Melo, Jiri Olsa
  Cc: Ian Rogers, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, Song Liu, bpf

BPF CO-RE requires 3 underscores for the ignored suffix rule but it
mistakenly used only 2.  Let's fix it.

Fixes: 3a8b8fc31748 ("perf bpf filter: Support pre-5.16 kernels where 'mem_hops' isn't in 'union perf_mem_data_src'")
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
 tools/perf/util/bpf_skel/sample_filter.bpf.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/perf/util/bpf_skel/sample_filter.bpf.c b/tools/perf/util/bpf_skel/sample_filter.bpf.c
index cffe493af1ed..fb94f5280626 100644
--- a/tools/perf/util/bpf_skel/sample_filter.bpf.c
+++ b/tools/perf/util/bpf_skel/sample_filter.bpf.c
@@ -25,7 +25,7 @@ struct perf_sample_data___new {
 } __attribute__((preserve_access_index));
 
 /* new kernel perf_mem_data_src definition */
-union perf_mem_data_src__new {
+union perf_mem_data_src___new {
 	__u64 val;
 	struct {
 		__u64   mem_op:5,	/* type of opcode */
@@ -108,7 +108,7 @@ static inline __u64 perf_get_sample(struct bpf_perf_event_data_kern *kctx,
 		if (entry->part == 7)
 			return kctx->data->data_src.mem_blk;
 		if (entry->part == 8) {
-			union perf_mem_data_src__new *data = (void *)&kctx->data->data_src;
+			union perf_mem_data_src___new *data = (void *)&kctx->data->data_src;
 
 			if (bpf_core_field_exists(data->mem_hops))
 				return data->mem_hops;
-- 
2.41.0.rc0.172.g3f132b7071-goog


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

* Re: [PATCH] perf bpf filter: Fix a broken perf sample data naming in BPF
  2023-05-25  0:03 [PATCH] perf bpf filter: Fix a broken perf sample data naming in BPF Namhyung Kim
@ 2023-05-25 17:54 ` Andrii Nakryiko
  2023-05-26  6:53 ` John Fastabend
  1 sibling, 0 replies; 4+ messages in thread
From: Andrii Nakryiko @ 2023-05-25 17:54 UTC (permalink / raw)
  To: Namhyung Kim
  Cc: Arnaldo Carvalho de Melo, Jiri Olsa, Ian Rogers, Adrian Hunter,
	Peter Zijlstra, Ingo Molnar, LKML, linux-perf-users, Song Liu,
	bpf

On Wed, May 24, 2023 at 5:03 PM Namhyung Kim <namhyung@kernel.org> wrote:
>
> BPF CO-RE requires 3 underscores for the ignored suffix rule but it
> mistakenly used only 2.  Let's fix it.
>
> Fixes: 3a8b8fc31748 ("perf bpf filter: Support pre-5.16 kernels where 'mem_hops' isn't in 'union perf_mem_data_src'")
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/perf/util/bpf_skel/sample_filter.bpf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Seems like that's the only remaining case. LGTM.

Acked-by: Andrii Nakryiko <andrii@kernel.org>

> diff --git a/tools/perf/util/bpf_skel/sample_filter.bpf.c b/tools/perf/util/bpf_skel/sample_filter.bpf.c
> index cffe493af1ed..fb94f5280626 100644
> --- a/tools/perf/util/bpf_skel/sample_filter.bpf.c
> +++ b/tools/perf/util/bpf_skel/sample_filter.bpf.c
> @@ -25,7 +25,7 @@ struct perf_sample_data___new {
>  } __attribute__((preserve_access_index));
>
>  /* new kernel perf_mem_data_src definition */
> -union perf_mem_data_src__new {
> +union perf_mem_data_src___new {
>         __u64 val;
>         struct {
>                 __u64   mem_op:5,       /* type of opcode */
> @@ -108,7 +108,7 @@ static inline __u64 perf_get_sample(struct bpf_perf_event_data_kern *kctx,
>                 if (entry->part == 7)
>                         return kctx->data->data_src.mem_blk;
>                 if (entry->part == 8) {
> -                       union perf_mem_data_src__new *data = (void *)&kctx->data->data_src;
> +                       union perf_mem_data_src___new *data = (void *)&kctx->data->data_src;
>
>                         if (bpf_core_field_exists(data->mem_hops))
>                                 return data->mem_hops;
> --
> 2.41.0.rc0.172.g3f132b7071-goog
>
>

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

* RE: [PATCH] perf bpf filter: Fix a broken perf sample data naming in BPF
  2023-05-25  0:03 [PATCH] perf bpf filter: Fix a broken perf sample data naming in BPF Namhyung Kim
  2023-05-25 17:54 ` Andrii Nakryiko
@ 2023-05-26  6:53 ` John Fastabend
  2023-05-26 18:22   ` Arnaldo Carvalho de Melo
  1 sibling, 1 reply; 4+ messages in thread
From: John Fastabend @ 2023-05-26  6:53 UTC (permalink / raw)
  To: Namhyung Kim, Arnaldo Carvalho de Melo, Jiri Olsa
  Cc: Ian Rogers, Adrian Hunter, Peter Zijlstra, Ingo Molnar, LKML,
	linux-perf-users, Song Liu, bpf

Namhyung Kim wrote:
> BPF CO-RE requires 3 underscores for the ignored suffix rule but it
> mistakenly used only 2.  Let's fix it.
> 
> Fixes: 3a8b8fc31748 ("perf bpf filter: Support pre-5.16 kernels where 'mem_hops' isn't in 'union perf_mem_data_src'")
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
>  tools/perf/util/bpf_skel/sample_filter.bpf.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/perf/util/bpf_skel/sample_filter.bpf.c b/tools/perf/util/bpf_skel/sample_filter.bpf.c
> index cffe493af1ed..fb94f5280626 100644
> --- a/tools/perf/util/bpf_skel/sample_filter.bpf.c
> +++ b/tools/perf/util/bpf_skel/sample_filter.bpf.c
> @@ -25,7 +25,7 @@ struct perf_sample_data___new {
>  } __attribute__((preserve_access_index));
>  
>  /* new kernel perf_mem_data_src definition */
> -union perf_mem_data_src__new {
> +union perf_mem_data_src___new {
>  	__u64 val;
>  	struct {
>  		__u64   mem_op:5,	/* type of opcode */
> @@ -108,7 +108,7 @@ static inline __u64 perf_get_sample(struct bpf_perf_event_data_kern *kctx,
>  		if (entry->part == 7)
>  			return kctx->data->data_src.mem_blk;
>  		if (entry->part == 8) {
> -			union perf_mem_data_src__new *data = (void *)&kctx->data->data_src;
> +			union perf_mem_data_src___new *data = (void *)&kctx->data->data_src;
>  
>  			if (bpf_core_field_exists(data->mem_hops))
>  				return data->mem_hops;
> -- 
> 2.41.0.rc0.172.g3f132b7071-goog
> 
> 

Acked-by: John Fastabend <john.fastabend@gmail.com>

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

* Re: [PATCH] perf bpf filter: Fix a broken perf sample data naming in BPF
  2023-05-26  6:53 ` John Fastabend
@ 2023-05-26 18:22   ` Arnaldo Carvalho de Melo
  0 siblings, 0 replies; 4+ messages in thread
From: Arnaldo Carvalho de Melo @ 2023-05-26 18:22 UTC (permalink / raw)
  To: John Fastabend
  Cc: Namhyung Kim, Jiri Olsa, Ian Rogers, Adrian Hunter,
	Peter Zijlstra, Ingo Molnar, LKML, linux-perf-users, Song Liu,
	bpf

Em Thu, May 25, 2023 at 11:53:09PM -0700, John Fastabend escreveu:
> Namhyung Kim wrote:
> > BPF CO-RE requires 3 underscores for the ignored suffix rule but it
> > mistakenly used only 2.  Let's fix it.
> > 
> > Fixes: 3a8b8fc31748 ("perf bpf filter: Support pre-5.16 kernels where 'mem_hops' isn't in 'union perf_mem_data_src'")
> > Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> > ---
> >  tools/perf/util/bpf_skel/sample_filter.bpf.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/tools/perf/util/bpf_skel/sample_filter.bpf.c b/tools/perf/util/bpf_skel/sample_filter.bpf.c
> > index cffe493af1ed..fb94f5280626 100644
> > --- a/tools/perf/util/bpf_skel/sample_filter.bpf.c
> > +++ b/tools/perf/util/bpf_skel/sample_filter.bpf.c
> > @@ -25,7 +25,7 @@ struct perf_sample_data___new {
> >  } __attribute__((preserve_access_index));
> >  
> >  /* new kernel perf_mem_data_src definition */
> > -union perf_mem_data_src__new {
> > +union perf_mem_data_src___new {
> >  	__u64 val;
> >  	struct {
> >  		__u64   mem_op:5,	/* type of opcode */
> > @@ -108,7 +108,7 @@ static inline __u64 perf_get_sample(struct bpf_perf_event_data_kern *kctx,
> >  		if (entry->part == 7)
> >  			return kctx->data->data_src.mem_blk;
> >  		if (entry->part == 8) {
> > -			union perf_mem_data_src__new *data = (void *)&kctx->data->data_src;
> > +			union perf_mem_data_src___new *data = (void *)&kctx->data->data_src;
> >  
> >  			if (bpf_core_field_exists(data->mem_hops))
> >  				return data->mem_hops;
> > -- 
> > 2.41.0.rc0.172.g3f132b7071-goog
> > 
> > 
> 
> Acked-by: John Fastabend <john.fastabend@gmail.com>

Thanks, applied.

- Arnaldo


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

end of thread, other threads:[~2023-05-26 18:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-25  0:03 [PATCH] perf bpf filter: Fix a broken perf sample data naming in BPF Namhyung Kim
2023-05-25 17:54 ` Andrii Nakryiko
2023-05-26  6:53 ` John Fastabend
2023-05-26 18:22   ` Arnaldo Carvalho de Melo

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