diff options
author | Namhyung Kim <namhyung@kernel.org> | 2022-09-22 01:00:31 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2022-09-27 23:50:24 +0300 |
commit | 7b084630153152239d84990ac4540c2dd360186f (patch) | |
tree | 1a4f811f91b4843ca55bd2c5c5af57a4aa668430 /arch/x86/events | |
parent | dca6344d7a77dd0501a73745f4a9fb1ee2bc9d7c (diff) | |
download | linux-7b084630153152239d84990ac4540c2dd360186f.tar.xz |
perf: Use sample_flags for addr
Use the new sample_flags to indicate whether the addr field is filled by
the PMU driver. As most PMU drivers pass 0, it can set the flag only if
it has a non-zero value. And use 0 in perf_sample_output() if it's not
filled already.
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-1-namhyung@kernel.org
Diffstat (limited to 'arch/x86/events')
-rw-r--r-- | arch/x86/events/intel/ds.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c index 4ba6ab6d0d92..d2e9ff16f6ed 100644 --- a/arch/x86/events/intel/ds.c +++ b/arch/x86/events/intel/ds.c @@ -1621,8 +1621,10 @@ static void setup_pebs_fixed_sample_data(struct perf_event *event, if ((sample_type & PERF_SAMPLE_ADDR_TYPE) && - x86_pmu.intel_cap.pebs_format >= 1) + x86_pmu.intel_cap.pebs_format >= 1) { data->addr = pebs->dla; + data->sample_flags |= PERF_SAMPLE_ADDR; + } if (x86_pmu.intel_cap.pebs_format >= 2) { /* Only set the TSX weight when no memory weight. */ @@ -1783,8 +1785,10 @@ static void setup_pebs_adaptive_sample_data(struct perf_event *event, data->sample_flags |= PERF_SAMPLE_DATA_SRC; } - if (sample_type & PERF_SAMPLE_ADDR_TYPE) + if (sample_type & PERF_SAMPLE_ADDR_TYPE) { data->addr = meminfo->address; + data->sample_flags |= PERF_SAMPLE_ADDR; + } if (sample_type & PERF_SAMPLE_TRANSACTION) { data->txn = intel_get_tsx_transaction(meminfo->tsx_tuning, |