staging: rtl8192u: remove redundant assignment to pointer crypt
[linux/fpc-iii.git] / tools / testing / selftests / ftrace / test.d / kprobe / kprobe_module.tc
blobd861bd776c5eafd336d5b195a63599e80731412a
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3 # description: Kprobe dynamic event - probing module
5 [ -f kprobe_events ] || exit_unsupported # this is configurable
7 rmmod trace-printk ||:
8 if ! modprobe trace-printk ; then
9 echo "No trace-printk sample module - please make CONFIG_SAMPLE_TRACE_PRINTK=
11 exit_unresolved;
14 MOD=trace_printk
15 FUNC=trace_printk_irq_work
17 :;: "Add an event on a module function without specifying event name" ;:
19 echo "p $MOD:$FUNC" > kprobe_events
20 PROBE_NAME=`echo $MOD:$FUNC | tr ".:" "_"`
21 test -d events/kprobes/p_${PROBE_NAME}_0 || exit_failure
23 :;: "Add an event on a module function with new event name" ;:
25 echo "p:event1 $MOD:$FUNC" > kprobe_events
26 test -d events/kprobes/event1 || exit_failure
28 :;: "Add an event on a module function with new event and group name" ;:
30 echo "p:kprobes1/event1 $MOD:$FUNC" > kprobe_events
31 test -d events/kprobes1/event1 || exit_failure
33 :;: "Remove target module, but event still be there" ;:
34 if ! rmmod trace-printk ; then
35 echo "Failed to unload module - please enable CONFIG_MODULE_UNLOAD"
36 exit_unresolved;
38 test -d events/kprobes1/event1
40 :;: "Check posibility to defining events on unloaded module";:
41 echo "p:event2 $MOD:$FUNC" >> kprobe_events
43 :;: "Target is gone, but we can prepare for next time";:
44 echo 1 > events/kprobes1/event1/enable
46 :;: "Load module again, which means the event1 should be recorded";:
47 modprobe trace-printk
48 grep "event1:" trace
50 :;: "Remove the module again and check the event is not locked"
51 rmmod trace-printk
52 echo 0 > events/kprobes1/event1/enable
53 echo "-:kprobes1/event1" >> kprobe_events