From 907f5c480a9c0c4c8e8614b1207d569fd15f232c Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=A9mie=20Galarneau?= Date: Thu, 13 Apr 2023 15:50:57 -0400 Subject: [PATCH] Tests: fix: list_triggers_cli: kallsyms contains prefixed symbols MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit The test_list_triggers_cli test fails with: # Listing event-rule-matches kernel probe ./tests/regression/tools/trigger/test_list_triggers_cli: line 808: [[: 0xffffffffc1fca020 ffffffffc1fca030: syntax error in expression (error token is "ffffffffc1fca030") ./tests/regression/tools/trigger/test_list_triggers_cli: line 813: 0xffffffffc1fca020 ffffffffc1fca030 - 0xffffffffc1fca0c0 ffffffffc1fca0b0 : syntax error in expression (error token is "ffffffffc1fca030 - 0xffffffffc1fca0c0 ffffffffc1fca0b0 ") This is due to the fact that /proc/kallsyms now contains prefixed symbols (e.g. `__pfx_lttng_channel_enable`) which cause the test to fail since the grep invocation doesn't expect more than one match. Matching the begin/end of the "word" (or rather, function name) allows us to check for exact matches only. https://github.com/torvalds/linux/commit/9f2899fe36a623885d8576604cb582328ad32b3c Signed-off-by: Jérémie Galarneau Change-Id: Ifc04757719c733caf55c8eea447e18a2246a9f49 --- tests/regression/tools/trigger/test_list_triggers_cli | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/regression/tools/trigger/test_list_triggers_cli b/tests/regression/tools/trigger/test_list_triggers_cli index e6d025078..6194b8891 100755 --- a/tests/regression/tools/trigger/test_list_triggers_cli +++ b/tests/regression/tools/trigger/test_list_triggers_cli @@ -799,8 +799,8 @@ test_event_rule_matches_probe () diag "Listing event-rule-matches kernel probe" - channel_enable_addr=$(grep 'lttng_channel_enable' /proc/kallsyms | cut -f 1 -d ' ') - channel_disable_addr=$(grep 'lttng_channel_disable' /proc/kallsyms | cut -f 1 -d ' ') + channel_enable_addr=$(grep '\' /proc/kallsyms | cut -f 1 -d ' ') + channel_disable_addr=$(grep '\' /proc/kallsyms | cut -f 1 -d ' ') # We need to find a valid offset. base_symbol="" -- 2.34.1