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: Problems with gettimeofday_ns()


On Feb 21, 2008, at 15:10 , Masami Hiramatsu wrote:

Hello,

Julio M. Merino Vidal wrote:
But the big problem is that sometimes I receive events in the
incorrect order!  That is, I place a marker B after a marker A in the
code, and I know it is impossible for B to appear before A in a
trace.  However, sometimes, I get B before A in the final trace with
the timings (supposedly) reversed.  I also print the CPU that fired
the events, and both are happening from the same virtual CPU, so the
possibility of both CPUs using different timings is not relevant.

Indeed. The systemtap's gettimeofday_*() tries to adjust base-time (this means, change the base-time forward and backward) periodically. It is for synchronizing trace logs with in-kernel logs(dmesg, etc). We are discussing about this on bz3916, http://sources.redhat.com/bugzilla/show_bug.cgi?id=3916

If I change the gettimeofday_ns call to get_cycles or to a custom
counter instead, things go perfectly.

Sure, I think it is the best way to get the monotonic counter on some processors.

OK, thanks for the explanations.


Now I am finding another issue slightly related to this. I have just added a new marker to the code in an interrupt context, and this interrupt wakes up a specific thread to handle it later on. The problem is that, if the interrupt is handled on one CPU and the thread, once awaken, is handled by the other one, I can still get the timestamps (cycles) reversed. Any easy way around this?

Thank you.


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