mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] perf record: Fix zomible status of child process
@ 1970-01-03  4:54 desire
  0 siblings, 0 replies; 2+ messages in thread
From: desire @ 1970-01-03  4:54 UTC (permalink / raw)
  To: a.p.zijlstra, paulus, mingo, acme; +Cc: linux-kernel, yuwang.yu

If the child process exited between the following code,
the child process will keep zomible status and perf process
will keep "poll" forever
if (done || draining)
       break;
---//child process exit, done to 1
err = perf_evlist__poll(rec->evlist,-1);
so, change timeout to 1 second.
---
 tools/perf/builtin-record.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index c3efdfb..0b242eb 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -486,7 +486,9 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
 		if (hits == rec->samples) {
 			if (done || draining)
 				break;
-			err = perf_evlist__poll(rec->evlist, -1);
+			do{
+			err = perf_evlist__poll(rec->evlist, 1000);
+			}while((0 == err) && !done);
 			/*
 			 * Propagate error, only if there's any. Ignore positive
 			 * number of returned events and interrupt error.
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH] perf record: Fix zomible status of child process
@ 1970-01-03  4:54 desire
  0 siblings, 0 replies; 2+ messages in thread
From: desire @ 1970-01-03  4:54 UTC (permalink / raw)
  To: a.p.zijlstra, paulus, mingo, acme; +Cc: linux-kernel

If the child process exited between the following code,
the child process will keep zomible status and perf process
will keep "poll" forever
if (done || draining)
       break;
---//child process exit, done to 1
err = perf_evlist__poll(rec->evlist,-1);
so, change timeout to 1 second.
---
 tools/perf/builtin-record.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index c3efdfb..0b242eb 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -486,7 +486,9 @@ static int __cmd_record(struct record *rec, int argc, const char **argv)
 		if (hits == rec->samples) {
 			if (done || draining)
 				break;
-			err = perf_evlist__poll(rec->evlist, -1);
+			do{
+			err = perf_evlist__poll(rec->evlist, 1000);
+			}while((0 == err) && !done);
 			/*
 			 * Propagate error, only if there's any. Ignore positive
 			 * number of returned events and interrupt error.
-- 
1.7.9.5


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2015-05-14  1:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1970-01-03  4:54 [PATCH] perf record: Fix zomible status of child process desire
  -- strict thread matches above, loose matches on Subject: below --
1970-01-03  4:54 desire

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome