Commit ed9dafeb authored by Steven Rostedt (VMware)'s avatar Steven Rostedt (VMware)
Browse files

ftrace/selftests: Update the direct call selftests to test two direct calls



The register_ftrace_direct() takes a different path if there's already a
direct call registered, but this was not tested in the self tests. Now that
there's a second direct caller test module, we can use this to test not only
one direct caller, but two.

Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
parent 156473a0
Loading
Loading
Loading
Loading
+16 −0
Original line number Diff line number Diff line
@@ -51,3 +51,19 @@ done

echo nop > current_tracer
rmmod ftrace-direct ||:

# Now do the same thing with another direct function registered
echo "Running with another ftrace direct function"

rmmod ftrace-direct-too ||:
modprobe ftrace-direct-too

for t in `cat available_tracers`; do
	if [ "$t" != "nop" ]; then
		test_tracer $t
	fi
done

echo nop > current_tracer
rmmod ftrace-direct ||:
rmmod ftrace-direct-too ||:
+36 −23
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ disable_probe() {
	echo 0 > events/kprobes/kwake/enable
}

test_kprobes() {
	# probe -> direct -> no direct > no probe
	enable_probe
	start_direct
@@ -67,5 +68,17 @@ start_direct
	enable_probe
	stop_direct
	disable_probe
}

test_kprobes

# Now do this with a second registered direct function
echo "Running with another ftrace direct function"

modprobe ftrace-direct-too

test_kprobes

rmmod ftrace-direct-too

echo > kprobe_events