Skip to contentSkip to conversation

Fix disable set_ftrace_pid in ftrace_set_ftrace_pid.sh

PATCH In review Han Pingtian 2 participants 6 messages Feb 10, 2011 – Feb 22, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix disable set_ftrace_pid in ftrace_set_ftrace_pid.sh

It seems we need echo -1 to set_ftrace_pid to disable in. Or we'll get these error message when running ftrace_stress:

...
ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh: line 39: echo: write error: Invalid argument
...

---
 .../ftrace_stress/ftrace_set_ftrace_pid.sh         |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh +1 -1
index 541215c..bd08f04 100755
@@ -36,7 +36,7 @@ for ((; ; ))
 			eval echo $str >> "$TRACING_PATH"/set_ftrace_pid
 		}
 
-		echo > "$TRACING_PATH"/set_ftrace_pid
+		echo -1 > "$TRACING_PATH"/set_ftrace_pid
 	}
 
 	sleep 1
Signature · 12 lines
1.7.1

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#1 lore raw

Hello,

Any comments to this patch?

Thanks.

Quoted 36 lines · Han Pingtian

It seems we need echo -1 to set_ftrace_pid to disable in. Or we'll get these error message when running ftrace_stress:

...
ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh: line 39: echo: write error: Invalid argument
...

---
 .../ftrace_stress/ftrace_set_ftrace_pid.sh         |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh +1 -1
index 541215c..bd08f04 100755
@@ -36,7 +36,7 @@ for ((; ; ))
 			eval echo $str >> "$TRACING_PATH"/set_ftrace_pid
 		}
 
-		echo > "$TRACING_PATH"/set_ftrace_pid
+		echo -1 > "$TRACING_PATH"/set_ftrace_pid
 	}
 
 	sleep 1
Signature · 12 lines
1.7.1

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
Signature · 16 lines
Han Pingtian
Quality Engineer
hpt @ #kernel-qe
Red Hat, Inc
Freedom ... courage ... Commitment ... ACCOUNTABILITY

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#2 lore raw
In reply to Han Pingtian
Quoted 3 lines · Han Pingtian

It seems we need echo -1 to set_ftrace_pid to disable in. Or we'll get these error message when running ftrace_stress:

kernel version?

This is the result from latest kernel:

# echo > set_ftrace_pid
# echo -1 > set_ftrace_pid
bash: echo: write error: Invalid argument
Quoted 12 lines

...
ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh: line 39: echo: write error: Invalid argument
...

---
 .../ftrace_stress/ftrace_set_ftrace_pid.sh         |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh +0 -0
index 541215c..bd08f04 100755

testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh for ((; ; )) · line 42

Quoted 8 lines
testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh +1 -1
@@ -36,7 +36,7 @@ for ((; ; ))
 			eval echo $str >> "$TRACING_PATH"/set_ftrace_pid
 		}
 
-		echo > "$TRACING_PATH"/set_ftrace_pid
+		echo -1 > "$TRACING_PATH"/set_ftrace_pid
 	}
 
 	sleep 1

------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle. Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#3 lore raw
Quoted 6 lines · Li Zefan
Quoted 3 lines · Han Pingtian

It seems we need echo -1 to set_ftrace_pid to disable in. Or we'll get these error message when running ftrace_stress:

kernel version?

2.6.32-114.0.1.el6.x86_64 , RHEL6.1.

Quoted 7 lines

This is the result from latest kernel:

# echo > set_ftrace_pid
# echo -1 > set_ftrace_pid
bash: echo: write error: Invalid argument

Looks like latest kernel changed the behaviour. But the Documentation/trace/ftrace.txt hasn't been updated:

     yum-updatesd-3111  [003]  1637.254683: lock_hrtimer_base <-hrtimer_try_to_cancel
     yum-updatesd-3111  [003]  1637.254685: fget_light <-do_sys_poll
     yum-updatesd-3111  [003]  1637.254686: pipe_poll <-do_sys_poll
# echo -1 > set_ftrace_pid
# cat trace |head
 # tracer: function
 #
 #           TASK-PID    CPU#    TIMESTAMP  FUNCTION

Thanks.

Quoted 20 lines
Quoted 20 lines

...
ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh: line 39: echo: write error: Invalid argument
...

---
 .../ftrace_stress/ftrace_set_ftrace_pid.sh         |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
