Re: [PATCH v2 1/5] perf/core: add PERF_RECORD_SAMPLE_SKID_IP record type

From: Peter Zijlstra
Date: Thu Nov 02 2017 - 14:59:57 EST


On Thu, Nov 02, 2017 at 11:15:55AM -0700, Stephane Eranian wrote:

> diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
> index 874b71a70058..772530501025 100644
> --- a/include/linux/perf_event.h
> +++ b/include/linux/perf_event.h
> @@ -917,6 +917,7 @@ struct perf_sample_data {
> u64 stack_user_size;
>
> u64 phys_addr;
> + u64 skid_ip;
> } ____cacheline_aligned;
>
> /* default value for data source */
> @@ -937,6 +938,7 @@ static inline void perf_sample_data_init(struct perf_sample_data *data,
> data->weight = 0;
> data->data_src.val = PERF_MEM_NA;
> data->txn = 0;
> + data->skid_ip = 0; /* mark as uinitialized */
> }

I keep forgetting to write the comment explaining how this function only
touches a single cacheline; you just wrecked that :/