[v2,perf,bpf,01/11] perf, bpf: consider events with attr.bpf_event as side-band events
diff mbox series

Message ID 20190214235840.2587123-1-songliubraving@fb.com
State Changes Requested
Delegated to: BPF Maintainers
Headers show
Series
  • perf annotation of BPF programs
Related show

Commit Message

Song Liu Feb. 14, 2019, 11:58 p.m. UTC
Events with bpf_event should be considered as side-band event, as they
carry information about BPF programs.

Fixes: 6ee52e2a3fe4 ("perf, bpf: Introduce PERF_RECORD_BPF_EVENT")
Signed-off-by: Song Liu <songliubraving@fb.com>
---
 kernel/events/core.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Comments

Arnaldo Carvalho de Melo Feb. 15, 2019, 2:14 p.m. UTC | #1
Em Thu, Feb 14, 2019 at 03:58:40PM -0800, Song Liu escreveu:
> Events with bpf_event should be considered as side-band event, as they
> carry information about BPF programs.
> 
> Fixes: 6ee52e2a3fe4 ("perf, bpf: Introduce PERF_RECORD_BPF_EVENT")
> Signed-off-by: Song Liu <songliubraving@fb.com>
> ---
>  kernel/events/core.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/kernel/events/core.c b/kernel/events/core.c
> index 0a8dab322111..9403bdda5f8c 100644
> --- a/kernel/events/core.c
> +++ b/kernel/events/core.c
> @@ -4238,7 +4238,8 @@ static bool is_sb_event(struct perf_event *event)
>  	if (attr->mmap || attr->mmap_data || attr->mmap2 ||
>  	    attr->comm || attr->comm_exec ||
>  	    attr->task || attr->ksymbol ||
> -	    attr->context_switch)
> +	    attr->context_switch ||
> +	    attr->bpf_event)

What about attr->ksymbol?

- Arnaldo

>  		return true;
>  	return false;
>  }
> -- 
> 2.17.1
Song Liu Feb. 15, 2019, 5:02 p.m. UTC | #2
> On Feb 15, 2019, at 6:14 AM, Arnaldo Carvalho de Melo <acme@redhat.com> wrote:
> 
> Em Thu, Feb 14, 2019 at 03:58:40PM -0800, Song Liu escreveu:
>> Events with bpf_event should be considered as side-band event, as they
>> carry information about BPF programs.
>> 
>> Fixes: 6ee52e2a3fe4 ("perf, bpf: Introduce PERF_RECORD_BPF_EVENT")
>> Signed-off-by: Song Liu <songliubraving@fb.com>
>> ---
>> kernel/events/core.c | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>> 
>> diff --git a/kernel/events/core.c b/kernel/events/core.c
>> index 0a8dab322111..9403bdda5f8c 100644
>> --- a/kernel/events/core.c
>> +++ b/kernel/events/core.c
>> @@ -4238,7 +4238,8 @@ static bool is_sb_event(struct perf_event *event)
>> 	if (attr->mmap || attr->mmap_data || attr->mmap2 ||
>> 	    attr->comm || attr->comm_exec ||
>> 	    attr->task || attr->ksymbol ||
				^ here

>> -	    attr->context_switch)
>> +	    attr->context_switch ||
>> +	    attr->bpf_event)
> 
> What about attr->ksymbol?
> 
> - Arnaldo

It is already included up there. attr->bpf_event was missed initially 
because we didn't use events with bpf_event but not ksymbol. With this 
set, the polling thread only has bpf_event, so we need this fix. 

Thanks,
Song
Arnaldo Carvalho de Melo Feb. 15, 2019, 6:04 p.m. UTC | #3
Em Fri, Feb 15, 2019 at 05:02:02PM +0000, Song Liu escreveu:
> 
> 
> > On Feb 15, 2019, at 6:14 AM, Arnaldo Carvalho de Melo <acme@redhat.com> wrote:
> > 
> > Em Thu, Feb 14, 2019 at 03:58:40PM -0800, Song Liu escreveu:
> >> Events with bpf_event should be considered as side-band event, as they
> >> carry information about BPF programs.
> >> 
> >> Fixes: 6ee52e2a3fe4 ("perf, bpf: Introduce PERF_RECORD_BPF_EVENT")
> >> Signed-off-by: Song Liu <songliubraving@fb.com>
> >> ---
> >> kernel/events/core.c | 3 ++-
> >> 1 file changed, 2 insertions(+), 1 deletion(-)
> >> 
> >> diff --git a/kernel/events/core.c b/kernel/events/core.c
> >> index 0a8dab322111..9403bdda5f8c 100644
> >> --- a/kernel/events/core.c
> >> +++ b/kernel/events/core.c
> >> @@ -4238,7 +4238,8 @@ static bool is_sb_event(struct perf_event *event)
> >> 	if (attr->mmap || attr->mmap_data || attr->mmap2 ||
> >> 	    attr->comm || attr->comm_exec ||
> >> 	    attr->task || attr->ksymbol ||
> 				^ here

how come, I looked after context_switch, that came before, have to
replace my glasses... :-)
> 
> >> -	    attr->context_switch)
> >> +	    attr->context_switch ||
> >> +	    attr->bpf_event)
> > 
> > What about attr->ksymbol?
 
> It is already included up there. attr->bpf_event was missed initially 
> because we didn't use events with bpf_event but not ksymbol. With this 
> set, the polling thread only has bpf_event, so we need this fix. 

Ok, I'll get this one merged asap.

- Arnaldo

Patch
diff mbox series

diff --git a/kernel/events/core.c b/kernel/events/core.c
index 0a8dab322111..9403bdda5f8c 100644
--- a/kernel/events/core.c
+++ b/kernel/events/core.c
@@ -4238,7 +4238,8 @@  static bool is_sb_event(struct perf_event *event)
 	if (attr->mmap || attr->mmap_data || attr->mmap2 ||
 	    attr->comm || attr->comm_exec ||
 	    attr->task || attr->ksymbol ||
-	    attr->context_switch)
+	    attr->context_switch ||
+	    attr->bpf_event)
 		return true;
 	return false;
 }