[PATCH -next 0/2] perf stat: Support inherit events for bperf

Tengda Wu posted 2 patches 1 year, 3 months ago
There is a newer version of this series
tools/perf/tests/shell/stat_bpf_counters.sh   |  2 +-
tools/perf/util/bpf_counter.c                 |  9 +--
tools/perf/util/bpf_skel/bperf_follower.bpf.c | 75 +++++++++++++++++--
tools/perf/util/bpf_skel/bperf_u.h            |  5 ++
4 files changed, 79 insertions(+), 12 deletions(-)
[PATCH -next 0/2] perf stat: Support inherit events for bperf
Posted by Tengda Wu 1 year, 3 months ago
Hi,

bperf (perf-stat --bpf-counter) has not supported inherit events
during fork() since it was first introduced.

This patch series tries to add this support by:
 1) adding two new bpf programs to monitor task lifecycle;
 2) recording new tasks in the filter map dynamically;
 3) reusing `accum_key` of parent task for new tasks.

Thanks,
Tengda

Tengda Wu (2):
  perf stat: Support inherit events during fork() for bperf
  perf test: Use sqrtloop workload to test bperf event

 tools/perf/tests/shell/stat_bpf_counters.sh   |  2 +-
 tools/perf/util/bpf_counter.c                 |  9 +--
 tools/perf/util/bpf_skel/bperf_follower.bpf.c | 75 +++++++++++++++++--
 tools/perf/util/bpf_skel/bperf_u.h            |  5 ++
 4 files changed, 79 insertions(+), 12 deletions(-)

-- 
2.34.1
Re: [PATCH -next 0/2] perf stat: Support inherit events for bperf
Posted by Arnaldo Carvalho de Melo 1 year, 3 months ago
On Wed, Sep 04, 2024 at 12:31:01PM +0000, Tengda Wu wrote:
> Hi,
> 
> bperf (perf-stat --bpf-counter) has not supported inherit events
> during fork() since it was first introduced.
> 
> This patch series tries to add this support by:
>  1) adding two new bpf programs to monitor task lifecycle;
>  2) recording new tasks in the filter map dynamically;
>  3) reusing `accum_key` of parent task for new tasks.

Song, can you please take a look?

Thanks in advance!

- Arnaldo
 
> Thanks,
> Tengda
> 
> Tengda Wu (2):
>   perf stat: Support inherit events during fork() for bperf
>   perf test: Use sqrtloop workload to test bperf event
> 
>  tools/perf/tests/shell/stat_bpf_counters.sh   |  2 +-
>  tools/perf/util/bpf_counter.c                 |  9 +--
>  tools/perf/util/bpf_skel/bperf_follower.bpf.c | 75 +++++++++++++++++--
>  tools/perf/util/bpf_skel/bperf_u.h            |  5 ++
>  4 files changed, 79 insertions(+), 12 deletions(-)
> 
> -- 
> 2.34.1