Skip to contentSkip to conversation

tracing/selftests: Fix incorrect invocation of exit_fail

PATCH In review Woradorn Laodhanadhaworn 3 participants 3 messages Sep 18 – Oct 13

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tracing/selftests: Fix incorrect invocation of exit_fail

Replace all exit fail and exit_fail; with exit_fail to keep the usage of exit_fail consistent across the ftrace selftests. This also reduces warning messsege such as 'exit: Illegal number: fail' in test logs.

---
 .../ftrace/test.d/00basic/ringbuffer_subbuf_size.tc         | 6 +++---
 .../testing/selftests/ftrace/test.d/00basic/trace_marker.tc | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
tools/testing/selftests/ftrace/test.d/00basic/ringbuffer_subbuf_size.tc +3 -3
index d44d09a33a74..8cfe59d32b1f 100644
@@ -60,7 +60,7 @@ test_buffer() {
 	# the size must be greater than or equal to page_size - data_offset
 	page_size=$((page_size-data_offset))
 	if [ $size -lt $page_size ]; then
-		exit fail
+		exit_fail
 	fi
 
 	# Now add a little more the meta data overhead will overflow
@@ -71,14 +71,14 @@ test_buffer() {
 	new_str=`awk ' /tracing_mark_write:/ { sub(/^.*tracing_mark_write: /,"");printf "%s", $0; exit}' trace`
 
 	if [ "$new_str" = "$str" ]; then
-		exit fail;
+		exit_fail
 	fi
 
 	# Make sure the entire line can be found
 	new_str=`awk ' /tracing_mark_write:/ { sub(/^.*tracing_mark_write: /,"");printf "%s", $0; }' trace`
 
 	if [ "$new_str" != "$str" ]; then
-		exit fail;
+		exit_fail
 	fi
 }
 
tools/testing/selftests/ftrace/test.d/00basic/trace_marker.tc +2 -2
index 9aa0db2b84fc..1986c1bf1606 100644
@@ -68,14 +68,14 @@ test_buffer() {
 	new_str=`awk ' /tracing_mark_write:/ { sub(/^.*tracing_mark_write: /,"");printf "%s", $0; exit}' trace`
 
 	if [ "$new_str" = "$str" ]; then
-		exit fail;
+		exit_fail
 	fi
 
 	# Make sure the entire line can be found
 	new_str=`awk ' /tracing_mark_write:/ { sub(/^.*tracing_mark_write: /,"");printf "%s", $0; }' trace`
 
 	if [ "$new_str" != "$str" ]; then
-		exit fail;
+		exit_fail
 	fi
 }
 
Signature · 1 line
2.43.0
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Woradorn Laodhanadhaworn

Replace all exit fail and exit_fail; with exit_fail to keep the usage of exit_fail consistent across the ftrace selftests. This also reduces warning messsege such as 'exit: Illegal number: fail' in test logs.

Looks good to me.

Fixes 2f84b39f4847 ("tracing: Update subbuffer with kilobytes not page order")

Shuah, can you pick this fix via your branch?

Thank you,

Quoted 56 lines
---
 .../ftrace/test.d/00basic/ringbuffer_subbuf_size.tc         | 6 +++---
 .../testing/selftests/ftrace/test.d/00basic/trace_marker.tc | 4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)
tools/testing/selftests/ftrace/test.d/00basic/ringbuffer_subbuf_size.tc +3 -3
index d44d09a33a74..8cfe59d32b1f 100644
@@ -60,7 +60,7 @@ test_buffer() {
 	# the size must be greater than or equal to page_size - data_offset
 	page_size=$((page_size-data_offset))
 	if [ $size -lt $page_size ]; then
-		exit fail
+		exit_fail
 	fi
 
 	# Now add a little more the meta data overhead will overflow
@@ -71,14 +71,14 @@ test_buffer() {
 	new_str=`awk ' /tracing_mark_write:/ { sub(/^.*tracing_mark_write: /,"");printf "%s", $0; exit}' trace`
 
 	if [ "$new_str" = "$str" ]; then
-		exit fail;
+		exit_fail
 	fi
 
 	# Make sure the entire line can be found
 	new_str=`awk ' /tracing_mark_write:/ { sub(/^.*tracing_mark_write: /,"");printf "%s", $0; }' trace`
 
 	if [ "$new_str" != "$str" ]; then
-		exit fail;
+		exit_fail
 	fi
 }
 
tools/testing/selftests/ftrace/test.d/00basic/trace_marker.tc +2 -2
index 9aa0db2b84fc..1986c1bf1606 100644
@@ -68,14 +68,14 @@ test_buffer() {
 	new_str=`awk ' /tracing_mark_write:/ { sub(/^.*tracing_mark_write: /,"");printf "%s", $0; exit}' trace`
 
 	if [ "$new_str" = "$str" ]; then
-		exit fail;
+		exit_fail
 	fi
 
 	# Make sure the entire line can be found
 	new_str=`awk ' /tracing_mark_write:/ { sub(/^.*tracing_mark_write: /,"");printf "%s", $0; }' trace`
 
 	if [ "$new_str" != "$str" ]; then
-		exit fail;
+		exit_fail
 	fi
 }
 
Signature · 1 line
Masami Hiramatsu (Google) <[email protected]>
maintainer
#2 lore raw
Quoted 6 lines · Masami Hiramatsu (Google)
Quoted 5 lines · Woradorn Laodhanadhaworn

Replace all exit fail and exit_fail; with exit_fail to keep the usage of exit_fail consistent across the ftrace selftests. This also reduces warning messsege such as 'exit: Illegal number: fail' in test logs.

Quoted 9 lines
Quoted 1 line

Looks good to me.

Fixes 2f84b39f4847 ("tracing: Update subbuffer with kilobytes not page order")

Shuah, can you pick this fix via your branch?

Thank you. Will apply this patch for 7.4-rc1

thanks,
-- Shuah