Skip to content

Commit

Permalink
ftracetest: Use proper logic to find process PID
Browse files Browse the repository at this point in the history
Half of the test in instance-event.tc was updated to use $! to find the PID
of the previous background process that was launched, but the second part of
the test still used the parsing of "jobs", which does not work on all shells
like $! does.

Signed-off-by: Steven Rostedt <[email protected]>
  • Loading branch information
rostedt committed May 23, 2016
1 parent 8329e81 commit 97f8827
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions tools/testing/selftests/ftrace/test.d/instances/instance-event.tc
Original file line number Diff line number Diff line change
Expand Up @@ -92,28 +92,23 @@ instance_slam() {
}

instance_slam &
x=`jobs -l`
p1=`echo $x | cut -d' ' -f2`
p1=$!
echo $p1

instance_slam &
x=`jobs -l | tail -1`
p2=`echo $x | cut -d' ' -f2`
p2=$!
echo $p2

instance_slam &
x=`jobs -l | tail -1`
p3=`echo $x | cut -d' ' -f2`
p3=$!
echo $p3

instance_slam &
x=`jobs -l | tail -1`
p4=`echo $x | cut -d' ' -f2`
p4=$!
echo $p4

instance_slam &
x=`jobs -l | tail -1`
p5=`echo $x | cut -d' ' -f2`
p5=$!
echo $p5

ls -lR >/dev/null
Expand Down

0 comments on commit 97f8827

Please sign in to comment.