From: desire <yuwang.yu@huawei.com>
To: <a.p.zijlstra@chello.nl>, <paulus@samba.org>, <mingo@redhat.com>,
<acme@kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <yuwang.yu@huawei.com>
Subject: [PATCH] perf record: Fix zomible status of child process
Date: Sat, 3 Jan 1970 11:54:47 +0700 [thread overview]
Message-ID: <190487-3155-1-git-send-email-yuwang.yu@huawei.com> (raw)
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
next reply other threads:[~2015-05-14 1:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
1970-01-03 4:54 desire [this message]
-- strict thread matches above, loose matches on Subject: below --
1970-01-03 4:54 [PATCH] perf record: Fix zomible status of child process desire
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=190487-3155-1-git-send-email-yuwang.yu@huawei.com \
--to=yuwang.yu@huawei.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=paulus@samba.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).