aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/perf_event.h
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2022-09-21 15:00:32 -0700
committerPeter Zijlstra <peterz@infradead.org>2022-09-27 22:50:24 +0200
commit838d9bb62d132ec3baf1b5aba2e95ef9a7a9a3cd (patch)
tree1963e0b6ad3557b1d8dc830f77feb5b7cfc8936e /include/linux/perf_event.h
parentperf: Use sample_flags for addr (diff)
downloadlinux-dev-838d9bb62d132ec3baf1b5aba2e95ef9a7a9a3cd.tar.xz
linux-dev-838d9bb62d132ec3baf1b5aba2e95ef9a7a9a3cd.zip
perf: Use sample_flags for raw_data
Use the new sample_flags to indicate whether the raw data field is filled by the PMU driver. Although it could check with the NULL, follow the same rule with other fields. Remove the raw field from the perf_sample_data_init() to minimize the number of cache lines touched. Signed-off-by: Namhyung Kim <namhyung@kernel.org> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20220921220032.2858517-2-namhyung@kernel.org
Diffstat (limited to 'include/linux/perf_event.h')
-rw-r--r--include/linux/perf_event.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index f4a13579b0e8..e9b151cde491 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -1028,7 +1028,6 @@ struct perf_sample_data {
* minimize the cachelines touched.
*/
u64 sample_flags;
- struct perf_raw_record *raw;
u64 period;
/*
@@ -1040,6 +1039,7 @@ struct perf_sample_data {
union perf_mem_data_src data_src;
u64 txn;
u64 addr;
+ struct perf_raw_record *raw;
u64 type;
u64 ip;
@@ -1078,8 +1078,7 @@ static inline void perf_sample_data_init(struct perf_sample_data *data,
u64 addr, u64 period)
{
/* remaining struct members initialized in perf_prepare_sample() */
- data->sample_flags = 0;
- data->raw = NULL;
+ data->sample_flags = PERF_SAMPLE_PERIOD;
data->period = period;
if (addr) {