path: root/tools/testing/selftests/ftrace/test.d/instances/
diff options
authorSteven Rostedt <>2015-12-11 14:36:17 -0500
committerSteven Rostedt <>2016-02-19 12:11:21 -0500
commit9a154c8911e39e32bdbc2cd6c9b08a64e17612aa (patch)
treec48c7dffe2277b2225f27f5fe6c2ddd71ea78b02 /tools/testing/selftests/ftrace/test.d/instances/
parentb33c8ff4431a343561e2319f17c14286f2aa52e2 (diff)
ftracetest: Fix instance test to use proper shell command for pids
The ftracetest instance test used parsing of the "jobs" output to find the pid of the subshell that is executed previously. But this is not portable to all major shells that may run these tests. The proper way to get the pid of the subshell is the shell command "$!". This will return the pid of the previously executed command. Use that instead, otherwise the test does not work in all environments. Link: Reported-by: Michael Ellerman <> Signed-off-by: Steven Rostedt <>
Diffstat (limited to 'tools/testing/selftests/ftrace/test.d/instances/')
1 files changed, 5 insertions, 10 deletions
diff --git a/tools/testing/selftests/ftrace/test.d/instances/ b/tools/testing/selftests/ftrace/test.d/instances/
index 773e276ff90b..1e1abe0ad354 100644
--- a/tools/testing/selftests/ftrace/test.d/instances/
+++ b/tools/testing/selftests/ftrace/test.d/instances/
@@ -39,28 +39,23 @@ instance_slam() {
instance_slam &
-x=`jobs -l`
-p1=`echo $x | cut -d' ' -f2`
echo $p1
instance_slam &
-x=`jobs -l | tail -1`
-p2=`echo $x | cut -d' ' -f2`
echo $p2
instance_slam &
-x=`jobs -l | tail -1`
-p3=`echo $x | cut -d' ' -f2`
echo $p3
instance_slam &
-x=`jobs -l | tail -1`
-p4=`echo $x | cut -d' ' -f2`
echo $p4
instance_slam &
-x=`jobs -l | tail -1`
-p5=`echo $x | cut -d' ' -f2`
echo $p5
ls -lR >/dev/null