[ltt-dev] trace-clock-userspace.patch for ARM/PowerPC ?

Abbas Raza abbas_raza at mentor.com
Thu Jul 28 11:54:06 EDT 2011


On 07/26/2011 11:02 PM, Mathieu Desnoyers wrote:
> * Abbas Raza (abbas_raza at mentor.com) wrote:
>> On 07/26/2011 10:17 PM, Mathieu Desnoyers wrote:
>>> * Abbas Raza (abbas_raza at mentor.com) wrote:
>>> [...]
>>>> Hi Mathieu,
>>>>
>>>> Some confusion here :(
>>>>
>>>> In case of LTTng 0.x, when we take kernel traces then timestamps for
>>>> these traces is based on TSC/TB . So after that we view these traces by
>>>> lttv and it shows timestamps with all events which occurred.
>>>> I print the timestamp in kernel ltt function 'ltt_trace_alloc()'  and it
>>>> comes out to be 22944596907 (by calling trace_clock_read64() ). While
>>>> lttv show Birth sec of first event to 367 second. How this conversion is
>>>> made from TSC to the Birth sec/nsec value displayed in lttv? just want
>>>> to confirm that whether timestamps shown in lttv (Birth sec/nsec) are
>>>> based on TSC values... if yes then how TSC values are converted to Birth
>>>> sec/nsec and i no then from where lttv gets timestamps to be displayed?
>>>> Or in simple words, do kernel traces which we get contain timestamps
>>>> based simply on TSC values or it is something else?
>>> Yes, we write, in the lttng 0.x headers, the following information:
>>>
>>> struct ltt_subbuffer_header {
>>>    [...]
>>>           uint64_t start_freq;            /*
>>>                                            * Frequency at trace start,
>>>                                            * used all along the trace.
>>>                                            */
>>>           uint32_t freq_scale;            /* Frequency scaling (divisor) */
>>> [...]
>>> }
>>>
>>> so by using the start frequency and the scale, we can convert from TSC
>>> values to nanoseconds. Please note that LTTng 0.x requires the clock
>>> source to appear as if it has a constant rate.
>>>
>>> These values map to trace_clock_frequency() and trace_clock_freq_scale()
>>> trace clock functions.
>>>
>>> Best regards,
>>>
>>> Mathieu
>>>
>>>> Thanks a lot again for help :)
>>>>
>>>>
>>>> Abbas Raza
>>>>
>> Just to confirm that TSC's just have raw values of clock cycles and lttv
>> converts these values into sec/nsec by reading ltt_subbuffer_header ?
> Yes, that's it.
>
> Thanks,
>
> Mathieu
>
>>
>> Thanks!
>>
>> Abbas Raza
>>

Hello Mathieu,

Just wanted to ask that trace clock userspace patch for x86 adds 
functionality to register posix clocks like

register_posix_clock(CLOCK_TRACE, &clock_trace);
register_posix_clock(CLOCK_TRACE_FREQ, &clock_trace_freq);

What we understood is that these clocks are registered to provide system 
call functionality for CLOCK_TRACE and CLOCK_TRACE_FREQ clocks just like 
other posix clocks. Right?

And same we will have to do for powerpc (even if we have got vdso 
functionality for these clocks)?

Thanks !

--
Abbas Raza




More information about the lttng-dev mailing list