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, linux-perf-users@vger.kernel.org,
bpf@vger.kernel.org
Subject: Re: [PATCH v5 5/5] perf lock: Update documentation for -o option in contention mode
Date: Thu, 13 Feb 2025 15:28:13 -0800 [thread overview]
Message-ID: <Z66ADd48l6lJnQSt@google.com> (raw)
In-Reply-To: <20250212222859.2086080-6-ctshao@google.com>
On Wed, Feb 12, 2025 at 02:24:56PM -0800, Chun-Tse Shao wrote:
> This patch also decouple -o with -t, and shows warning to notify the new
> behavior for -ov.
I think it's better to squash this commit to the previous.
>
> Signed-off-by: Chun-Tse Shao <ctshao@google.com>
> ---
> tools/perf/builtin-lock.c | 10 ++++++++--
> 1 file changed, 8 insertions(+), 2 deletions(-)
>
> diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
> index 3dc100cf30ef..e16bda6ce525 100644
> --- a/tools/perf/builtin-lock.c
> +++ b/tools/perf/builtin-lock.c
> @@ -1817,7 +1817,7 @@ static void print_contention_result(struct lock_contention *con)
> break;
> }
>
> - if (con->owner && con->save_callstack) {
> + if (con->owner && con->save_callstack && verbose > 0) {
> struct rb_root root = RB_ROOT;
>
> if (symbol_conf.field_sep)
> @@ -1978,6 +1978,11 @@ static int check_lock_contention_options(const struct option *options,
> }
> }
>
> + if (show_lock_owner && !show_thread_stats) {
> + pr_warning("Now -o try to show owner's callstack instead of pid and comm.\n");
> + pr_warning("Please use -t option too to keep the old behavior.\n");
> + }
> +
> return 0;
> }
>
> @@ -2569,7 +2574,8 @@ int cmd_lock(int argc, const char **argv)
> "Filter specific address/symbol of locks", parse_lock_addr),
> OPT_CALLBACK('S', "callstack-filter", NULL, "NAMES",
> "Filter specific function in the callstack", parse_call_stack),
> - OPT_BOOLEAN('o', "lock-owner", &show_lock_owner, "show lock owners instead of waiters"),
> + OPT_BOOLEAN('o', "lock-owner", &show_lock_owner, "show lock owners instead of waiters.\n"
> + "\t\t\tThis option can be combined with -t, which shows owner's per thread lock stats, or -v, which shows owner's stacktrace"),
I think this description should go to the man page and leave the option
as is. You made it to show the warning when it's actually used.
Thanks,
Namhyung
> OPT_STRING_NOEMPTY('x', "field-separator", &symbol_conf.field_sep, "separator",
> "print result in CSV format with custom separator"),
> OPT_BOOLEAN(0, "lock-cgroup", &show_lock_cgroups, "show lock stats by cgroup"),
> --
> 2.48.1.502.g6dc24dfdaf-goog
>
prev parent reply other threads:[~2025-02-13 23:28 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 22:24 [PATCH v5 0/5] Tracing contention lock owner call stack Chun-Tse Shao
2025-02-12 22:24 ` [PATCH v5 1/5] perf lock: Add bpf maps for owner stack tracing Chun-Tse Shao
2025-02-12 22:24 ` [PATCH v5 2/5] perf lock: Retrieve owner callstack in bpf program Chun-Tse Shao
2025-02-12 22:24 ` [PATCH v5 3/5] perf lock: Make rb_tree helper functions generic Chun-Tse Shao
2025-02-12 22:24 ` [PATCH v5 4/5] perf lock: Report owner stack in usermode Chun-Tse Shao
2025-02-13 23:24 ` Namhyung Kim
2025-02-12 22:24 ` [PATCH v5 5/5] perf lock: Update documentation for -o option in contention mode Chun-Tse Shao
2025-02-13 23:28 ` Namhyung Kim [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=Z66ADd48l6lJnQSt@google.com \
--to=namhyung@kernel.org \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=alexander.shishkin@linux.intel.com \
--cc=bpf@vger.kernel.org \
--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=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 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.