Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

tracing: Add warning if string in __assign_str() does not match __string()

In preparation to remove the second parameter of __assign_str(), make sure
it is really a duplicate of __string() by adding a WARN_ON_ONCE().

Link: https://lore.kernel.org/linux-trace-kernel/20240223161356.63b72403@gandalf.local.home

Cc: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reviewed-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>

+1
+1
include/trace/stages/stage6_event_callback.h
··· 35 35 do { \ 36 36 char *__str__ = __get_str(dst); \ 37 37 int __len__ = __get_dynamic_array_len(dst) - 1; \ 38 + WARN_ON_ONCE((src) != __data_offsets.dst##_ptr_); \ 38 39 memcpy(__str__, __data_offsets.dst##_ptr_ ? : \ 39 40 EVENT_NULL_STR, __len__); \ 40 41 __str__[__len__] = '\0'; \