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

2021-03-15 Thread Song Liu
> On Mar 15, 2021, at 8:34 AM, Andi Kleen wrote: > >> I still think that there is value in taking those measurements after we >> enable the counters, as, for instance, for interval mode we want >> measurements with the counters enabled, whatever happens before the >> counters are enabled is ju

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

2021-03-15 Thread Song Liu
> On Mar 15, 2021, at 7:09 AM, Jiri Olsa wrote: > > On Mon, Mar 15, 2021 at 07:51:11AM +, Song Liu wrote: > > SNIP [...] >> >> It is mostly to cover corner cases, like something else used the same >> name. > > about that.. we just take the object fd assuming it's map, > should we te

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

2021-03-15 Thread Andi Kleen
> I still think that there is value in taking those measurements after we > enable the counters, as, for instance, for interval mode we want > measurements with the counters enabled, whatever happens before the > counters are enabled is just startup time, etc. Jiri, Andi? Yes I agree. Only the tim

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

2021-03-15 Thread Jiri Olsa
On Mon, Mar 15, 2021 at 07:51:11AM +, Song Liu wrote: SNIP > >> Known limitations: > >> 1. Do not support per cgroup events; > > > > isn't that another filter via bpf_get_current_cgroup_id ? > > This is tricky with nested cgroups. We also have > bpf_get_current_ancestor_cgroup_id, > but th

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

2021-03-15 Thread Arnaldo Carvalho de Melo
Em Fri, Mar 12, 2021 at 06:52:39PM +, Song Liu escreveu: > > On Mar 12, 2021, at 6:24 AM, Arnaldo Carvalho de Melo > > wrote: > > Em Thu, Mar 11, 2021 at 06:02:57PM -0800, Song Liu escreveu: > >> perf uses performance monitoring counters (PMCs) to monitor system > >> performance. The PMCs are

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

2021-03-15 Thread Song Liu
> On Mar 14, 2021, at 3:48 PM, Jiri Olsa wrote: > > On Thu, Mar 11, 2021 at 06:02:57PM -0800, 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 prog

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

2021-03-14 Thread Jiri Olsa
On Thu, Mar 11, 2021 at 06:02:57PM -0800, 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] perf-stat: introduce bperf, share hardware PMCs with BPF

2021-03-13 Thread Song Liu
> On Mar 13, 2021, at 2:06 PM, Jiri Olsa wrote: > > On Fri, Mar 12, 2021 at 04:09:53PM +, Song Liu wrote: >> >> >>> On Mar 12, 2021, at 7:45 AM, Song Liu wrote: >>> >>> >>> On Mar 12, 2021, at 4:12 AM, Jiri Olsa wrote: On Thu, Mar 11, 2021 at 06:02:57PM -0800, Song L

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

2021-03-13 Thread Jiri Olsa
On Fri, Mar 12, 2021 at 04:09:53PM +, Song Liu wrote: > > > > On Mar 12, 2021, at 7:45 AM, Song Liu wrote: > > > > > > > >> On Mar 12, 2021, at 4:12 AM, Jiri Olsa wrote: > >> > >> On Thu, Mar 11, 2021 at 06:02:57PM -0800, Song Liu wrote: > >>> perf uses performance monitoring counters (

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

2021-03-13 Thread Song Liu
> On Mar 12, 2021, at 6:47 PM, Namhyung Kim wrote: > > On Sat, Mar 13, 2021 at 12:38 AM Song Liu wrote: >> >> >> >>> On Mar 12, 2021, at 12:36 AM, Namhyung Kim wrote: >>> >>> Hi, >>> >>> On Fri, Mar 12, 2021 at 11:03 AM Song Liu wrote: perf uses performance monitoring counte

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

2021-03-12 Thread Namhyung Kim
On Sat, Mar 13, 2021 at 12:38 AM Song Liu wrote: > > > > > On Mar 12, 2021, at 12:36 AM, Namhyung Kim wrote: > > > > Hi, > > > > On Fri, Mar 12, 2021 at 11:03 AM Song Liu wrote: > >> > >> perf uses performance monitoring counters (PMCs) to monitor system > >> performance. The PMCs are limited ha

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

2021-03-12 Thread Song Liu
> On Mar 12, 2021, at 6:24 AM, Arnaldo Carvalho de Melo wrote: > > Em Thu, Mar 11, 2021 at 06:02:57PM -0800, Song Liu escreveu: >> perf uses performance monitoring counters (PMCs) to monitor system >> performance. The PMCs are limited hardware resources. For example, >> Intel CPUs have 3x fixe

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

2021-03-12 Thread Arnaldo Carvalho de Melo
Em Fri, Mar 12, 2021 at 04:07:42PM +, Song Liu escreveu: > > > > On Mar 12, 2021, at 6:24 AM, Arnaldo Carvalho de Melo > > wrote: > > > > Em Thu, Mar 11, 2021 at 06:02:57PM -0800, Song Liu escreveu: > >> perf uses performance monitoring counters (PMCs) to monitor system > >> performance. T

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

2021-03-12 Thread Song Liu
> On Mar 12, 2021, at 7:45 AM, Song Liu wrote: > > > >> On Mar 12, 2021, at 4:12 AM, Jiri Olsa wrote: >> >> On Thu, Mar 11, 2021 at 06:02:57PM -0800, Song Liu wrote: >>> perf uses performance monitoring counters (PMCs) to monitor system >>> performance. The PMCs are limited hardware resour

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

2021-03-12 Thread Song Liu
> On Mar 12, 2021, at 6:24 AM, Arnaldo Carvalho de Melo wrote: > > Em Thu, Mar 11, 2021 at 06:02:57PM -0800, Song Liu escreveu: >> perf uses performance monitoring counters (PMCs) to monitor system >> performance. The PMCs are limited hardware resources. For example, >> Intel CPUs have 3x fixe

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

2021-03-12 Thread Song Liu
> On Mar 12, 2021, at 4:12 AM, Jiri Olsa wrote: > > On Thu, Mar 11, 2021 at 06:02:57PM -0800, 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 prog

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

2021-03-12 Thread Song Liu
> On Mar 12, 2021, at 12:36 AM, Namhyung Kim wrote: > > Hi, > > On Fri, Mar 12, 2021 at 11:03 AM 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 an

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

2021-03-12 Thread Arnaldo Carvalho de Melo
Em Thu, Mar 11, 2021 at 06:02:57PM -0800, Song Liu escreveu: > 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 us

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

2021-03-12 Thread Jiri Olsa
On Thu, Mar 11, 2021 at 06:02:57PM -0800, 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] perf-stat: introduce bperf, share hardware PMCs with BPF

2021-03-12 Thread Namhyung Kim
Hi, On Fri, Mar 12, 2021 at 11:03 AM 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 the

[PATCH] perf-stat: introduce bperf, share hardware PMCs with BPF

2021-03-11 Thread Song Liu
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 these PMCs in many different ways: system level monitoring, (maybe ne