diff --git a/scripts/create_perf_json.py b/scripts/create_perf_json.py index a8d4afad..06fddc66 100644 --- a/scripts/create_perf_json.py +++ b/scripts/create_perf_json.py @@ -739,10 +739,24 @@ def find_form() -> Optional[str]: """Find the formula for CPU in the current CSV line.""" cell = field(tma_cpu) if not cell: - for j in ratio_column[tma_cpu]: + cpu = tma_cpu + # BDW-DE is a BDW with the server + # uncore. Page_Walks_Utilization must come from + # the server BDX CPU. + if self.shortname == 'BDW-DE' and field('Level1') == 'Page_Walks_Utilization': + cpu = 'BDX' + for j in ratio_column[cpu]: cell = field(j) if cell: break + # UNC_ARB is a BDW uncore PMU not present on + # BDW-DE, substitute for the BDX version. + if self.shortname == 'BDW-DE' and 'UNC_ARB' in cell: + for j in ratio_column['BDX']: + cell = field(j) + if cell: + break + if 'UNC_CLOCK.SOCKET' in cell and self.shortname in ['BDW-DE', 'TGL']: cell = None return cell @@ -888,7 +902,7 @@ def is_topdown_row(key: str) -> bool: form = find_form() if form and form != '#NA': aux_name = field('Level1') - assert aux_name.startswith('#') + assert aux_name.startswith('#') or aux_name == 'Num_CPUs' aux[aux_name] = form _verboseprint3(f'Adding aux {aux_name}: {form}') @@ -930,10 +944,6 @@ def fixup(form: str) -> str: 'UNC_C_TOR_INSERTS.MISS_OPCODE@filter_opc\=0x182@'), ('UNC_C_CLOCKTICKS:one_unit', 'cbox_0@event\=0x0@'), ], - 'BDW-DE': [ - ('UNC_ARB_COH_TRK_REQUESTS.ALL', 'arb@event\=0x84\,umask\=0x1@'), - ('UNC_ARB_TRK_REQUESTS.ALL', 'arb@event\=0x81\,umask\=0x1@'), - ], 'CLX': [ ('UNC_M_CLOCKTICKS:one_unit', 'imc_0@event\=0x0@'), ('UNC_CHA_CLOCKTICKS:one_unit', 'cha_0@event\=0x0@'), @@ -1089,8 +1099,11 @@ def bracket(expr): return expr def resolve_aux(v: str) -> str: - if any(v == i for i in ['#core_wide', '#Model', '#SMT_on', '#num_dies','#has_pmem']): + if any(v == i for i in ['#core_wide', '#Model', '#SMT_on', '#num_dies', + '#has_pmem', '#num_cpus_online']): return v + if v == 'Num_CPUs': + return '#num_cpus_online' if v == '#PMM_App_Direct': return '#has_pmem > 0' if v == '#DurationTimeInSeconds': @@ -1136,7 +1149,7 @@ def resolve(v: str) -> str: return expand_hhq(v[3:]) if v.startswith('##'): return expand_hh(v[2:]) - if v.startswith('#'): + if v.startswith('#') or v == 'Num_CPUs': return resolve_aux(v) return resolve_info(v) @@ -1154,17 +1167,7 @@ def resolve(v: str) -> str: def save_form(name, group, form, desc, locate, scale_unit, threshold, issues): if self.shortname == 'BDW-DE': - if name == 'Page_Walks_Utilization': - # Force in the BDX versions. - form = ('(ITLB_MISSES.WALK_DURATION + ' - 'DTLB_LOAD_MISSES.WALK_DURATION + ' - 'DTLB_STORE_MISSES.WALK_DURATION + 7 * ' - '(DTLB_STORE_MISSES.WALK_COMPLETED + ' - 'DTLB_LOAD_MISSES.WALK_COMPLETED + ' - 'ITLB_MISSES.WALK_COMPLETED)) / (2 * CORE_CLKS)') - elif name in ['tma_false_sharing', - 'tma_info_system_mem_parallel_requests', - 'tma_info_system_mem_request_latency']: + if name in ['tma_false_sharing']: # Uncore events missing for BDW-DE, so drop. _verboseprint3(f'Dropping metric {name}') return @@ -1189,7 +1192,8 @@ def save_form(name, group, form, desc, locate, scale_unit, threshold, 'imc_0', 'uncore_cha_0', 'cbox_0', 'arb', 'cbox', 'num_packages', 'num_cores', 'SYSTEM_TSC_FREQ', 'filter_tid', 'TSC', 'cha', 'config1', - 'source_count', 'slots', 'thresh', 'has_pmem']: + 'source_count', 'slots', 'thresh', 'has_pmem', + 'num_cpus_online']: continue if v.startswith('tma_') or v.startswith('topdown\\-'): continue