summaryrefslogtreecommitdiff
path: root/tools/testing/selftests/user_events
diff options
context:
space:
mode:
authorBeau Belgrave <beaub@linux.microsoft.com>2024-04-23 19:23:37 +0300
committerSteven Rostedt (Google) <rostedt@goodmis.org>2024-05-13 19:15:45 +0300
commitbd125a084091396f3e796bb3dc009940d9771811 (patch)
tree98a8df8ac0e47dd706abea79fa4cd68f509b3e6c /tools/testing/selftests/user_events
parentdd5a440a31fae6e459c0d6271dddd62825505361 (diff)
downloadlinux-bd125a084091396f3e796bb3dc009940d9771811.tar.xz
tracing/user_events: Fix non-spaced field matching
When the ABI was updated to prevent same name w/different args, it missed an important corner case when fields don't end with a space. Typically, space is used for fields to help separate them, like "u8 field1; u8 field2". If no spaces are used, like "u8 field1;u8 field2", then the parsing works for the first time. However, the match check fails on a subsequent register, leading to confusion. This is because the match check uses argv_split() and assumes that all fields will be split upon the space. When spaces are used, we get back { "u8", "field1;" }, without spaces we get back { "u8", "field1;u8" }. This causes a mismatch, and the user program gets back -EADDRINUSE. Add a method to detect this case before calling argv_split(). If found force a space after the field separator character ';'. This ensures all cases work properly for matching. With this fix, the following are all treated as matching: u8 field1;u8 field2 u8 field1; u8 field2 u8 field1;\tu8 field2 u8 field1;\nu8 field2 Link: https://lore.kernel.org/linux-trace-kernel/20240423162338.292-2-beaub@linux.microsoft.com Fixes: ba470eebc2f6 ("tracing/user_events: Prevent same name but different args event") Signed-off-by: Beau Belgrave <beaub@linux.microsoft.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'tools/testing/selftests/user_events')
0 files changed, 0 insertions, 0 deletions