Skip to content

Commit 02da693

Browse files
author
Peter Zijlstra
committed
perf/x86/intel: Check PEBS dyn_constraints
Handle the interaction between ("perf/x86/intel: Update dyn_constraint base on PEBS event precise level") and ("perf/x86/intel: Add a check for dynamic constraints"). Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
1 parent bd24f9b commit 02da693

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

arch/x86/events/intel/core.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5425,6 +5425,8 @@ enum dyn_constr_type {
54255425
DYN_CONSTR_BR_CNTR,
54265426
DYN_CONSTR_ACR_CNTR,
54275427
DYN_CONSTR_ACR_CAUSE,
5428+
DYN_CONSTR_PEBS,
5429+
DYN_CONSTR_PDIST,
54285430

54295431
DYN_CONSTR_MAX,
54305432
};
@@ -5434,6 +5436,8 @@ static const char * const dyn_constr_type_name[] = {
54345436
[DYN_CONSTR_BR_CNTR] = "a branch counter logging event",
54355437
[DYN_CONSTR_ACR_CNTR] = "an auto-counter reload event",
54365438
[DYN_CONSTR_ACR_CAUSE] = "an auto-counter reload cause event",
5439+
[DYN_CONSTR_PEBS] = "a PEBS event",
5440+
[DYN_CONSTR_PDIST] = "a PEBS PDIST event",
54375441
};
54385442

54395443
static void __intel_pmu_check_dyn_constr(struct event_constraint *constr,
@@ -5538,6 +5542,14 @@ static void intel_pmu_check_dyn_constr(struct pmu *pmu,
55385542
continue;
55395543
mask = hybrid(pmu, acr_cause_mask64) & GENMASK_ULL(INTEL_PMC_MAX_GENERIC - 1, 0);
55405544
break;
5545+
case DYN_CONSTR_PEBS:
5546+
if (x86_pmu.arch_pebs)
5547+
mask = hybrid(pmu, arch_pebs_cap).counters;
5548+
break;
5549+
case DYN_CONSTR_PDIST:
5550+
if (x86_pmu.arch_pebs)
5551+
mask = hybrid(pmu, arch_pebs_cap).pdists;
5552+
break;
55415553
default:
55425554
pr_warn("Unsupported dynamic constraint type %d\n", i);
55435555
}

0 commit comments

Comments
 (0)