]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/ftrace: Use readelf to find entry point in uprobe test
authorHeiko Carstens <hca@linux.ibm.com>
Thu, 20 Feb 2025 13:01:02 +0000 (14:01 +0100)
committerShuah Khan <skhan@linuxfoundation.org>
Wed, 26 Feb 2025 20:53:58 +0000 (13:53 -0700)
commitdc4b165855f230247fe02392fc1e29227067c253
tree1030d942074a43c54b93940ca26d3d2781cf6895
parente402c70856a37526594ae4d74a93d37a04030a2a
selftests/ftrace: Use readelf to find entry point in uprobe test

The uprobe events test fails on s390, but also on x86 (Fedora 41). The
problem appears to be that there is an assumption that adding a uprobe to
the beginning of the executable mapping of /bin/sh is sufficient to trigger
a uprobe event when /bin/sh is executed.

This assumption is not necessarily true. Therefore use "readelf -h" to find
the entry point address of /bin/sh and use this address when adding the
uprobe event.

This adds a dependency to readelf which is not always installed. Therefore
add a check and exit with exit_unresolved if it is not installed.

Link: https://lore.kernel.org/r/20250220130102.2079179-1-hca@linux.ibm.com
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
tools/testing/selftests/ftrace/test.d/dynevent/add_remove_uprobe.tc