This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: _stp_gettimeofday_ns(void) in stp VS ktime_get_real() in Kernel


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]