All of lore.kernel.org
 help / color / mirror / Atom feed
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, Will Deacon <will@kernel.org>,
	Waiman Long <longman@redhat.com>,
	Boqun Feng <boqun.feng@gmail.com>,
	Davidlohr Bueso <dave@stgolabs.net>,
	Stephane Eranian <eranian@google.com>,
	Blake Jones <blakejones@google.com>
Subject: Re: [PATCH 0/3] perf lock contention: Add BPF support (v1)
Date: Mon, 1 Aug 2022 09:29:26 -0300	[thread overview]
Message-ID: <YufHJpDvhsYg3btG@kernel.org> (raw)
In-Reply-To: <20220729200756.666106-1-namhyung@kernel.org>

Em Fri, Jul 29, 2022 at 01:07:53PM -0700, Namhyung Kim escreveu:
> Hello,
> 
> This patchset adds -b/--use-bpf option and others to use BPF to
> collect kernel lock contention stats.  With this option it doesn't
> require a separate `perf lock record` step.  Basic filtering on cpu
> (with -a or -C option) and on task (with -p and --tid option) is
> supported as usual.
> 
>   $ sudo perf lock con -a -b sleep 1
>      contended   total wait     max wait     avg wait         type   caller
> 
>             42    192.67 us     13.64 us      4.59 us     spinlock   queue_work_on+0x20
>             23     85.54 us     10.28 us      3.72 us     spinlock   worker_thread+0x14a
>              6     13.92 us      6.51 us      2.32 us        mutex   kernfs_iop_permission+0x30
>              3     11.59 us     10.04 us      3.86 us        mutex   kernfs_dop_revalidate+0x3c
>              1      7.52 us      7.52 us      7.52 us     spinlock   kthread+0x115
>              1      7.24 us      7.24 us      7.24 us     rwlock:W   sys_epoll_wait+0x148
>              2      7.08 us      3.99 us      3.54 us     spinlock   delayed_work_timer_fn+0x1b
>              1      6.41 us      6.41 us      6.41 us     spinlock   idle_balance+0xa06
>              2      2.50 us      1.83 us      1.25 us        mutex   kernfs_iop_lookup+0x2f
>              1      1.71 us      1.71 us      1.71 us        mutex   kernfs_iop_getattr+0x2c
> 
> It seems my system had some contentions on the workqueue spinlock and
> the kernfs mutex.
> 
> The code is available at perf/lock-bpf-v1 branch in
> 
>   git://git.kernel.org/pub/scm/linux/kernel/git/namhyung/linux-perf.git

Thanks, applied.

- Arnaldo

 
> Thanks,
> Namhyung
> 
> 
> Namhyung Kim (3):
>   perf lock: Pass machine pointer to is_lock_function()
>   perf lock: Use BPF for lock contention analysis
>   perf lock: Implement cpu and task filters for BPF
> 
>  tools/perf/Documentation/perf-lock.txt        |  22 ++
>  tools/perf/Makefile.perf                      |   2 +-
>  tools/perf/builtin-lock.c                     | 226 ++++++++----------
>  tools/perf/util/Build                         |   1 +
>  tools/perf/util/bpf_lock_contention.c         | 181 ++++++++++++++
>  .../perf/util/bpf_skel/lock_contention.bpf.c  | 170 +++++++++++++
>  tools/perf/util/lock-contention.h             | 140 +++++++++++
>  7 files changed, 614 insertions(+), 128 deletions(-)
>  create mode 100644 tools/perf/util/bpf_lock_contention.c
>  create mode 100644 tools/perf/util/bpf_skel/lock_contention.bpf.c
>  create mode 100644 tools/perf/util/lock-contention.h
> 
> -- 
> 2.37.1.455.g008518b4e5-goog

-- 

- Arnaldo

      parent reply	other threads:[~2022-08-01 12:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-29 20:07 [PATCH 0/3] perf lock contention: Add BPF support (v1) Namhyung Kim
2022-07-29 20:07 ` [PATCH 1/3] perf lock: Pass machine pointer to is_lock_function() Namhyung Kim
2022-07-29 20:07 ` [PATCH 2/3] perf lock: Use BPF for lock contention analysis Namhyung Kim
2022-07-29 20:07 ` [PATCH 3/3] perf lock: Implement cpu and task filters for BPF Namhyung Kim
2022-08-01 12:29 ` Arnaldo Carvalho de Melo [this message]

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=YufHJpDvhsYg3btG@kernel.org \
    --to=acme@kernel.org \
    --cc=blakejones@google.com \
    --cc=boqun.feng@gmail.com \
    --cc=dave@stgolabs.net \
    --cc=eranian@google.com \
    --cc=irogers@google.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=will@kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.