Mirror of the lttng-dev mailing list
 help / color / mirror / Atom feed
From: mathieu.desnoyers@efficios.com (Mathieu Desnoyers)
Subject: [lttng-dev] timestamp inconsistence between ‘lttng view’ and 'kernel log'
Date: Wed, 10 Aug 2016 21:32:32 +0000 (UTC)	[thread overview]
Message-ID: <681153539.7831.1470864752258.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <CAHhAz+htGUBOG8evME3K6uNfjqSA4atDHrfKXeJXBUYkKdJ1uQ@mail.gmail.com>

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 1892 bytes --]

----- On Aug 3, 2016, at 6:56 AM, Muni Sekhar munisekharrms at gmail.com wrote:

> [ Please keep me in CC as I'm not subscribed to the list]
> 
> 
> Hello,
> 
> First time I am using lttng to trace the kernel events.
> 
> I noticed the timestamp inconsistence between ‘lttng view’  and 'kernel log'.
> 
> Can it be possible to have the kernel log timestamp in lttng log?
> 
> 
> 
> Few lines of “lttng view” log is mentioned below:
> 
> [15:27:30.632837075] (+0.000002514) testbox  syscall_entry_open: {
> cpu_id = 1 }, { filename = "/home/muni/v2.4/tests/debugtrans.so",
> flags = 0, mode = 438 }
> 
> [15:27:30.632842383] (+0.000002235) testbox  syscall_entry_open: {
> cpu_id = 1 }, { filename =
> "/home/muni/v2.4/tests/debugtransmodule.so", flags = 0, mode = 438 }
> 
> 
> 
> 
> Corresponding Kernel log is mentioned below:
> 
> Aug  3 15:27:30 testbox  kernel: [15117.050326] Entry debug_open
> 
> Aug  3 15:27:30 testbox  kernel: [15117.050326]
> 
> Aug  3 15:27:30 testbox  kernel: [15117.050333] Exit debug_open
> 

There is a way, but it's not straightforward. Basically, the kernel
uses the scheduler clock (local_clock) in dmesg. LTTng uses the
monotonic clock (corrected for small rate variations), and offsets
it by the delta between realtime and monotonic clock at trace start.

The difference between the sched clock and the monotonic clock makes it
non-trivial to correlate the two.

One trick you can use is to enable the printk_console LTTng kernel event.
This way, you will see the dmesg console messages with their timestamps in
the lttng trace, allowing you to correlate the two.

Best regards,

Mathieu


> 
> --
> Thanks,
> Sekhar
> _______________________________________________
> lttng-dev mailing list
> lttng-dev at lists.lttng.org
> https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com


      reply	other threads:[~2016-08-10 21:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-03 10:56 Muni Sekhar
2016-08-10 21:32 ` Mathieu Desnoyers [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=681153539.7831.1470864752258.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.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