* [GIT PULL] ftracetest: Use proper logic to find process PID
@ 2016-05-23 18:20 Steven Rostedt
0 siblings, 0 replies; only message in thread
From: Steven Rostedt @ 2016-05-23 18:20 UTC (permalink / raw)
To: Linus Torvalds; +Cc: LKML, Ingo Molnar, Andrew Morton
Linus,
Reviewing the selftest I recently submitted, I realize that the second part
of it uses my old hack to get the PID of the spawned background tasks,
which doesn't work for all shells, instead of the common use of $!.
Please pull the latest trace-v4.7-3 tree, which can be found at:
git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-v4.7-3
Tag SHA1: 773c674f8cf1e96253bef9889e5e26f0f3e8dcbb
Head SHA1: 97f8827a8c7963756ae7d3ee898675b4667eca73
Steven Rostedt (Red Hat) (1):
ftracetest: Use proper logic to find process PID
----
.../selftests/ftrace/test.d/instances/instance-event.tc | 15 +++++----------
1 file changed, 5 insertions(+), 10 deletions(-)
---------------------------
commit 97f8827a8c7963756ae7d3ee898675b4667eca73
Author: Steven Rostedt (Red Hat) <rostedt@goodmis.org>
Date: Mon May 23 10:04:46 2016 -0400
ftracetest: Use proper logic to find process PID
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 <rostedt@goodmis.org>
diff --git a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc
index 5f2abd03f16b..4c5a061a5b4e 100644
--- a/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc
+++ b/tools/testing/selftests/ftrace/test.d/instances/instance-event.tc
@@ -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
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2016-05-23 18:20 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-05-23 18:20 [GIT PULL] ftracetest: Use proper logic to find process PID Steven Rostedt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®