Thread (9 messages) flat view 9 messages, 2 authors, 1d ago
WARM1d

[PATCH 1/2] selftests/ftrace: Force C locale for readelf in uprobe test

From: Rui Qi <hidden>
Date: 2026-08-06 08:31:23
Also in: linux-kselftest, lkml
Subsystem: kernel selftest framework, the rest, tracing · Maintainers: Shuah Khan, Shuah Khan, Linus Torvalds, Steven Rostedt, Masami Hiramatsu

The add_remove_uprobe test parses the entry point from readelf -h output
by looking for the English "Entry" field. readelf output is localized
via gettext, while the ftracetest runner does not force LC_ALL=C and the
top-level Makefile leaves LANG effective for child processes.

If readelf prints a translated field name, ENTRYPOINT becomes empty and
the uprobe_events write is rejected because the offset after PATH: is
missing.

Run readelf with LC_ALL=C so the parsed header field remains stable
across locales.

Signed-off-by: Rui Qi <redacted>
---
 .../selftests/ftrace/test.d/dynevent/add_remove_uprobe.tc       | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe.tc b/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe.tc
index f2048c244526..f33a863be68b 100644
--- a/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe.tc
+++ b/tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe.tc
@@ -12,7 +12,7 @@ echo 0 > events/enable
 echo > dynamic_events
 
 REALBIN=`readlink -f /bin/sh`
-ENTRYPOINT=`readelf -h ${REALBIN} | grep Entry | sed -e 's/[^0]*//'`
+ENTRYPOINT=`LC_ALL=C readelf -h ${REALBIN} | grep Entry | sed -e 's/[^0]*//'`
 
 echo "p:myevent ${REALBIN}:${ENTRYPOINT}" >> uprobe_events
 
-- 
2.20.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help