Skip to contentSkip to conversation

tracing: ftrace_lib: check if tracing_max_latency exists.

PATCH New Sandeep Patil 2 participants 4 messages Aug 8, 2018 – Aug 13, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 tracing: ftrace_lib: check if tracing_max_latency exists.

This avoids unnecessary error in ftrace stress test when the kernel being tested does not have CONFIG_TRACER_MAX_TRACE defined.

---
 testcases/kernel/tracing/ftrace_test/ftrace_lib.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
testcases/kernel/tracing/ftrace_test/ftrace_lib.sh +3 -1
index 20cf5e760..ec4f7a557 100755
@@ -100,7 +100,9 @@ restore_old_setting()
 
 	echo nop > current_tracer
 	echo 0 > events/enable
-	echo 0 > tracing_max_latency 2> /dev/null
+	if [ -e tracing_max_latency ]; then
+		echo 0 > tracing_max_latency 2> /dev/null
+	fi
 
 	if [ -e tracing_cpumask ]; then
 		echo $old_tracing_cpumask > tracing_cpumask
Signature · 1 line
2.18.0.597.ga71716f1ad-goog
#1 lore raw

PATCH 1/1 tracing: ftrace_lib: check if tracing_max_latency exists.

Hi!

Quoted 13 lines

This avoids unnecessary error in ftrace stress test when the kernel being tested does not have CONFIG_TRACER_MAX_TRACE defined.

---
 testcases/kernel/tracing/ftrace_test/ftrace_lib.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
testcases/kernel/tracing/ftrace_test/ftrace_lib.sh +0 -0
index 20cf5e760..ec4f7a557 100755

testcases/kernel/tracing/ftrace_test/ftrace_lib.sh restore_old_setting() · line 105

Quoted 7 lines
testcases/kernel/tracing/ftrace_test/ftrace_lib.sh +3 -1
@@ -100,7 +100,9 @@ restore_old_setting()
 
 	echo nop > current_tracer
 	echo 0 > events/enable
-	echo 0 > tracing_max_latency 2> /dev/null
+	if [ -e tracing_max_latency ]; then
+		echo 0 > tracing_max_latency 2> /dev/null
+	fi

I guess that we can remove the 2> /dev/null that I suppose was supposed to silence the error. Does it work okay for you without the redirection?

Signature · 2 lines
Cyril Hrubis
[email protected]
#2 lore raw

PATCH 1/1 tracing: ftrace_lib: check if tracing_max_latency exists.

Quoted 15 lines · Cyril Hrubis

Hi!

Quoted 14 lines

This avoids unnecessary error in ftrace stress test when the kernel being tested does not have CONFIG_TRACER_MAX_TRACE defined.

---
 testcases/kernel/tracing/ftrace_test/ftrace_lib.sh | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
testcases/kernel/tracing/ftrace_test/ftrace_lib.sh +0 -0
index 20cf5e760..ec4f7a557 100755
@@ -100,7 +100,9 @@ restore_old_setting()
 
Quoted 9 lines

testcases/kernel/tracing/ftrace_test/ftrace_lib.sh restore_old_setting() · line 105

Quoted 6 lines
testcases/kernel/tracing/ftrace_test/ftrace_lib.sh +3 -1
 	echo nop > current_tracer
 	echo 0 > events/enable
-	echo 0 > tracing_max_latency 2> /dev/null
+	if [ -e tracing_max_latency ]; then
+		echo 0 > tracing_max_latency 2> /dev/null
+	fi

I guess that we can remove the 2> /dev/null that I suppose was supposed to silence the error. Does it work okay for you without the redirection?

Yes, just tested it. Works for me. Want me to send the patch removing it?

- ssp

Quoted 4 lines
Signature · 3 lines
-- 
Cyril Hrubis
[email protected]
#3 lore raw

PATCH 1/1 tracing: ftrace_lib: check if tracing_max_latency exists.

Hi!

Quoted 4 lines
Quoted 2 lines

I guess that we can remove the 2> /dev/null that I suppose was supposed to silence the error. Does it work okay for you without the redirection?

Yes, just tested it. Works for me. Want me to send the patch removing it?

No need, I will edit the patch you send before applying.

Signature · 2 lines
Cyril Hrubis
[email protected]