On Wed, Apr 3, 2013 at 7:57 PM, John Stultz <john.stultz@xxxxxxxxxx> wrote:Ah. Ok, I didn't realize perfs buffers were directly mmaped. I was thinking perf could do the translation not at NMI time but when the buffer was later read by the application. That helps explain some of the constraints.I'm not sure I follow this. If perf exported data came with CLOCK_MONOTONICThere is no explicit export operation in perf. You record a sample when
timestamps, no correlation would need to be exposed. perf would just have
to do the extra overhead of doing the conversion on export.
the counter overflows and generates an NMI interrupt. In the NMI interrupt
handler, the sample record is written to the sampling buffer. That is when
the timestamp is generated. The sampling buffer is directly accessible to
users via mmap(). The perf tool just dumps the raw sampling buffer into
a file, no sample record is modified or even looked at. The processing
of the samples is done offline (via perf report) and could be done on
another machine. In other words, the perf.data file is self-contained.