Re: [PATCH 3/6] perf: Add timestamp to COMM and MMAP events

From: Peter Zijlstra
Date: Tue Nov 23 2010 - 06:08:26 EST


On Tue, 2010-11-23 at 16:35 +1100, Ian Munsie wrote:
> From: Ian Munsie <imunsie@xxxxxxxxxxx>
>
> This patch adds extra ABI to the perf interface to allow the
> PERF_RECORD_COMM and PERF_RECORD_MMAP events to optionally include a
> timestamp, which they were previously missing.
>
> This has become necessary since the move to per-task-per-cpu events in
> perf as those events would not necessarily be recorded prior to any
> samples associated with them and would cause perf to miss-attribute
> those events and produce bogus reports. This behaviour can be observed
> almost every run on 64 CPU PowerPC systems, but has also been observed
> on a simple quad core Intel i7.
>
> The timestamp is requested by setting the all_timed flag in the
> event attributes when opening the event and will be placed just after
> the header of the events in question.
>
> This patch also ensures that the PERF_RECORD_COMM event is dispatched
> before enabling the counters for enable_on_exec.
>

> @@ -332,6 +333,7 @@ enum perf_event_type {
> *
> * struct {
> * struct perf_event_header header;
> + * { u64 time; } && all_timed
> *
> * u32 pid, tid;
> * u64 addr;
> @@ -354,6 +356,7 @@ enum perf_event_type {
> /*
> * struct {
> * struct perf_event_header header;
> + * { u64 time; } && all_timed
> *
> * u32 pid, tid;
> * char comm[];


Right, so acme had a patch adding

PERF_SAMPLE_TID
PERF_SAMPLE_TIME
PERF_SAMPLE_ID
PERF_SAMPLE_CPU
PERF_SAMPLE_STREAM_ID

(IIRC) to every record.. so solve this same problem. Except he got
interrupted by KS and things and didn't get around to posting it.

Arnaldo?
--
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/