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()


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.

> Any idea about why this is happening?  May it be a bug in stap, or am  
> I missing something in the way gettimeofday works?
> 
> Thanks.

Thanks,

-- 
Masami Hiramatsu

Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division

e-mail: mhiramat@redhat.com


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