Skip to content

Commit cf986e5

Browse files
committed
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/[email protected] Cc: Mathieu Desnoyers <[email protected]> Reviewed-by: Masami Hiramatsu (Google) <[email protected]> Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent dd6ae6d commit cf986e5

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

include/trace/stages/stage6_event_callback.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
do { \
3636
char *__str__ = __get_str(dst); \
3737
int __len__ = __get_dynamic_array_len(dst) - 1; \
38+
WARN_ON_ONCE((src) != __data_offsets.dst##_ptr_); \
3839
memcpy(__str__, __data_offsets.dst##_ptr_ ? : \
3940
EVENT_NULL_STR, __len__); \
4041
__str__[__len__] = '\0'; \

0 commit comments

Comments
 (0)