Skip to content

Commit

Permalink
Merge pull request #128 from captain5050/master
Browse files Browse the repository at this point in the history
ADL/RPL/SPR metric fixes
  • Loading branch information
kliang2 authored Jan 5, 2024
2 parents 9b57e04 + ea0c9e2 commit 234bb99
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions scripts/create_perf_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -1073,15 +1073,14 @@ def fixup(form: str) -> str:
if pmu_prefix != 'cpu':
for name in events:
if events[name].unit.startswith('cpu') and name in form:
if form == name:
form = f'{pmu_prefix}@{name}@'
else:
form = re.sub(rf'([^@]){name}:([a-zA-Z])',
rf'\1{pmu_prefix}@{name}@\2',
form, re.IGNORECASE)
form = re.sub(rf'([^@]){name}([^a-zA-Z0-9_])',
rf'\1{pmu_prefix}@{name}@\2',
form, re.IGNORECASE)
if form == name or form.startswith(f'{name} '):
form = f'{pmu_prefix}@{name}@' + form[len(name):]
form = re.sub(rf'([^@]){name}:([a-zA-Z])',
rf'\1{pmu_prefix}@{name}@\2',
form, re.IGNORECASE)
form = re.sub(rf'([^@]){name}([^a-zA-Z0-9_])',
rf'\1{pmu_prefix}@{name}@\2',
form, re.IGNORECASE)

changed = True
while changed:
Expand Down Expand Up @@ -1366,6 +1365,18 @@ def append_to_desc(s: str):
'tma_split_stores': nmi,
'tma_store_fwd_blk': nmi,
}
# Alderlake/sapphirerapids add topdown l2 events
# meaning fewer events and triggering NMI issues.
alderlake_constraints = {
# Metrics with more events than counters.
'tma_info_system_mem_read_latency': no_group,
'tma_info_system_mem_request_latency': no_group,
# Metrics that would fit were the NMI watchdog disabled.
'tma_ports_utilized_2': nmi,
'tma_ports_utilized_3m': nmi,
'tma_memory_fence': nmi,
'tma_slow_pause': nmi,
}
errata_constraints = {
# 4 programmable, 3 fixed counters per HT
'JKT': sandybridge_constraints,
Expand All @@ -1392,10 +1403,11 @@ def append_to_desc(s: str):
'ICX': icelake_constraints,
'RKL': icelake_constraints,
'TGL': icelake_constraints,
'ADL': icelake_constraints,
'ADLN': icelake_constraints,
'RPL': icelake_constraints,
'SPR': icelake_constraints,
# As above but l2 topdown counters
'ADL': alderlake_constraints,
'ADLN': alderlake_constraints,
'RPL': alderlake_constraints,
'SPR': alderlake_constraints,
}
if name in errata_constraints[self.shortname]:
j['MetricConstraint'] = errata_constraints[self.shortname][name]
Expand Down

0 comments on commit 234bb99

Please sign in to comment.