From: Namhyung Kim <namhyung@kernel.org>
To: Chun-Tse Shao <ctshao@google.com>
Cc: linux-kernel@vger.kernel.org, peterz@infradead.org,
mingo@redhat.com, acme@kernel.org, mark.rutland@arm.com,
alexander.shishkin@linux.intel.com, jolsa@kernel.org,
irogers@google.com, adrian.hunter@intel.com,
kan.liang@linux.intel.com, nick.forrington@arm.com,
linux-perf-users@vger.kernel.org
Subject: Re: [PATCH v5 2/3] perf lock: Add percpu-rwsem for type filter
Date: Wed, 11 Dec 2024 11:15:34 -0800 [thread overview]
Message-ID: <Z1nk1gxH9siszkwG@google.com> (raw)
In-Reply-To: <20241210200847.1023139-2-ctshao@google.com>
On Tue, Dec 10, 2024 at 12:08:21PM -0800, Chun-Tse Shao wrote:
> percpu-rwsem was missing in man page. And for backward compatibility,
> replace `pcpu-sem` with `percpu-rwsem` before parsing lock name.
> Tested `./perf lock con -ab -Y pcpu-sem` and `./perf lock con -ab -Y
> percpu-rwsem`
>
> Fixes: 4f701063bfa2 ("perf lock contention: Show lock type with address")
> Signed-off-by: Chun-Tse Shao <ctshao@google.com>
Reviewed-by: Namhyung Kim <namhyung@kernel.org>
Thanks,
Namhyung
> ---
> tools/perf/Documentation/perf-lock.txt | 4 ++--
> tools/perf/builtin-lock.c | 3 +++
> 2 files changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/Documentation/perf-lock.txt b/tools/perf/Documentation/perf-lock.txt
> index 57a940399de0..d3793054f7d3 100644
> --- a/tools/perf/Documentation/perf-lock.txt
> +++ b/tools/perf/Documentation/perf-lock.txt
> @@ -187,8 +187,8 @@ CONTENTION OPTIONS
> Show lock contention only for given lock types (comma separated list).
> Available values are:
> semaphore, spinlock, rwlock, rwlock:R, rwlock:W, rwsem, rwsem:R, rwsem:W,
> - rtmutex, rwlock-rt, rwlock-rt:R, rwlock-rt:W, pcpu-sem, pcpu-sem:R, pcpu-sem:W,
> - mutex
> + rtmutex, rwlock-rt, rwlock-rt:R, rwlock-rt:W, percpu-rwmem, pcpu-sem,
> + pcpu-sem:R, pcpu-sem:W, mutex
>
> Note that RW-variant of locks have :R and :W suffix. Names without the
> suffix are shortcuts for the both variants. Ex) rwsem = rwsem:R + rwsem:W.
> diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
> index 7e36bbe3cb80..50630551adad 100644
> --- a/tools/perf/builtin-lock.c
> +++ b/tools/perf/builtin-lock.c
> @@ -2365,7 +2365,10 @@ static int parse_lock_type(const struct option *opt __maybe_unused, const char *
> /*
> * Otherwise `tok` is `name` in `lock_type_table`.
> * Single lock name could contain multiple flags.
> + * Replace alias `pcpu-sem` with actual name `percpu-rwsem.
> */
> + if (!strcmp(tok, "pcpu-sem"))
> + tok = (char *)"percpu-rwsem";
> for (unsigned int i = 0; i < ARRAY_SIZE(lock_type_table); i++) {
> if (!strcmp(lock_type_table[i].name, tok)) {
> if (add_lock_type(lock_type_table[i].flags)) {
> --
> 2.47.1.545.g3c1d2e2a6a-goog
>
next prev parent reply other threads:[~2024-12-11 19:15 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-12-10 20:08 [PATCH v5 1/3] perf lock: Fix parse_lock_type which only retrieve one lock flag Chun-Tse Shao
2024-12-10 20:08 ` [PATCH v5 2/3] perf lock: Add percpu-rwsem for type filter Chun-Tse Shao
2024-12-11 19:15 ` Namhyung Kim [this message]
2024-12-12 19:00 ` Arnaldo Carvalho de Melo
2024-12-12 20:58 ` Namhyung Kim
2024-12-10 20:08 ` [PATCH v5 3/3] perf lock: Rename fields in lock_type_table Chun-Tse Shao
2024-12-11 19:16 ` Namhyung Kim
2025-01-16 19:08 ` Namhyung Kim
2024-12-11 19:15 ` [PATCH v5 1/3] perf lock: Fix parse_lock_type which only retrieve one lock flag Namhyung Kim
2025-01-16 23:41 ` 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=Z1nk1gxH9siszkwG@google.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=ctshao@google.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=kan.liang@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mark.rutland@arm.com \
--cc=mingo@redhat.com \
--cc=nick.forrington@arm.com \
--cc=peterz@infradead.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 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).