selftests: ftrace: Add a selftest to test event enable/disable func trigger
commit43bb45da82f94fffd5fb816e1fd2453561747c8b
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Mon, 17 Apr 2017 21:33:50 +0000 (17 17:33 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 18 Apr 2017 17:48:26 +0000 (18 13:48 -0400)
tree8499bb32384e27355ef8b5bff39436da1b47c0af
parent8e5e19c1b98394c2cdc186a4b0be422fe6e7217a
selftests: ftrace: Add a selftest to test event enable/disable func trigger

This adds a test to enable and disable trace events via the function
triggers. It tests enabling and disabling the sched:sched_switch event via
the the event_enable and event_disable function triggers attached to the
schedule() kernel function.

The test does the following:

 o disable all events

 o disables or enables the sched_switch event

 o writes schedule:event_enable/disable:sched:sched_switch into set_ftrace_filter

 o 5 times it checks to make sure:

    . Writes 0/1 into the sched_switch/enable

    . Checks that the sched_switch/enable goes back to 1/0

 o Resets the events

 o writes schedule:event_enable/disable:sched:sched_switch:3 into set_ftrace_filter

 o Does a loop of 3 to see that sched_switch/enable file gets updated

 o Makes sure the sched_switch/enable stops getting updated

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
tools/testing/selftests/ftrace/test.d/ftrace/func_event_triggers.tc [new file with mode: 0644]