Hi folks,
I don't know whether I have to hack the kernel for this or not, but
figured you lot would know.
I want very accurate timing inside my app. That means, my process will
ask for it's exact age at various times. This age should not include
times when some other process was scheduled, but it should include the
overhead of the timing itself, which gets done by my process. I want it
to be high performance because I'll be doing it very often indeed.
Function-level profiling is not enough because I need the time spent
inside one specific function in particular, but separated out according
to a parameter to that function. (Basically it's a VM that hosts
zillions of tiny scripts and wants to keep perfect accounts about time
used by all of them and that used by the VM itself).
I think that poking about in /proc would be too slow, but I bet the
kernel knows how many jiffies my process has had, and if I could figure
out what time (in usecs) my current slice started I could use the usec
timer to figure out how old this slice is and work out the final answer
that way. Or maybe there's a better strategy. I need it really accurate
and fast though - ideally in processor cycles, but I somehow need to
exclude the times I'm scheduled out.
Any ideas?
Thanks in advance,
Adrian.
BTW - I'll also need interval timers to terminate greedy scripts but
they don't have to be all that accurate.
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive: http://mail.nl.linux.org/kernelnewbies/
FAQ: http://kernelnewbies.org/faq/