lkml.org 
[lkml]   [2015]   [May]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] perf record: Fix zomible status of child process
Date
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


\
 
 \ /
  Last update: 2015-05-14 04:21    [W:0.026 / U:0.056 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site