Messages in this thread Patch in this message | | | From | Andi Kleen <> | Subject | [PATCH 4/4] perf: Fix the default data source | Date | Thu, 7 Aug 2014 17:15:41 -0700 |
| |
From: Stephane Eranian <eranian@google.com>
- the default of 0 for the data source in perf_sample_data_init() was wrong. 0 is not a valid value. So defined PERF_MEM_NA (not available)
Signed-off-by: Stephane Eranian <eranian@google.com> Signed-off-by: Andi Kleen <ak@linux.intel.com> --- include/linux/perf_event.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h index 707617a..8b206aa 100644 --- a/include/linux/perf_event.h +++ b/include/linux/perf_event.h @@ -604,6 +604,13 @@ struct perf_sample_data { u64 txn; }; +/* default value for data source */ +#define PERF_MEM_NA (PERF_MEM_S(OP, NA) |\ + PERF_MEM_S(LVL, NA) |\ + PERF_MEM_S(SNOOP, NA) |\ + PERF_MEM_S(LOCK, NA) |\ + PERF_MEM_S(TLB, NA)) + static inline void perf_sample_data_init(struct perf_sample_data *data, u64 addr, u64 period) { @@ -616,7 +623,7 @@ static inline void perf_sample_data_init(struct perf_sample_data *data, data->regs_user.regs = NULL; data->stack_user_size = 0; data->weight = 0; - data->data_src.val = 0; + data->data_src.val = PERF_MEM_NA; data->txn = 0; } -- 1.9.3
| |