Re: [PATCH 2/4] perf events: Make sample_type identity fields available in all PERF_RECORD_ events

From: Ian Munsie
Date: Fri Dec 03 2010 - 00:45:25 EST


> /*
> + * If perf_event_attr.sample_id_all is set then all event types will
> + * have the sample_type selected fields related to where/when
> + * (identity) an event took place (TID, TIME, ID, CPU, STREAM_ID)
> + * described in PERF_RECORD_SAMPLE below, it will be stashed just after
> + * the perf_event_header and the fields already present for the existing
> + * fields, i.e. at the end of the payload. That way a newer perf.data
> + * file will be supported by older perf tools, with these new optional
> + * fields being ignored.

I'd put a comment in each event to be clear, but this is fine too.

> @@ -3944,8 +3988,15 @@ static void perf_event_comm_output(struct perf_event *event,
> struct perf_comm_event *comm_event)
> {
> struct perf_output_handle handle;
> + struct perf_sample_data sample;
> int size = comm_event->event_id.header.size;
> - int ret = perf_output_begin(&handle, event, size, 0, 0);
> + int ret;

How about:

- int size = comm_event->event_id.header.size;
- int ret = perf_output_begin(&handle, event, size, 0, 0);
+ int size, ret;

Like you did for perf_event_mmap_output?


Other than that:

Acked-by: Ian Munsie <imunsie@xxxxxxxxxxx>
--
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/