Re: [PATCH v3 3/4] perf-stat: introduce config stat.bpf-counter-events

2021-04-20 Thread Jiri Olsa
On Mon, Apr 19, 2021 at 08:26:02PM +, Song Liu wrote: > > > > On Apr 17, 2021, at 9:45 AM, Namhyung Kim wrote: > > > > Hi Song, > > > > On Sat, Apr 17, 2021 at 7:13 AM Song Liu wrote: > >> > >> Currently, to use BPF to aggregate perf event counters, the user uses > >> --bpf-counters opti

Re: [PATCH v3 3/4] perf-stat: introduce config stat.bpf-counter-events

2021-04-19 Thread Song Liu
> On Apr 19, 2021, at 7:26 AM, Jiri Olsa wrote: > > On Fri, Apr 16, 2021 at 03:13:24PM -0700, Song Liu wrote: > > SNIP > >> +/* >> + * Returns: >> + * 0 if all events use BPF; >> + * 1 if some events do NOT use BPF; >> + * < 0 on errors; >> + */ >> static int read_bpf_map_cou

Re: [PATCH v3 3/4] perf-stat: introduce config stat.bpf-counter-events

2021-04-19 Thread Song Liu
> On Apr 17, 2021, at 9:45 AM, Namhyung Kim wrote: > > Hi Song, > > On Sat, Apr 17, 2021 at 7:13 AM Song Liu wrote: >> >> Currently, to use BPF to aggregate perf event counters, the user uses >> --bpf-counters option. Enable "use bpf by default" events with a config >> option, stat.bpf-coun

Re: [PATCH v3 3/4] perf-stat: introduce config stat.bpf-counter-events

2021-04-19 Thread Jiri Olsa
On Fri, Apr 16, 2021 at 03:13:24PM -0700, Song Liu wrote: SNIP > +/* > + * Returns: > + * 0 if all events use BPF; > + * 1 if some events do NOT use BPF; > + * < 0 on errors; > + */ > static int read_bpf_map_counters(void) > { > + bool has_none_bpf_events = false; > st

Re: [PATCH v3 3/4] perf-stat: introduce config stat.bpf-counter-events

2021-04-17 Thread Namhyung Kim
Hi Song, On Sat, Apr 17, 2021 at 7:13 AM Song Liu wrote: > > Currently, to use BPF to aggregate perf event counters, the user uses > --bpf-counters option. Enable "use bpf by default" events with a config > option, stat.bpf-counter-events. Events with name in the option will use > BPF. > > This a

[PATCH v3 3/4] perf-stat: introduce config stat.bpf-counter-events

2021-04-16 Thread Song Liu
Currently, to use BPF to aggregate perf event counters, the user uses --bpf-counters option. Enable "use bpf by default" events with a config option, stat.bpf-counter-events. Events with name in the option will use BPF. This also enables mixed BPF event and regular event in the same sesssion. For