Skip to content

Commit 49cacd3

Browse files
Yuanhe Shugregkh
authored andcommitted
selftests/ftrace: Limit length in subsystem-enable tests
commit 1a4ea83 upstream. 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: stable@vger.kernel.org Signed-off-by: Yuanhe Shu <xiangzao@linux.alibaba.com> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Acked-by: Steven Rostedt (Google) <rostedt@goodmis.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 14b74fc commit 49cacd3

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
@@ -22,7 +22,7 @@ echo 'sched:*' > set_event
2222

2323
yield
2424

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

3434
yield
3535

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

4545
yield
4646

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

0 commit comments

Comments
 (0)