diff options
author | Steven Rostedt (Google) <rostedt@goodmis.org> | 2024-02-24 00:13:56 +0300 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2024-03-18 17:33:05 +0300 |
commit | cf986e57d606849288eecf572800f2bd476fb1ab (patch) | |
tree | 7a19828fb593b131c873a500a9e1a2eb5e9dae36 /include/trace | |
parent | dd6ae6d90a84d4bec49887c7aa2b22aa1c8b2897 (diff) | |
download | linux-cf986e57d606849288eecf572800f2bd476fb1ab.tar.xz |
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>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/stages/stage6_event_callback.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/trace/stages/stage6_event_callback.h b/include/trace/stages/stage6_event_callback.h index 0c0f50bcdc56..935608971899 100644 --- a/include/trace/stages/stage6_event_callback.h +++ b/include/trace/stages/stage6_event_callback.h @@ -35,6 +35,7 @@ do { \ char *__str__ = __get_str(dst); \ int __len__ = __get_dynamic_array_len(dst) - 1; \ + WARN_ON_ONCE((src) != __data_offsets.dst##_ptr_); \ memcpy(__str__, __data_offsets.dst##_ptr_ ? : \ EVENT_NULL_STR, __len__); \ __str__[__len__] = '\0'; \ |