staging: rtl8192u: remove redundant assignment to pointer crypt
[linux/fpc-iii.git] / tools / testing / selftests / ftrace / test.d / trigger / trigger-multihist.tc
blob18fdaab9f570cb1583711d89d720d35c53867b0d
1 #!/bin/sh
2 # SPDX-License-Identifier: GPL-2.0
3 # description: event trigger - test multiple histogram triggers
4 # flags: instance
6 fail() { #msg
7 echo $1
8 exit_fail
11 if [ ! -f set_event -o ! -d events/sched ]; then
12 echo "event tracing is not supported"
13 exit_unsupported
16 if [ ! -f events/sched/sched_process_fork/trigger ]; then
17 echo "event trigger is not supported"
18 exit_unsupported
21 if [ ! -f events/sched/sched_process_fork/hist ]; then
22 echo "hist trigger is not supported"
23 exit_unsupported
26 echo "Test histogram multiple tiggers"
28 echo 'hist:keys=parent_pid:vals=child_pid' > events/sched/sched_process_fork/trigger
29 echo 'hist:keys=parent_comm:vals=child_pid' >> events/sched/sched_process_fork/trigger
30 for i in `seq 1 10` ; do ( echo "forked" > /dev/null); done
31 grep parent_pid events/sched/sched_process_fork/hist > /dev/null || \
32 fail "hist trigger on sched_process_fork did not work"
33 grep child events/sched/sched_process_fork/hist > /dev/null || \
34 fail "hist trigger on sched_process_fork did not work"
35 COMM=`cat /proc/$$/comm`
36 grep "parent_comm: $COMM" events/sched/sched_process_fork/hist > /dev/null || \
37 fail "string key on sched_process_fork did not work"
39 reset_trigger
41 echo "Test histogram with its name"
43 echo 'hist:name=test_hist:keys=common_pid' > events/sched/sched_process_fork/trigger
44 for i in `seq 1 10` ; do ( echo "forked" > /dev/null); done
45 grep test_hist events/sched/sched_process_fork/hist > /dev/null || \
46 fail "named event on sched_process_fork did not work"
48 echo "Test same named histogram on different events"
50 echo 'hist:name=test_hist:keys=common_pid' > events/sched/sched_process_exit/trigger
51 for i in `seq 1 10` ; do ( echo "forked" > /dev/null); done
52 grep test_hist events/sched/sched_process_exit/hist > /dev/null || \
53 fail "named event on sched_process_fork did not work"
55 diffs=`diff events/sched/sched_process_exit/hist events/sched/sched_process_fork/hist | wc -l`
56 test $diffs -eq 0 || fail "Same name histograms are not same"
58 exit 0