Re: [PATCH v4 3/3] perf: Sample additional clock value

From: David Ahern
Date: Fri Jan 23 2015 - 13:05:50 EST


On 1/23/15 10:06 AM, Pawel Moll wrote:
As far as I understand (John?) POSIX timers can be used on any clockid?
So it would be possible to obtain a dynamic clock id, for example for my
exotic trace hardware (by any means necessary, like opening a char
device) and create a timer firing every 1 ms (in the trace time domain).
Than this event would be somehow associated with a perf session (for
example, by passing the timerid via perf's ioctl) and then, every when
timer fires, a perf record (something like PERF_RECORD_TIMER?)
containing the timer/clock's value*and* the normal perf timestamp,
would be injected into the circular buffer.

Like this: https://lkml.org/lkml/2011/2/27/158 ? note the date -- 4 years ago. This is has been dragging on for a long time.

A few problems with that approach:
1. I would like to see a sample generated immediately to get the perf_clock -> timeofday correlation immediately rather than have to wait N (milli)seconds and have perf scan forward through an M-(giga)byte file looking for the one sample that gives the correlation.

I tried to address that problem with an ioctl to force a sample into the stream:
https://lkml.org/lkml/2011/2/27/159
it did not go over very well.

2. there is a risk that the realtime samples dominate a stream.

Another issue that has been raised is updates to xtime by ntp / user. I have suggested tracepoints to catch those:
https://lkml.org/lkml/2011/6/7/636
I don't believe there were ever any comments on the tracepoints.

David
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/