testcases/kernel/tracing/ftrace_stress_test/ftrace_stress/ftrace_set_ftrace_pid.sh +1 -1
index 541215c..bd08f04 100755
@@ -36,7 +36,7 @@ for ((; ; ))
 			eval echo $str >> "$TRACING_PATH"/set_ftrace_pid
 		}
 
-		echo > "$TRACING_PATH"/set_ftrace_pid
+		echo -1 > "$TRACING_PATH"/set_ftrace_pid
 	}
 
 	sleep 1
Signature · 16 lines
Han Pingtian
Quality Engineer
hpt @ #kernel-qe
Red Hat, Inc
Freedom ... courage ... Commitment ... ACCOUNTABILITY

------------------------------------------------------------------------------
Index, Search & Analyze Logs and other IT data in Real-Time with Splunk 
Collect, index and harness all the fast moving IT data generated by your 
applications, servers and devices whether physical, virtual or in the cloud.
Deliver compliance at lower cost and gain new business insights. 
Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list
#4 lore raw
Quoted 9 lines · Han Pingtian
Quoted 6 lines · Li Zefan
Quoted 3 lines · Han Pingtian

It seems we need echo -1 to set_ftrace_pid to disable in. Or we'll get these error message when running ftrace_stress:

kernel version?

2.6.32-114.0.1.el6.x86_64 , RHEL6.1.

Quoted 1 line
Quoted 7 lines
Quoted 6 lines

This is the result from latest kernel:

# echo > set_ftrace_pid
# echo -1 > set_ftrace_pid
bash: echo: write error: Invalid argument

Looks like latest kernel changed the behaviour. But the

The change came from commit 756d17ee7ee4fbc8238bdf97100af63e6ac441ef

So we have to check the kernel version, or try both "echo > ..." and "echo -1 > ...".

Quoted 10 lines

Documentation/trace/ftrace.txt hasn't been updated:

     yum-updatesd-3111  [003]  1637.254683: lock_hrtimer_base <-hrtimer_try_to_cancel
     yum-updatesd-3111  [003]  1637.254685: fget_light <-do_sys_poll
     yum-updatesd-3111  [003]  1637.254686: pipe_poll <-do_sys_poll
# echo -1 > set_ftrace_pid
# cat trace |head
 # tracer: function
 #
 #           TASK-PID    CPU#    TIMESTAMP  FUNCTION

------------------------------------------------------------------------------
Index, Search & Analyze Logs and other IT data in Real-Time with Splunk Collect, index and harness all the fast moving IT data generated by your applications, servers and devices whether physical, virtual or in the cloud. Deliver compliance at lower cost and gain new business insights. Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#5 lore raw
Quoted 16 lines · Li Zefan
Quoted 15 lines · Han Pingtian
Quoted 6 lines · Li Zefan
Quoted 3 lines · Han Pingtian

It seems we need echo -1 to set_ftrace_pid to disable in. Or we'll get these error message when running ftrace_stress:

kernel version?

2.6.32-114.0.1.el6.x86_64 , RHEL6.1.

Quoted 7 lines

This is the result from latest kernel:

# echo > set_ftrace_pid
# echo -1 > set_ftrace_pid
bash: echo: write error: Invalid argument
Quoted 6 lines
Quoted 1 line

Looks like latest kernel changed the behaviour. But the

The change came from commit 756d17ee7ee4fbc8238bdf97100af63e6ac441ef

So we have to check the kernel version, or try both "echo > ..." and "echo -1 > ...".

I believe the second method is better.

Quoted 11 lines
Quoted 11 lines

Documentation/trace/ftrace.txt hasn't been updated:

     yum-updatesd-3111  [003]  1637.254683: lock_hrtimer_base <-hrtimer_try_to_cancel
     yum-updatesd-3111  [003]  1637.254685: fget_light <-do_sys_poll
     yum-updatesd-3111  [003]  1637.254686: pipe_poll <-do_sys_poll
# echo -1 > set_ftrace_pid
# cat trace |head
 # tracer: function
 #
 #           TASK-PID    CPU#    TIMESTAMP  FUNCTION
Signature · 16 lines
Han Pingtian
Quality Engineer
hpt @ #kernel-qe
Red Hat, Inc
Freedom ... courage ... Commitment ... ACCOUNTABILITY

------------------------------------------------------------------------------
Index, Search & Analyze Logs and other IT data in Real-Time with Splunk 
Collect, index and harness all the fast moving IT data generated by your 
applications, servers and devices whether physical, virtual or in the cloud.
Deliver compliance at lower cost and gain new business insights. 
Free Software Download: http://p.sf.net/sfu/splunk-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list