Re: [PATCH v2 1/3] perf-stat: introduce bperf, share hardware PMCs with BPF

2021-03-23 Thread Arnaldo Carvalho de Melo
Em Tue, Mar 23, 2021 at 09:37:42AM -0300, Arnaldo Carvalho de Melo escreveu: > Em Tue, Mar 23, 2021 at 09:25:52AM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Fri, Mar 19, 2021 at 03:41:57PM -0300, Arnaldo Carvalho de Melo escreveu: > > > Em Thu, Mar 18, 2021 at 10:15:13PM +0100, Jiri Olsa escr

Re: [PATCH v2 1/3] perf-stat: introduce bperf, share hardware PMCs with BPF

2021-03-23 Thread Arnaldo Carvalho de Melo
Em Tue, Mar 23, 2021 at 09:25:52AM -0300, Arnaldo Carvalho de Melo escreveu: > Em Fri, Mar 19, 2021 at 03:41:57PM -0300, Arnaldo Carvalho de Melo escreveu: > > Em Thu, Mar 18, 2021 at 10:15:13PM +0100, Jiri Olsa escreveu: > > > On Tue, Mar 16, 2021 at 02:18:35PM -0700, Song Liu wrote: > > > > bperf

Re: [PATCH v2 1/3] perf-stat: introduce bperf, share hardware PMCs with BPF

2021-03-23 Thread Arnaldo Carvalho de Melo
Em Fri, Mar 19, 2021 at 03:41:57PM -0300, Arnaldo Carvalho de Melo escreveu: > Em Thu, Mar 18, 2021 at 10:15:13PM +0100, Jiri Olsa escreveu: > > On Tue, Mar 16, 2021 at 02:18:35PM -0700, Song Liu wrote: > > > bperf is off by default. To enable it, pass --bpf-counters option to > > > perf-stat. bper

Re: [PATCH v2 1/3] perf-stat: introduce bperf, share hardware PMCs with BPF

2021-03-22 Thread Song Liu
> On Mar 19, 2021, at 11:41 AM, Arnaldo Carvalho de Melo > wrote: > > Em Thu, Mar 18, 2021 at 10:15:13PM +0100, Jiri Olsa escreveu: >> On Tue, Mar 16, 2021 at 02:18:35PM -0700, Song Liu wrote: >>> bperf is off by default. To enable it, pass --bpf-counters option to >>> perf-stat. bperf uses a

Re: [PATCH v2 1/3] perf-stat: introduce bperf, share hardware PMCs with BPF

2021-03-19 Thread Song Liu
> On Mar 19, 2021, at 11:55 AM, Jiri Olsa wrote: > > On Fri, Mar 19, 2021 at 03:41:57PM -0300, Arnaldo Carvalho de Melo wrote: > > SNIP > >> LD >> /tmp/build/perf/util/bpf_skel/.tmp//bootstrap/libbpf/staticobjs/libbpf-in.o >> LINK /tmp/build/perf/util/bpf_skel/.tmp//bootstrap/li

Re: [PATCH v2 1/3] perf-stat: introduce bperf, share hardware PMCs with BPF

2021-03-19 Thread Jiri Olsa
On Fri, Mar 19, 2021 at 03:41:57PM -0300, Arnaldo Carvalho de Melo wrote: SNIP > LD > /tmp/build/perf/util/bpf_skel/.tmp//bootstrap/libbpf/staticobjs/libbpf-in.o > LINK /tmp/build/perf/util/bpf_skel/.tmp//bootstrap/libbpf/libbpf.a > LINK /tmp/build/perf/util/bpf_skel/.tmp//bo

Re: [PATCH v2 1/3] perf-stat: introduce bperf, share hardware PMCs with BPF

2021-03-19 Thread Arnaldo Carvalho de Melo
Em Thu, Mar 18, 2021 at 10:15:13PM +0100, Jiri Olsa escreveu: > On Tue, Mar 16, 2021 at 02:18:35PM -0700, Song Liu wrote: > > bperf is off by default. To enable it, pass --bpf-counters option to > > perf-stat. bperf uses a BPF hashmap to share information about BPF > > programs and maps used by bpe

Re: [PATCH v2 1/3] perf-stat: introduce bperf, share hardware PMCs with BPF

2021-03-18 Thread Jiri Olsa
On Tue, Mar 16, 2021 at 02:18:35PM -0700, Song Liu wrote: > perf uses performance monitoring counters (PMCs) to monitor system > performance. The PMCs are limited hardware resources. For example, > Intel CPUs have 3x fixed PMCs and 4x programmable PMCs per cpu. > > Modern data center systems use t

Re: [PATCH v2 1/3] perf-stat: introduce bperf, share hardware PMCs with BPF

2021-03-18 Thread Song Liu
> On Mar 18, 2021, at 6:49 AM, Namhyung Kim wrote: > > On Thu, Mar 18, 2021 at 4:22 PM Song Liu wrote: >> >> >> >>> On Mar 17, 2021, at 10:54 PM, Namhyung Kim wrote: >>> >> >> [...] >> + +static int bperf_reload_leader_program(struct evsel *evsel, int attr_map_fd,

Re: [PATCH v2 1/3] perf-stat: introduce bperf, share hardware PMCs with BPF

2021-03-18 Thread Namhyung Kim
On Thu, Mar 18, 2021 at 4:22 PM Song Liu wrote: > > > > > On Mar 17, 2021, at 10:54 PM, Namhyung Kim wrote: > > > > [...] > > >> + > >> +static int bperf_reload_leader_program(struct evsel *evsel, int > >> attr_map_fd, > >> + struct perf_event_attr_map_entry

Re: [PATCH v2 1/3] perf-stat: introduce bperf, share hardware PMCs with BPF

2021-03-18 Thread Song Liu
> On Mar 17, 2021, at 10:54 PM, Namhyung Kim wrote: > [...] >> + >> +static int bperf_reload_leader_program(struct evsel *evsel, int attr_map_fd, >> + struct perf_event_attr_map_entry >> *entry) >> +{ >> + struct bperf_leader_bpf *skel = bperf_lead

Re: [PATCH v2 1/3] perf-stat: introduce bperf, share hardware PMCs with BPF

2021-03-17 Thread Namhyung Kim
On Wed, Mar 17, 2021 at 6:18 AM Song Liu wrote: > +static int bperf_check_target(struct evsel *evsel, > + struct target *target, > + enum bperf_filter_type *filter_type, > + __u32 *filter_entry_cnt) > +{ > +