New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
improve timestamp resolution #55
Comments
Hi Brendan, what kernel are you doing this on. Its not so much as this function is a You are right that getnstimeofday() grabs a lock, so it requires unwrapping thanks On 23 May 2013 01:40, Brendan Gregg notifications@github.com wrote:
|
I've pushed out a new release which - not using your change - but comes in The issue is that on the later kernels, we run without access to the On 25 May 2013 16:37, Paul Fox paul.d.fox@gmail.com wrote:
|
Thanks; I just built it on 3.5, and this looks the same (no sub-millisecond resolution):
|
This is also in a VM (could make a difference in how TSC is made available). |
I'm experimenting with different mechanisms to get to the TSC clock. If you Let me try a few things and get back to you. thanks On 28 May 2013 17:37, Brendan Gregg notifications@github.com wrote:
|
Ok - new release with the "fix". It works on my 3.4.6 kernel by going for ns On 28 May 2013 22:54, Paul Fox paul.d.fox@gmail.com wrote:
|
Excellent, thanks - works for me!
|
The timestamp variable returns time with a ~10 ms granularity (based on xtime cache). For performance analysis it needs much better resolution.
This looks like it is due to dtrace_gethrtime() in driver/dtrace_linux.c, which looks like a work in progress.
As a workaround, I've been making the following change:
WARNING: getnstimeofday() grabs seqlock. I don't know if this is safe to do in DTrace context - I'd assume it isn't until known otherwise. Generally, grabbing locks in DTrace context is unsafe (blocking while interrupts disabled), however, the characteristics of seqlock sound similar to the behavior of the Solaris dtrace_gethrtime(), so this might be ok.
As some example output with the above change, showing the resolution is satisfactory:
The text was updated successfully, but these errors were encountered: