Skip to content

Commit

Permalink
Merge tag 'linux_kselftest-next-6.15-rc1' of git://git.kernel.org/pub…
Browse files Browse the repository at this point in the history
…/scm/linux/kernel/git/shuah/linux-kselftest

Pull Kselftest updates from Shuah Khan:

 - Fix bugs and clean up code in tracing, ftrace, and user_events tests

 - Add missing executables to ftrace gitignore

* tag 'linux_kselftest-next-6.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
  selftests/ftrace: add 'poll' binary to gitignore
  selftests/ftrace: Use readelf to find entry point in uprobe test
  selftests/user_events: Fix failures caused by test code
  selftests/tracing: Allow some more tests to run in instances
  selftests/ftrace: Clean up triggers after setting them
  selftests/tracing: Test only toplevel README file not the instances
  • Loading branch information
Linus Torvalds committed Mar 28, 2025
2 parents 68f090f + 82ef781 commit 8e324a5
Show file tree
Hide file tree
Showing 8 changed files with 25 additions and 4 deletions.
1 change: 1 addition & 0 deletions tools/testing/selftests/ftrace/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
# SPDX-License-Identifier: GPL-2.0-only
logs
poll
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
# description: Generic dynamic event - add/remove/test uprobe events
# requires: uprobe_events

if ! which readelf > /dev/null 2>&1 ; then
echo "No readelf found. skipped."
exit_unresolved
fi

echo 0 > events/enable
echo > dynamic_events

REALBIN=`readlink -f /bin/sh`
ENTRYPOINT=`readelf -h ${REALBIN} | grep Entry | sed -e 's/[^0]*//'`

echo 'cat /proc/$$/maps' | /bin/sh | \
grep "r-xp .*${REALBIN}$" | \
awk '{printf "p:myevent %s:0x%s\n", $6,$3 }' >> uprobe_events
echo "p:myevent ${REALBIN}:${ENTRYPOINT}" >> uprobe_events

grep -q myevent uprobe_events
test -d events/uprobes/myevent
Expand Down
8 changes: 7 additions & 1 deletion tools/testing/selftests/ftrace/test.d/functions
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,13 @@ check_requires() { # Check required files and tracers
exit_unsupported
fi
elif [ "$r" != "$i" ]; then
if ! grep -Fq "$r" README ; then
# If this is an instance, check the top directory
if echo $TRACING_DIR | grep -q "/instances/"; then
test="$TRACING_DIR/../.."
else
test=$TRACING_DIR
fi
if ! grep -Fq "$r" $test/README ; then
echo "Required feature pattern \"$r\" is not in README."
exit_unsupported
fi
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: GPL-2.0
# description: event trigger - test inter-event histogram trigger expected fail actions
# requires: set_event snapshot "snapshot()":README
# flags: instance

fail() { #msg
echo $1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: GPL-2.0
# description: event trigger - test inter-event histogram trigger onchange action
# requires: set_event "onchange(var)":README ping:program
# flags: instance

fail() { #msg
echo $1
Expand All @@ -19,4 +20,6 @@ if ! grep -q "changed:" events/sched/sched_waking/hist; then
fail "Failed to create onchange action inter-event histogram"
fi

echo '!hist:keys=comm:newprio=prio:onchange($newprio).save(comm,prio) if comm=="ping"' >> events/sched/sched_waking/trigger

exit 0
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: GPL-2.0
# description: event trigger - test inter-event histogram trigger snapshot action
# requires: set_event snapshot events/sched/sched_process_fork/hist "onchange(var)":README "snapshot()":README ping:program
# flags: instance

fail() { #msg
echo $1
Expand All @@ -27,4 +28,6 @@ if ! grep -q "comm=ping" snapshot; then
fail "Failed to create snapshot action inter-event histogram"
fi

echo '!hist:keys=comm:newprio=prio:onchange($newprio).save(comm,prio):onchange($newprio).snapshot() if comm=="ping"' >> events/sched/sched_waking/trigger

exit 0
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
# SPDX-License-Identifier: GPL-2.0
# description: event trigger - test histogram expression parsing
# requires: set_event events/sched/sched_process_fork/trigger events/sched/sched_process_fork/hist error_log "<var1>=<field|var_ref|numeric_literal>":README
# flags: instance


fail() { #msg
Expand Down
2 changes: 2 additions & 0 deletions tools/testing/selftests/user_events/dyn_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@ static int parse_abi(int *check, const char *value)

close(fd);

wait_for_delete();

return ret;
}

Expand Down

0 comments on commit 8e324a5

Please sign in to comment.