I haven't done any specific testing with either approach yet. The goal is to
use this perf timestamp to correlate user level events to hardware
events recorded
by the kernel. I would assume there would be situations where those user events
could be on the critical path, and thus the timestamp operation would have to be
as efficient as possible. The vdso approach would be ideal.
I was more thinking along the lines of runtime environments like Java where
The performance/speed depends on how often is called. I have no idea what
Stephane's use case is but for me it is to correlate perf_clock timestamps
to timeofday. In my perf-based daemon that tracks process schedulings, I
update the correlation every 5-10 minutes.
a JIT compiler is invoked frequently and you need to correlate samples in the
native code with Java source. For that, the JIT compiler has to emit mapping
tables which have to be timestamped as address ranges may be re-used.