mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
Commit 2867495dea ("tracing: tprobe-events: Register tracepoint when
enable tprobe event") caused regression bug and tprobe did not work.
To prevent similar problems, add a testcase which enables/disables a
tprobe and check the results.
Link: https://lore.kernel.org/r/176252610176.214996.3978515319000806265.stgit@devnote2
Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
41 lines
754 B
Bash
41 lines
754 B
Bash
#!/bin/sh
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
# description: Generic dynamic event - enable/disable tracepoint probe events
|
|
# requires: dynamic_events "t[:[<group>/][<event>]] <tracepoint> [<args>]":README
|
|
|
|
echo 0 > events/enable
|
|
echo > dynamic_events
|
|
|
|
TRACEPOINT=sched_switch
|
|
ENABLEFILE=events/tracepoints/myprobe/enable
|
|
|
|
:;: "Add tracepoint event on $TRACEPOINT" ;:
|
|
|
|
echo "t:myprobe ${TRACEPOINT}" >> dynamic_events
|
|
|
|
:;: "Check enable/disable to ensure it works" ;:
|
|
|
|
echo 1 > $ENABLEFILE
|
|
|
|
grep -q $TRACEPOINT trace
|
|
|
|
echo 0 > $ENABLEFILE
|
|
|
|
echo > trace
|
|
|
|
! grep -q $TRACEPOINT trace
|
|
|
|
:;: "Repeat enable/disable to ensure it works" ;:
|
|
|
|
echo 1 > $ENABLEFILE
|
|
|
|
grep -q $TRACEPOINT trace
|
|
|
|
echo 0 > $ENABLEFILE
|
|
|
|
echo > trace
|
|
|
|
! grep -q $TRACEPOINT trace
|
|
|
|
exit 0
|