perf/core: Replace zero-length array with flexible-array
[linux-2.6-microblaze.git] / tools / testing / selftests / ftrace / test.d / ftrace / func_mod_trace.tc
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3 # description: ftrace - function trace on module
4
5 [ ! -f set_ftrace_filter ] && exit_unsupported
6
7 : "mod: allows to filter a non exist function"
8 echo 'non_exist_func:mod:non_exist_module' > set_ftrace_filter
9 grep -q "non_exist_func" set_ftrace_filter
10
11 : "mod: on exist module"
12 echo '*:mod:trace_printk' > set_ftrace_filter
13 if ! modprobe trace-printk ; then
14   echo "No trace-printk sample module - please make CONFIG_SAMPLE_TRACE_PRINTK=
15 m"
16   exit_unresolved;
17 fi
18
19 : "Wildcard should be resolved after loading module"
20 grep -q "trace_printk_irq_work" set_ftrace_filter
21
22 : "After removing the filter becomes empty"
23 rmmod trace_printk
24 test `cat set_ftrace_filter | wc -l` -eq 0