Skip to content

Commit 1a4ea83

Browse files
Yuanhe Shushuahkh
authored andcommitted
selftests/ftrace: Limit length in subsystem-enable tests
While sched* events being traced and sched* events continuously happen, "[xx] event tracing - enable/disable with subsystem level files" would not stop as on some slower systems it seems to take forever. Select the first 100 lines of output would be enough to judge whether there are more than 3 types of sched events. Fixes: 815b18e ("ftracetest: Add basic event tracing test cases") Cc: [email protected] Signed-off-by: Yuanhe Shu <[email protected]> Acked-by: Masami Hiramatsu (Google) <[email protected]> Acked-by: Steven Rostedt (Google) <[email protected]> Signed-off-by: Shuah Khan <[email protected]>
1 parent 224fe42 commit 1a4ea83

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ echo 'sched:*' > set_event
1818

1919
yield
2020

21-
count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
21+
count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
2222
if [ $count -lt 3 ]; then
2323
fail "at least fork, exec and exit events should be recorded"
2424
fi
@@ -29,7 +29,7 @@ echo 1 > events/sched/enable
2929

3030
yield
3131

32-
count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
32+
count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
3333
if [ $count -lt 3 ]; then
3434
fail "at least fork, exec and exit events should be recorded"
3535
fi
@@ -40,7 +40,7 @@ echo 0 > events/sched/enable
4040

4141
yield
4242

43-
count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
43+
count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
4444
if [ $count -ne 0 ]; then
4545
fail "any of scheduler events should not be recorded"
4646
fi

0 commit comments

Comments
 (0)