lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z66ADd48l6lJnQSt@google.com>
Date: Thu, 13 Feb 2025 15:28:13 -0800
From: Namhyung Kim <namhyung@...nel.org>
To: Chun-Tse Shao <ctshao@...gle.com>
Cc: linux-kernel@...r.kernel.org, peterz@...radead.org, mingo@...hat.com,
	acme@...nel.org, mark.rutland@....com,
	alexander.shishkin@...ux.intel.com, jolsa@...nel.org,
	irogers@...gle.com, adrian.hunter@...el.com,
	kan.liang@...ux.intel.com, linux-perf-users@...r.kernel.org,
	bpf@...r.kernel.org
Subject: Re: [PATCH v5 5/5] perf lock: Update documentation for -o option in
 contention mode

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@...gle.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
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