@@ -42,14 +42,27 @@ def _verboseprintX(level:int, *args, **kwargs):
4242 'Cache' : {
4343 (r'.*CACHE.*' , 3 ),
4444 (r'CORE_REJECT_L2Q.*' , 1 ),
45+ (r'CORE_SNOOP.*' , 1 ),
4546 (r'DL1.*' , 1 ),
47+ (r'IDI_MISC.*' , 1 ),
4648 (r'L1D.*' , 1 ),
4749 (r'L1D_.*' , 1 ),
50+ (r'L1I.*' , 1 ),
4851 (r'L2.*' , 1 ),
52+ (r'LLC.*' , 1 ),
4953 (r'LONGEST_LAT_CACHE.*' , 1 ),
5054 (r'MEM_.+' , 3 ),
5155 (r'MEM_LOAD_UOPS.*' , 1 ),
5256 (r'OCR.*L3_HIT.*' , 1 ),
57+ (r'OCR.CORE.*' , 1 ),
58+ (r'OCR.DEMAND.*' , 1 ),
59+ (r'OCR.HWPF.*' , 1 ),
60+ (r'OCR.ITOM.*' , 1 ),
61+ (r'OCR.L1WB.*' , 1 ),
62+ (r'OCR.L2WB.*' , 1 ),
63+ (r'OCR.MODIFIED.*' , 1 ),
64+ (r'OCR.READS.*' , 1 ),
65+ (r'OCR.SWPF.*' , 1 ),
5366 (r'OFFCORE_REQUESTS.*' , 1 ),
5467 (r'OFFCORE_RESPONSE.*' , 1 ),
5568 (r'REHABQ.*' , 1 ),
@@ -77,6 +90,7 @@ def _verboseprintX(level:int, *args, **kwargs):
7790 (r'FRONTEND.*' , 3 ),
7891 (r'ICACHE.*' , 4 ),
7992 (r'IDQ.*' , 3 ),
93+ (r'INSTS_WRITTEN.*' , 1 ),
8094 (r'MACRO_INSTS.*' , 1 ),
8195 (r'MS_DECODED.*' , 1 ),
8296 (r'TWO_UOP_INSTS_DECODED.*' , 1 ),
@@ -89,8 +103,11 @@ def _verboseprintX(level:int, *args, **kwargs):
89103 (r'HLE.*' , 3 ),
90104 (r'LD_HEAD.*' , 1 ),
91105 (r'MEMORY_ACTIVITY.*' , 1 ),
106+ (r'MEMORY_STALLS.*' , 1 ),
92107 (r'MEM_TRANS_RETIRED.*' , 3 ),
93108 (r'MISALIGN_MEM_REF.*' , 1 ),
109+ (r'OCR.*DRAM.*' , 1 ),
110+ (r'OCR.*MEMORY.*' , 1 ),
94111 (r'OFFCORE_RESPONSE.*DDR.*' , 1 ),
95112 (r'OFFCORE_RESPONSE.*DRAM.*' , 1 ),
96113 (r'OFFCORE_RESPONSE.*MCDRAM.*' , 1 ),
@@ -107,41 +124,41 @@ def _verboseprintX(level:int, *args, **kwargs):
107124 (r'ARITH.*' , 1 ),
108125 (r'ASSISTS.ANY.*' , 1 ),
109126 (r'BACLEAR.*' , 1 ),
127+ (r'BE_STALLS.*' , 1 ),
110128 (r'BOGUS_BR.*' , 1 ),
111129 (r'BPU_.*' , 1 ),
112130 (r'BR_.*' , 1 ),
113131 (r'BTCLEAR.*' , 1 ),
114132 (r'CPU_CLK.*' , 1 ),
115133 (r'CYCLES_DIV_BUSY.*' , 1 ),
116134 (r'CYCLE_ACTIVITY.*' , 1 ),
135+ (r'DEPENDENT_LOADS.*' , 1 ),
136+ (r'DISPATCH_BLOCKED.*' , 1 ),
117137 (r'DIV.*' , 1 ),
118- (r'EXE_ACTIVITY .*' , 1 ),
138+ (r'EXE .*' , 1 ),
119139 (r'IDQ.*' , 1 ),
120140 (r'ILD.*' , 1 ),
121141 (r'INST_.*' , 1 ),
122142 (r'INT_MISC.*' , 1 ),
123- (r'INT_MISC .*' , 1 ),
143+ (r'INT_UOPS .*' , 1 ),
124144 (r'ISSUE_SLOTS_NOT_CONSUMED.*' , 1 ),
125145 (r'LD_BLOCKS.*' , 1 ),
126146 (r'LOAD_HIT_PRE.*' , 1 ),
127147 (r'LSD.*' , 1 ),
128148 (r'MACHINE_CLEARS.*' , 1 ),
149+ (r'MEMORY_STALLS.*' , 1 ),
129150 (r'MOVE_ELIMINATION.*' , 1 ),
130151 (r'MUL.*' , 1 ),
131152 (r'NO_ALLOC_CYCLES.*' , 1 ),
132153 (r'OTHER_ASSISTS.*' , 1 ),
133154 (r'PARTIAL_RAT_STALLS.*' , 1 ),
134- (r'PARTIAL_RAT_STALLS.*' , 1 ),
135155 (r'RAT_STALLS.*' , 1 ),
136156 (r'RECYCLEQ.*' , 1 ),
137157 (r'REISSUE.*' , 1 ),
138- (r'REISSUE.*' , 1 ),
139- (r'RESOURCE_STALLS.*' , 1 ),
140158 (r'RESOURCE_STALLS.*' , 1 ),
141159 (r'ROB_MISC_EVENTS.*' , 1 ),
142- (r'RS_EVENTS.*' , 1 ),
143- (r'RS_FULL.*' , 1 ),
144- (r'SERIALIZATION.NON_C01_MS_SCB.*' , 1 ),
160+ (r'RS.*' , 1 ),
161+ (r'SERIALIZATION.*' , 1 ),
145162 (r'STORE_FORWARD.*' , 1 ),
146163 (r'TOPDOWN.*' , 1 ),
147164 (r'UOPS_.*' , 1 ),
@@ -154,11 +171,15 @@ def _verboseprintX(level:int, *args, **kwargs):
154171 (r'DATA_TLB.*' , 1 ),
155172 (r'EPT.*' , 1 ),
156173 (r'ITLB.*' , 3 ),
174+ (r'LARGE_ITLB.*' , 1 ),
157175 (r'PAGE_WALK.*' , 1 ),
158176 (r'TLB_FLUSH.*' , 1 ),
159177 }
160178}
161179
180+ # List of strange aux names that don't start with # in expressions.
181+ _aux_names = ['Num_CPUs' , 'Dependent_Loads_Weight' , 'DurationTimeInMilliSeconds' ]
182+
162183# Sort the matches with the highest priority first to allow the loop
163184# to exit early when a lower priority match to the current is found.
164185for topic in _topics .keys ():
@@ -1011,7 +1032,7 @@ def append_to_desc(s: str):
10111032 if parsed_threshold :
10121033 formula ['MetricThreshold' ] = parsed_threshold
10131034 elif threshold :
1014- formula ['MetricThreshold' ] = threshold
1035+ formula ['MetricThreshold' ] = metric . ParsePerfJson ( threshold ). Simplify (). ToPerfJson ()
10151036
10161037 saved_formulas .append (formula )
10171038
@@ -1086,8 +1107,10 @@ def extract_tma_metrics(self, csvfile: TextIO, pmu_prefix: str,
10861107 tma_cpu = None
10871108 if self .shortname == 'BDW-DE' :
10881109 tma_cpu = 'BDW'
1089- if self .shortname == 'ADLN' :
1110+ elif self .shortname == 'ADLN' :
10901111 tma_cpu = 'GRT'
1112+ elif self .shortname in ['SRF' , 'GRR' ]:
1113+ tma_cpu = 'CMT'
10911114 else :
10921115 for key in ratio_column .keys ():
10931116 if self .shortname in key .split ('/' ):
@@ -1354,7 +1377,7 @@ def tma_issue_name(name: str) -> str:
13541377 form = find_form ()
13551378 if form and form != '#NA' :
13561379 aux_name = field ('Level1' )
1357- assert aux_name .startswith ('#' ) or aux_name == 'Num_CPUs' or aux_name == 'Dependent_Loads_Weight'
1380+ assert aux_name .startswith ('#' ) or aux_name in _aux_names
13581381 aux [aux_name ] = form
13591382 _verboseprint3 (f'Adding aux { aux_name } : { form } ' )
13601383
@@ -1400,11 +1423,11 @@ def fixup(form: str) -> str:
14001423 ],
14011424 'ARL' : td_event_fixups + [
14021425 ('IDQ.MITE_UOPS:c8:i1:eq1' ,
1403- r'cpu @IDQ.MITE_UOPS\,cmask\=0x8\,inv\=0x1@' ),
1426+ r'cpu_core @IDQ.MITE_UOPS\,cmask\=0x8\,inv\=0x1@' ),
14041427 ('IDQ.DSB_UOPS:c8:i1:eq1' ,
1405- r'cpu @IDQ.DSB_UOPS\,cmask\=0x8\,inv\=0x1@' ),
1428+ r'cpu_core @IDQ.DSB_UOPS\,cmask\=0x8\,inv\=0x1@' ),
14061429 ('LSD.UOPS:c8:i1:eq1' ,
1407- r'cpu @LSD.UOPS\,cmask\=0x8\,inv\=0x1@' ),
1430+ r'cpu_core @LSD.UOPS\,cmask\=0x8\,inv\=0x1@' ),
14081431 ],
14091432 'BDW-DE' : hsx_uncore_fixups ,
14101433 'BDX' : hsx_uncore_fixups ,
@@ -1632,7 +1655,7 @@ def resolve(v: str) -> str:
16321655 return expand_hhq (v [3 :])
16331656 if v .startswith ('##' ):
16341657 return expand_hh (v [2 :])
1635- if v .startswith ('#' ) or v == 'Num_CPUs' :
1658+ if v .startswith ('#' ) or v in _aux_names :
16361659 return resolve_aux (v )
16371660 return resolve_info (v )
16381661
@@ -1803,6 +1826,17 @@ def to_perf_json(self, outdir: Path):
18031826 pmon_topic_events [event .topic ].append (dict_event )
18041827 dict_events [event .event_name .upper ()] = dict_event
18051828 events [event .event_name .upper ()] = event
1829+ if 'retire latency' in self .files :
1830+ with open (self .files ['retire latency' ], 'r' ) as latency_json :
1831+ event_and_latencies = json .load (latency_json )['Data' ]
1832+ for lat_event in event_and_latencies .keys ():
1833+ assert lat_event in dict_events
1834+ dict_events [lat_event ]['RetirementLatencyMean' ] = \
1835+ event_and_latencies [lat_event ]['MEAN' ]
1836+ dict_events [lat_event ]['RetirementLatencyMin' ] = \
1837+ event_and_latencies [lat_event ]['MIN' ]
1838+ dict_events [lat_event ]['RetirementLatencyMax' ] = \
1839+ event_and_latencies [lat_event ]['MAX' ]
18061840 self .count_counters (event_type , pmon_events )
18071841
18081842 if 'uncore csv' in self .files :
@@ -1900,8 +1934,9 @@ def to_perf_json(self, outdir: Path):
19001934 json .dump (events_ , perf_json , sort_keys = True , indent = 4 ,
19011935 separators = (',' , ': ' ))
19021936 perf_json .write ('\n ' )
1937+
19031938 # Skip hybrid because event grouping does not support it well yet
1904- if self .shortname not in ['ADL' , 'ADLN' , 'ARL' , 'LNL' , 'MTL' ]:
1939+ if self .shortname not in ['ADL' , 'ADLN' , 'ARL' , 'LNL' , 'MTL' , 'SRF' , 'GRR' ]:
19051940 # Write units and counters data to counter.json file
19061941 output_counters = Path (outdir , 'counter.json' )
19071942 with open (output_counters , 'w' , encoding = 'ascii' ) as cnt_json :
@@ -1991,7 +2026,7 @@ def __init__(self, base_path: Path):
19912026
19922027 # Skip mapfile metrics entries metrics/*_metrics.json. This utility uses
19932028 # metrics/perf/*metrics_perf.json files.
1994- if event_type == 'metrics' or event_type == 'retire latency' :
2029+ if event_type == 'metrics' :
19952030 continue
19962031
19972032 # From path compute the shortname (like SKL) and the
@@ -2032,6 +2067,10 @@ def __init__(self, base_path: Path):
20322067 models ['KNL' ].add (family_model )
20332068 continue
20342069
2070+ if event_type == 'retire latency' :
2071+ files [shortname ][event_type ] = filepath
2072+ continue
2073+
20352074 # Remember the state for this mapfile line.
20362075 if shortname not in longnames :
20372076 longnames [shortname ] = longname
@@ -2058,7 +2097,7 @@ def __init__(self, base_path: Path):
20582097
20592098 # Add metric files that will be used for each model.
20602099 files [shortname ]['tma metrics' ] = Path (base_path , 'TMA_Metrics-full.csv' )
2061- if shortname == 'ADLN' :
2100+ if shortname in [ 'ADLN' , 'SRF' , 'GRR' ] :
20622101 files [shortname ]['tma metrics' ] = Path (base_path , 'E-core_TMA_Metrics.csv' )
20632102 if 'atom' in files [shortname ]:
20642103 files [shortname ]['e-core tma metrics' ] = Path (base_path , 'E-core_TMA_Metrics.csv' )
0 commit comments