public inbox for linux-perf-users@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1 1/2] perf lock: Fix option value type in parse_max_stack
@ 2026-03-19 22:12 Ian Rogers
  2026-03-19 22:12 ` [PATCH v1 2/2] perf stat: Fix opt->value type for parse_cache_level Ian Rogers
  2026-03-19 23:33 ` [PATCH v2 1/2] perf lock: Fix option value type in parse_max_stack Ian Rogers
  0 siblings, 2 replies; 6+ messages in thread
From: Ian Rogers @ 2026-03-19 22:12 UTC (permalink / raw)
  To: Peter Zijlstra, Ingo Molnar, Arnaldo Carvalho de Melo,
	Namhyung Kim, Alexander Shishkin, Jiri Olsa, Ian Rogers,
	Adrian Hunter, James Clark, linux-perf-users, linux-kernel

The value is a void* and the address of an int, max_stack_depth, is
set up in the perf lock options. The parse_max_stack function treats
the int* as a long*, make this more correct by declaring the value to
be an int*.

Fixes: 0a277b622670 ("perf lock contention: Check --max-stack option")
Signed-off-by: Ian Rogers <irogers@google.com>
---
 tools/perf/builtin-lock.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/builtin-lock.c b/tools/perf/builtin-lock.c
index e8962c985d34..5585aeb97684 100644
--- a/tools/perf/builtin-lock.c
+++ b/tools/perf/builtin-lock.c
@@ -2250,7 +2250,7 @@ static int parse_map_entry(const struct option *opt, const char *str,
 static int parse_max_stack(const struct option *opt, const char *str,
 			   int unset __maybe_unused)
 {
-	unsigned long *len = (unsigned long *)opt->value;
+	int *len = opt->value;
 	long val;
 	char *endptr;
 
-- 
2.53.0.959.g497ff81fa9-goog


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2026-03-27 21:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-19 22:12 [PATCH v1 1/2] perf lock: Fix option value type in parse_max_stack Ian Rogers
2026-03-19 22:12 ` [PATCH v1 2/2] perf stat: Fix opt->value type for parse_cache_level Ian Rogers
2026-03-19 23:33 ` [PATCH v2 1/2] perf lock: Fix option value type in parse_max_stack Ian Rogers
2026-03-19 23:33   ` [PATCH v2 2/2] perf stat: Fix opt->value type for parse_cache_level Ian Rogers
2026-03-26 22:02     ` Namhyung Kim
2026-03-27 21:01   ` [PATCH v2 1/2] perf lock: Fix option value type in parse_max_stack Namhyung Kim

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox