From: Ingo Molnar <mingo@elte.hu>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: LKML <linux-kernel@vger.kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Mike Galbraith <efault@gmx.de>, Paul Mackerras <paulus@samba.org>,
Corey Ashford <cjashfor@linux.vnet.ibm.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: Re: [PATCH] perfcounter: sleep before refresh using poll in perf top
Date: Thu, 4 Jun 2009 21:47:25 +0200 [thread overview]
Message-ID: <20090604194725.GB24606@elte.hu> (raw)
In-Reply-To: <1244141284-7507-1-git-send-email-fweisbec@gmail.com>
* Frederic Weisbecker <fweisbec@gmail.com> wrote:
> perf top is refreshed every delay_secs the thread runs in such
> loop:
>
> while (sleep(delay_secs)) {
> print_sym_table();
> }
>
> At the end of print_sym_table(), poll is used without sleep delay
> to check if we have something from stdin.
>
> It means that this check is done only every delay_secs, which can
> be higher that 2 secs if the user defined a custom refresh rate.
>
> We can drop sleep() here and directly use poll to wait between
> refresh periods, so that the reaction after the user stops perf top
> after typing "Enter" is immediate and doesn't suffer from the
> delay_secs latency.
>
> Nb: poll doesn't add any overhead that can parasite perf top measures
> since it sleeps the entire timeout here.
>
> Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> ---
> Documentation/perf_counter/builtin-top.c | 18 ++++++++----------
> 1 files changed, 8 insertions(+), 10 deletions(-)
Applied, thanks a lot Frederic!
Ingo
next prev parent reply other threads:[~2009-06-04 19:47 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-04 18:48 Frederic Weisbecker
2009-06-04 19:47 ` Ingo Molnar [this message]
2009-06-04 19:54 ` [tip:perfcounters/core] perf_counter: Sleep " tip-bot for Frederic Weisbecker
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=20090604194725.GB24606@elte.hu \
--to=mingo@elte.hu \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=cjashfor@linux.vnet.ibm.com \
--cc=efault@gmx.de \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@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
all inboxes | Powered by JetHome®