Re: [PATCH V5 00/12] perf: Add Icelake support (kernel only, except Topdown)

From: Liang, Kan
Date: Mon Apr 08 2019 - 12:25:21 EST



@@ -963,40 +963,42 @@ static u64 pebs_update_adaptive_cfg(stru
ÂÂÂÂÂ u64 pebs_data_cfg = 0;
ÂÂÂÂÂ bool gprs, tsx_weight;
-ÂÂÂ if ((sample_type & ~(PERF_SAMPLE_IP|PERF_SAMPLE_TIME)) ||
-ÂÂÂÂÂÂÂ attr->precise_ip < 2) {
+ÂÂÂ if (!(sample_type & ~(PERF_SAMPLE_IP|PERF_SAMPLE_TIME)) &&
+ÂÂÂÂÂÂÂ attr->precise_ip > 1)
+ÂÂÂÂÂÂÂ return pebs_data_cfs;

Sorry, there are two typos. I didn't find in the previous email.
Should be pebs_data_cfg.

-ÂÂÂÂÂÂÂ if (sample_type & PERF_PEBS_MEMINFO_TYPE)
-ÂÂÂÂÂÂÂÂÂÂÂ pebs_data_cfg |= PEBS_DATACFG_MEMINFO;
+ÂÂÂ if (sample_type & PERF_PEBS_MEMINFO_TYPE)
+ÂÂÂÂÂÂÂ pebs_data_cfg |= PEBS_DATACFG_MEMINFO;
+ÂÂÂ /*
+ÂÂÂÂ * We need GPRs when:
+ÂÂÂÂ * + user requested them
+ÂÂÂÂ * + precise_ip < 2 for the non event IP
+ÂÂÂÂ * + For RTM TSX weight we need GPRs for the abort code.
+ÂÂÂÂ */
+ÂÂÂ gprs = (sample_type & PERF_SAMPLE_REGS_INTR) &&
+ÂÂÂÂÂÂÂÂÂÂ (attr->sample_regs_intr & PEBS_GPRS_REGS);
+
+ÂÂÂ tsx_weight = (sample_type & PERF_SAMPLE_WEIGHT) &&
+ÂÂÂÂÂÂÂÂÂÂÂÂ ((attr->config & INTEL_ARCH_EVENT_MASK) ==
+ÂÂÂÂÂÂÂÂÂÂÂÂÂ x86_pmu.rtm_abort_event);
+
+ÂÂÂ if (gprs || (attr->precise_ip < 2) || tsx_weight)
+ÂÂÂÂÂÂÂ pebs_data_cfg |= PEBS_DATACFG_GPRS;
+
+ÂÂÂ if ((sample_type & PERF_SAMPLE_REGS_INTR) &&
+ÂÂÂÂÂÂÂ (attr->sample_regs_intr & PERF_XMM_REGS))

Should be PEBS_XMM_REGS.


Thanks,
Kan