public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* Re: _stp_gettimeofday_ns(void) in stp VS ktime_get_real() in Kernel
       [not found] <9f49f7820912131824p5f6589f5n85f32889577cd067@mail.gmail.com>
@ 2009-12-14  2:35 ` Frank Ch. Eigler
  0 siblings, 0 replies; only message in thread
From: Frank Ch. Eigler @ 2009-12-14  2:35 UTC (permalink / raw)
  To: 曾珊; +Cc: systemtap

Hi -

>    I am now using the following script to compute the executing of the
> netif_receive_skb funcion: [...]
> and the result is some thing like :
>  0 qemu-system-x86(3822):->netif_receive_skb
> 4373 qemu-system-x86(3822):<-netif_receive_skb
> 
> *Question 1:
> *Can I use 4373 which is 0 subtract from 4373 to describe the executing time
> of the function netif_receive_skb?*

Yes, that is the intent.

> **Question 2:*
> since the way in which thread_indent function to get the time is through
> _stp_gettimeofday_ns(void)  function and in kernel skb->tstamp is set by
> the function ktime_get_real() , my question is whether the principles of the
> two are the same? or whether they are comparable?

High-precision timing is a complicated subject.  Different generations
of kernels have a variety of different time measurement widgets,
useful in only certain contexts each.  The systemtap runtime has had to
have a separate get_cycles()-based estimator that it can use in atomic
contexts.  They are not directly comparable.

However, you can calibrate the measurements for your own purposes,
calling a variety of time sources (get_cycles(), gettimeofday_*, 
$skb->tstamp, your own embedded-c functions to fetch ktime_get_real()),
and see to what extent they all "line up".

- FChE

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-14  2:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <9f49f7820912131824p5f6589f5n85f32889577cd067@mail.gmail.com>
2009-12-14  2:35 ` _stp_gettimeofday_ns(void) in stp VS ktime_get_real() in Kernel Frank Ch. Eigler

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 read-only IMAP folder(s) and NNTP newsgroup(s).