From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@kernel.org>, Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
Ian Rogers <irogers@google.com>,
linux-perf-users@vger.kernel.org,
Song Liu <songliubraving@fb.com>, Hao Luo <haoluo@google.com>,
Milian Wolff <milian.wolff@kdab.com>,
bpf@vger.kernel.org, Blake Jones <blakejones@google.com>
Subject: Re: [PATCHSET 0/6] perf tools: A couple of fixes for perf record --off-cpu (v1)
Date: Tue, 28 Jun 2022 11:40:32 -0300 [thread overview]
Message-ID: <YrsS4HxNBUk5wtcU@kernel.org> (raw)
In-Reply-To: <20220624231313.367909-1-namhyung@kernel.org>
Em Fri, Jun 24, 2022 at 04:13:07PM -0700, Namhyung Kim escreveu:
> Hello,
>
> The first patch fixes a build error on old kernels which has
> task_struct->state field that is renamed to __state. Actually I made
> a mistake when I wrote the code and assumed new kernel version.
>
> The second patch is to prevent invalid sample synthesize by
> disallowing unsupported sample types.
So I'll pick the first two for perf/urgent and then when that is merged
into perf/core pick the rest, ok?
- Arnaldo
> The rest of the series implements inheritance of offcpu events for the
> child processes. Unlike perf events, BPF cannot know which task it
> should track except for ones set in a BPF map at the beginning. Add
> another BPF program to the fork path and add the process id to the
> map if the parent is tracked.
>
> With this change, it can get the correct off-cpu events for child
> processes. I've tested it with perf bench sched messaging which
> creates a lot of processes.
>
> $ sudo perf record -e dummy --off-cpu -- perf bench sched messaging
> # Running 'sched/messaging' benchmark:
> # 20 sender and receiver processes per group
> # 10 groups == 400 processes run
>
> Total time: 0.196 [sec]
> [ perf record: Woken up 1 times to write data ]
> [ perf record: Captured and wrote 0.178 MB perf.data (851 samples) ]
>
>
> $ sudo perf report --stat | grep -A1 offcpu
> offcpu-time stats:
> SAMPLE events: 851
>
> The benchmark passes messages by read/write and it creates off-cpu
> events. With 400 processes, we can see more than 800 events.
>
> The child process tracking is also enabled when -p option is given.
> But -t option does NOT as it only cares about the specific threads.
> It may be different what perf_event does now, but I think it makes
> more sense.
>
> You can get it from 'perf/offcpu-child-v1' branch in my tree
>
> https://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git
>
> Thanks,
> Namhyung
>
>
> Namhyung Kim (6):
> perf offcpu: Fix a build failure on old kernels
> perf offcpu: Accept allowed sample types only
> perf offcpu: Check process id for the given workload
> perf offcpu: Parse process id separately
> perf offcpu: Track child processes
> perf offcpu: Update offcpu test for child process
>
> tools/perf/tests/shell/record_offcpu.sh | 57 ++++++++++++++++++++---
> tools/perf/util/bpf_off_cpu.c | 60 +++++++++++++++++++++++--
> tools/perf/util/bpf_skel/off_cpu.bpf.c | 58 +++++++++++++++++++++---
> tools/perf/util/evsel.c | 9 ++++
> tools/perf/util/off_cpu.h | 9 ++++
> 5 files changed, 176 insertions(+), 17 deletions(-)
>
>
> base-commit: 9886142c7a2226439c1e3f7d9b69f9c7094c3ef6
> --
> 2.37.0.rc0.161.g10f37bed90-goog
--
- Arnaldo
next prev parent reply other threads:[~2022-06-28 14:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-06-24 23:13 [PATCHSET 0/6] perf tools: A couple of fixes for perf record --off-cpu (v1) Namhyung Kim
2022-06-24 23:13 ` [PATCH 1/6] perf offcpu: Fix a build failure on old kernels Namhyung Kim
2022-06-28 14:44 ` Arnaldo Carvalho de Melo
2022-06-28 16:52 ` Namhyung Kim
2022-06-24 23:13 ` [PATCH 2/6] perf offcpu: Accept allowed sample types only Namhyung Kim
2022-06-28 14:46 ` Arnaldo Carvalho de Melo
2022-06-24 23:13 ` [PATCH 3/6] perf offcpu: Check process id for the given workload Namhyung Kim
2022-06-24 23:13 ` [PATCH 4/6] perf offcpu: Parse process id separately Namhyung Kim
2022-06-24 23:13 ` [PATCH 5/6] perf offcpu: Track child processes Namhyung Kim
2022-06-24 23:13 ` [PATCH 6/6] perf offcpu: Update offcpu test for child process Namhyung Kim
2022-06-28 14:40 ` Arnaldo Carvalho de Melo [this message]
2022-06-28 16:51 ` [PATCHSET 0/6] perf tools: A couple of fixes for perf record --off-cpu (v1) Namhyung Kim
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YrsS4HxNBUk5wtcU@kernel.org \
--to=acme@kernel.org \
--cc=blakejones@google.com \
--cc=bpf@vger.kernel.org \
--cc=haoluo@google.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=milian.wolff@kdab.com \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=songliubraving@fb.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).