summaryrefslogtreecommitdiffstats
path: root/tools/testing/selftests/ftrace/test.d/trigger/trigger-trace-marker-hist.tc
blob: ab6bedb257367684438d1c9a6f03d271c0d8edc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/sh
# SPDX-License-Identifier: GPL-2.0
# description: trace_marker trigger - test histogram trigger
# flags: instance

fail() { #msg
    echo $1
    exit_fail
}

if [ ! -f set_event ]; then
    echo "event tracing is not supported"
    exit_unsupported
fi

if [ ! -d events/ftrace/print ]; then
    echo "event trace_marker is not supported"
    exit_unsupported
fi

if [ ! -f events/ftrace/print/trigger ]; then
    echo "event trigger is not supported"
    exit_unsupported
fi

if [ ! -f events/ftrace/print/hist ]; then
    echo "hist trigger is not supported"
    exit_unsupported
fi

echo "Test histogram trace_marker tigger"

echo 'hist:keys=common_pid' > events/ftrace/print/trigger
for i in `seq 1 10` ; do echo "hello" > trace_marker; done
grep 'hitcount: *10$' events/ftrace/print/hist > /dev/null || \
    fail "hist trigger did not trigger correct times on trace_marker"

exit 0
OpenPOWER on IntegriCloud