From: David Ahern <daahern@cisco.com>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: linux-perf-users@vger.kernel.org,
LKML <linux-kernel@vger.kernel.org>,
acme@ghostprotocols.net, Ingo Molnar <mingo@elte.hu>,
Peter Zijlstra <peterz@infradead.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Paul Mackerras <paulus@samba.org>,
John Stultz <johnstul@us.ibm.com>
Subject: Re: [PATCH 3/6] perf record: add time-of-day option
Date: Wed, 02 Mar 2011 07:28:35 -0700 [thread overview]
Message-ID: <4D6E5413.6060500@cisco.com> (raw)
In-Reply-To: <alpine.LFD.2.00.1103012359460.2701@localhost6.localdomain6>
On 03/02/2011 07:16 AM, Thomas Gleixner wrote:
> On Sun, 27 Feb 2011, David Ahern wrote:
>
>> Enable data collection for generating time-of-day strings when
>> printing individual perf samples. This is done by sampling the
>> realtime clock event with the perf_clock time stamps.
>>
>> If the realtime-clock event is not available (e.g, older kernels)
>> fallback to a synthesized event. (I realize there is resistance
>> to new synthesized events, but it is a simple way to gain this
>> feature on older kernels without the need to modify the kernel
>> code).
>
> ...
>
>> +/* add a sample to the event stream based on user request */
>> +static int perf_event_generate_sample(struct perf_event *event)
>> +{
>> + struct perf_sample_data data;
>> + struct pt_regs regs;
>> +
>> + perf_fetch_caller_regs(®s);
>> + event->pmu->read(event);
>> + perf_sample_data_init(&data, 0);
>> + data.period = event->hw.last_period;
>> + perf_event_output(event, 0, &data, ®s);
>> +
>> + return 0;
>> +}
>
> Errm. This is a generic ioctl to inject random events from user space.
>
> First of all this wants to be a separate patch and not burried into
> some 100 lines of changes to tools/perf.
>
> Secondly adding such an ioctl needs a pretty good reason, and the use
> case at hand is not really one.
Peter has made it clear he objects to the ioctl.
>
> Reading through the other patches, your goal is to correlate
> CLOCK_REALTIME based logs to CLOCK_PERF based events.
>
> To achieve that you inject cyclic clock_realtime samples into the
> event stream and want to have this initial event inserted via the
> ioctl.
I still need a solution. There is no means for requesting a sample
immediately when a counter is opened, and there is a desire not to add
any more synthesized events. How then do I get the initial correlation
without scanning a potentially large file looking for a single event
type occurrence.
>
> How does all that deal with CLOCK_REALTIME being affected by NTP and
> settimeofday? Not really, as far as I can tell. It somehow works, but
> that depends on the frequency of your event injection.
It is sampled at some periodic rate to get NTP changes. Right now it is
hardcoded at once an hour. The frequency option can be added to the
--tod parameter.
>
> To be honest, that's just too much churn for a feature which is single
> purpose and questionable functionality.
>
> It would be far more interesting to have trace points in the
> timekeeping code, which are useful for other things as well
> (e.g. precise monitoring of NTP) and provide always a correct
> association with the trace clock. That would cover everything from
> frequency adjustments, clock setting including the information about
> the relation to clock monotonic.
I'm not looking to track ntp changes. I want time-of-day strings on
sample dumps. That is not a questionable feature request; it is a
usability enhancement.
We are users of perf. Fantastic tool, but of limited functionality to
the engineers on the team if they cannot correlate event samples with
application logs.
David
>
> Thanks,
>
> tglx
next prev parent reply other threads:[~2011-03-02 14:28 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-02-28 3:52 [PATCH 0/6 v3] perf events: Add realtime clock event, time-of-day strings to script output David Ahern
2011-02-28 3:52 ` [PATCH 1/6] perf events: Introduce realtime clock event David Ahern
2011-02-28 3:52 ` [PATCH 2/6] perf events: plumbing for PERF_SAMPLE_READ and read_format David Ahern
2011-02-28 3:52 ` [PATCH 3/6] perf record: add time-of-day option David Ahern
2011-03-01 14:29 ` Peter Zijlstra
2011-03-01 14:35 ` David Ahern
2011-03-01 15:35 ` Peter Zijlstra
2011-03-01 15:41 ` David Ahern
2011-03-01 16:00 ` Peter Zijlstra
2011-03-01 16:09 ` David Ahern
2011-03-01 16:37 ` Peter Zijlstra
2011-03-01 16:45 ` David Ahern
2011-03-01 17:07 ` Arnaldo Carvalho de Melo
2011-03-01 17:09 ` Arnaldo Carvalho de Melo
2011-03-01 22:28 ` Peter Zijlstra
2011-03-01 22:35 ` David Ahern
2011-03-02 14:16 ` Thomas Gleixner
2011-03-02 14:28 ` David Ahern [this message]
2011-03-02 17:28 ` Thomas Gleixner
2011-03-03 14:29 ` David Ahern
2011-03-03 8:51 ` Ingo Molnar
2011-03-03 14:33 ` David Ahern
2011-02-28 3:52 ` [PATCH 4/6] perf script: dump software events too David Ahern
2011-03-01 14:09 ` Frederic Weisbecker
2011-03-01 14:18 ` David Ahern
2011-03-01 15:11 ` Frederic Weisbecker
2011-03-01 16:11 ` David Ahern
2011-03-01 16:24 ` Frederic Weisbecker
2011-03-01 16:49 ` Arnaldo Carvalho de Melo
2011-02-28 3:52 ` [PATCH 5/6] perf script: Prepend lines with time-of-day string David Ahern
2011-02-28 3:52 ` [PATCH 6/6] perf stat: treat realtime-clock as nsec counter David Ahern
2011-02-28 3:55 ` [PATCH 0/6 v3] perf events: Add realtime clock event, time-of-day strings to script output David Ahern
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=4D6E5413.6060500@cisco.com \
--to=daahern@cisco.com \
--cc=acme@ghostprotocols.net \
--cc=fweisbec@gmail.com \
--cc=johnstul@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
/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).