linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Ahern <dsahern@gmail.com>
To: Peipei Wang <wangpeipei.90@gmail.com>
Cc: Andi Kleen <andi@firstfloor.org>,
	perf group <linux-perf-users@vger.kernel.org>
Subject: Re: How can I get timestamps of samples in perf
Date: Sat, 10 Aug 2013 11:01:30 -0400	[thread overview]
Message-ID: <520655CA.1020504@gmail.com> (raw)
In-Reply-To: <CAEuYUeo9KnMpfU2s9cqvNJG5dY+4925rMpcEK-AhjoaNNcU_XA@mail.gmail.com>

On 8/10/13 10:34 AM, Peipei Wang wrote:
> I get it.  Is the timestamp for wall-clock or not???    What is the
> counting unit of timestamp?  Seconds??

It is a "perf_clock" timestamp in seconds.micro-seconds. On x86 the 
timestamp is related to the TSC -- usually.

I have been on a 2-1/2 year mission and counting to get time-of-day 
correlations into perf. e.g., see 
https://github.com/dsahern/linux/tree/perf-time-of-day-3.8.

That branch has a kernel side change to add an ioctl to pull the 
perf_clock timestamp into userspace. It does not include tracepoints to 
catch ntpd updates for example.

David

>
>           swapper     0 [000] 1591103.081337: instructions:          c1022ae6 int
>           swapper     0 [000] 1591103.081341: instructions:          c1022ae6 int
>           swapper     0 [000] 1591103.081343: instructions:          c1022ae6 int
>           swapper     0 [000] 1591103.081345: instructions:          c1022ae6 int
>           swapper     0 [000] 1591103.081348: instructions:          c1036a26 __t
>           swapper     0 [000] 1591103.081353: cycles:          c1035e68 native_wr
>           swapper     0 [000] 1591103.081355: cycles:          c1035e68 native_wr
>           swapper     0 [000] 1591103.081357: cycles:          c1035e68 native_wr
>           swapper     0 [000] 1591103.081359: cycles:          c1035e68 native_wr
>           swapper     0 [000] 1591103.081362: cycles:          c101909c mwait_id
>

      reply	other threads:[~2013-08-10 15:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-10  2:35 How can I get timestamps of samples in perf Peipei Wang
2013-08-10  4:43 ` Andi Kleen
2013-08-10 14:34   ` Peipei Wang
2013-08-10 15:01     ` David Ahern [this message]

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=520655CA.1020504@gmail.com \
    --to=dsahern@gmail.com \
    --cc=andi@firstfloor.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=wangpeipei.90@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 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).