tracing: Ensure optimized hashing works

If ever PID_MAX_DEFAULT changes, it must be compatible with tracing
hashmaps assumptions.

Cc: Masami Hiramatsu <mhiramat@kernel.org>
Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Link: https://lore.kernel.org/20250924113810.2433478-1-mkoutny@suse.com
Link: https://lore.kernel.org/r/20240409110126.651e94cb@gandalf.local.home/
Signed-off-by: Michal Koutný <mkoutny@suse.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
This commit is contained in:
Michal Koutný
2025-09-24 13:38:09 +02:00
committed by Steven Rostedt (Google)
parent 4099b98203
commit 2378a191f4

View File

@@ -247,6 +247,8 @@ int trace_save_cmdline(struct task_struct *tsk)
if (!tsk->pid)
return 1;
BUILD_BUG_ON(!is_power_of_2(PID_MAX_DEFAULT));
tpid = tsk->pid & (PID_MAX_DEFAULT - 1);
/*