From: Arnaldo Carvalho de Melo <acme@infradead.org>
To: Kirill Smelkov <kirr@mns.spb.ru>
Cc: linux-kernel@vger.kernel.org,
Frederic Weisbecker <fweisbec@gmail.com>,
Ingo Molnar <mingo@elte.hu>, Mike Galbraith <efault@gmx.de>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <peterz@infradead.org>,
Stephane Eranian <eranian@google.com>,
Tom Zanussi <tzanussi@gmail.com>
Subject: Re: Q: perf log mode?
Date: Wed, 12 Jan 2011 13:21:12 -0200 [thread overview]
Message-ID: <20110112152112.GE11968@ghostprotocols.net> (raw)
In-Reply-To: <20110112140613.GA11698@tugrik.mns.mnsspb.ru>
Em Wed, Jan 12, 2011 at 05:06:13PM +0300, Kirill Smelkov escreveu:
> I'm trying to use perf together with e.g. kprobes as a tool to show what
> is happening with my system in "live-log" mode. The problem is, for
> seldom events, actual info output is largely delayed because perf reads
> sample data in whole pages. Could something be done with it or am I'm
> missing something? Here is detailed description:
<SNIP>
>
> Judging from timestamps, the events were coming with 1-2 seconds period
> (ping <host> running) and for e.g. first event we got 96-43=53 seconds
> delay (which is happening already at `perf record` stage -- I've
> monitored it's raw output).
>
> Is it somehow possible to display events instantly as they are coming?
Look at how perf top works:
while (1) {
int hits = samples;
perf_session__mmap_read(session);
if (hits == samples)
ret = poll(evsel_list->pollfd, evsel_list->nr_fds, 100);
}
It will only call poll if no events were found so there should be no
delays.
perf script instead uses perf_session__process_events() and that, as
requested by 'perf script' queues events to make sure they are ordered,
so probably the problem is related to this latency, probably we'll need
to use some timer to flush this queue more often.
Try tweaking:
.ordering_requires_timestamps = true,
.ordered_samples = true,
in builtin-script.c, if you disable those there should be no queueing
and we'll test this theory.
Also try checking if there isn't any buffering in action because it uses
pipes to connect the record with the python script by printing the event
as it comes in the record part.
- Arnaldo
next prev parent reply other threads:[~2011-01-12 15:21 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-12 14:06 Q: perf log mode? Kirill Smelkov
2011-01-12 14:08 ` Peter Zijlstra
2011-01-12 14:42 ` Frederic Weisbecker
2011-01-12 14:53 ` Peter Zijlstra
2011-01-12 15:10 ` Frederic Weisbecker
2011-01-12 14:59 ` Kirill Smelkov
2011-01-12 15:02 ` Peter Zijlstra
2011-01-12 16:30 ` Arnaldo Carvalho de Melo
2011-01-13 8:26 ` Kirill Smelkov
2011-01-12 15:21 ` Arnaldo Carvalho de Melo [this message]
2011-01-12 16:31 ` Kirill Smelkov
2011-01-12 17:07 ` Arnaldo Carvalho de Melo
2011-01-14 7:25 ` [tip:perf/urgent] perf record: Add "nodelay" mode, disabled by default tip-bot for Kirill Smelkov
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=20110112152112.GE11968@ghostprotocols.net \
--to=acme@infradead.org \
--cc=efault@gmx.de \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=kirr@mns.spb.ru \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=tzanussi@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.