Skip to contentSkip to conversation

selftests/ftrace: Limit length in subsystem-enable tests

PATCH In review Yuanhe Shu 4 participants 4 messages Feb 26, 2024 – Apr 4, 2024

Subsystems (3)
lore
Share & tools
lore

Yuanhe Shu

author
#0 lore raw

PATCH v2 1/1 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 815b18ea66d6 ("ftracetest: Add basic event tracing test cases")
---
 .../selftests/ftrace/test.d/event/subsystem-enable.tc       | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc +3 -3
index b1ede6249866..b7c8f29c09a9 100644
@@ -18,7 +18,7 @@ echo 'sched:*' > set_event
 
 yield
 
-count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
+count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
 if [ $count -lt 3 ]; then
     fail "at least fork, exec and exit events should be recorded"
 fi
@@ -29,7 +29,7 @@ echo 1 > events/sched/enable
 
 yield
 
-count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
+count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
 if [ $count -lt 3 ]; then
     fail "at least fork, exec and exit events should be recorded"
 fi
@@ -40,7 +40,7 @@ echo 0 > events/sched/enable
 
 yield
 
-count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
+count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
 if [ $count -ne 0 ]; then
     fail "any of scheduler events should not be recorded"
 fi
Signature · 1 line
2.39.3
maintainer Acked-by on v2 1/1
#1 lore raw
Quoted 5 lines · On Mon, 26 Feb 2024 11:18:16 +0800 Yuanhe Shu <[email protected]>…

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.

Looks good to me.

Hi Shuah, can you pick this as a fix?

Thank you,

Quoted 43 lines
Fixes 815b18ea66d6 ("ftracetest: Add basic event tracing test cases")
---
 .../selftests/ftrace/test.d/event/subsystem-enable.tc       | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
tools/testing/selftests/ftrace/test.d/event/subsystem-enable.tc +3 -3
index b1ede6249866..b7c8f29c09a9 100644
@@ -18,7 +18,7 @@ echo 'sched:*' > set_event
 
 yield
 
-count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
+count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
 if [ $count -lt 3 ]; then
     fail "at least fork, exec and exit events should be recorded"
 fi
@@ -29,7 +29,7 @@ echo 1 > events/sched/enable
 
 yield
 
-count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
+count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
 if [ $count -lt 3 ]; then
     fail "at least fork, exec and exit events should be recorded"
 fi
@@ -40,7 +40,7 @@ echo 0 > events/sched/enable
 
 yield
 
-count=`cat trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
+count=`head -n 100 trace | grep -v ^# | awk '{ print $5 }' | sort -u | wc -l`
 if [ $count -ne 0 ]; then
     fail "any of scheduler events should not be recorded"
 fi
Signature · 1 line
2.39.3
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>
maintainer Acked-by
#2 lore raw
Quoted 9 lines · On Mon, 26 Feb 2024 15:09:38 +0900 Masami Hiramatsu (Google)…
Quoted 5 lines · On Mon, 26 Feb 2024 11:18:16 +0800 Yuanhe Shu <[email protected]>…

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.

Quoted 6 lines

Looks good to me.

Hi Shuah, can you pick this as a fix?

Yes please.

-- Steve

maintainer
#3 lore raw
Quoted 16 lines · Steven Rostedt
Quoted 13 lines · On Mon, 26 Feb 2024 15:09:38 +0900 Masami Hiramatsu (Google)…
Quoted 5 lines · On Mon, 26 Feb 2024 11:18:16 +0800 Yuanhe Shu <[email protected]>…

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.

Looks good to me.

Quoted 8 lines
Quoted 2 lines

Hi Shuah, can you pick this as a fix?

Yes please.

-- Steve

Sorry for the delay on this. Applied to linux-kselftest fixes branch for next rc.

thanks,
-- Shuah