Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mapfile: Add ARL-H #220

Merged
merged 2 commits into from
Sep 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions mapfile.csv
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ GenuineIntel-6-B6,V0,/GRR/metrics/grandridge_metrics.json,metrics,,,
GenuineIntel-6-BD,V1.06,/LNL/events/lunarlake_skymont_core.json,hybridcore,0x20,0x000003,Atom
GenuineIntel-6-BD,V1.06,/LNL/events/lunarlake_lioncove_core.json,hybridcore,0x40,0x000003,Core
GenuineIntel-6-BD,V1.06,/LNL/events/lunarlake_uncore.json,uncore,,,
GenuineIntel-6-C5,V1.03,/ARL/events/arrowlake_skymont_core.json,hybridcore,0x20,0x000003,Atom
GenuineIntel-6-C5,V1.03,/ARL/events/arrowlake_crestmont_core.json,hybridcore,0x20,0x000002,LowPower_Atom
GenuineIntel-6-C5,V1.03,/ARL/events/arrowlake_lioncove_core.json,hybridcore,0x40,0x000003,Core
GenuineIntel-6-C5,V1.03,/ARL/events/arrowlake_uncore.json,uncore,,,
GenuineIntel-6-C6,V1.03,/ARL/events/arrowlake_skymont_core.json,hybridcore,0x20,0x000003,Atom
GenuineIntel-6-C6,V1.03,/ARL/events/arrowlake_lioncove_core.json,hybridcore,0x40,0x000003,Core
GenuineIntel-6-C6,V1.03,/ARL/events/arrowlake_uncore.json,uncore,,,
2 changes: 1 addition & 1 deletion scripts/ci/verify_mapfile/mapfile_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
},
"Core Role Name" : {
"type": "string",
"pattern": "^(Core|Atom)?$"
"pattern": "^(Core|Atom|LowPower_Atom)?$"
}
},
"required" : [
Expand Down
21 changes: 12 additions & 9 deletions scripts/ci/verify_mapfile/verify_mapfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,22 +254,25 @@ def verify_mapfile_duplicate_types(perfmon_repo_path: Path):
# Filter for any rows with a matching model.
mapfile_rows = [x for x in mapfile_data if x['Family-model'] == model]

# Create a dict key based on EventType and Core Type. Otherwise, for hybrid platforms
# there would be overlapping entries for 'hybridcore'. Combinations of 'hybridcore'
# and core type should be unique.
event_and_core_types = {}
# Create a dict key based on EventType. For hybrid platforms also include Core Type
# and Native Model ID otherwise there would be overlapping entries for 'hybridcore'.
unique_entry_check = {}
for row in mapfile_rows:
event_type = row['EventType']
core_type = row['Core Type']
key = f'{event_type}_{core_type}'
native_model_id = row['Native Model ID']

key = f'{event_type}'
if event_type == 'hybridcore':
key = f'{event_type}_{core_type}_{native_model_id}'

# This row already existed if the key is present.
if key in event_and_core_types:
msg = (f'Family-model {model} includes duplicate entry for EventType={event_type} and '
f'Core Type={core_type}.')
if key in unique_entry_check:
msg = (f'Family-model {model} includes duplicate entry for EventType {event_type}. '
f'Mapfile row {row}.')
raise RuntimeError(msg)

event_and_core_types[key] = 1
unique_entry_check[key] = 1


def verify_mapfile_model_event_versions(perfmon_repo_path: Path):
Expand Down
29 changes: 21 additions & 8 deletions scripts/create_perf_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def topic(event_name: str, unit: str) -> str:
@param event_name: Name of event like UNC_M2M_BYPASS_M2M_Egress.NOT_TAKEN.
@param unit: The PMU responsible for the event or None for CPU events.
"""
if unit and unit not in ['cpu', 'cpu_atom', 'cpu_core']:
if unit and unit not in ['cpu', 'cpu_atom', 'cpu_core', 'cpu_lowpower']:
unit_to_topic = {
'cha': 'Uncore-Cache',
'chacms': 'Uncore-Cache',
Expand Down Expand Up @@ -1642,13 +1642,15 @@ def to_perf_json(self, outdir: Path):
# representing the perf json event. The dictionary events may
# be modified by the uncore CSV file.
dict_events: Dict[str, Dict[str, str]] = {}
for event_type in ['atom', 'core', 'uncore', 'uncore experimental']:
for event_type in ['atom', 'core', 'lowpower', 'uncore', 'uncore experimental']:
if event_type not in self.files:
continue
_verboseprint2(f'Generating {event_type} events from {self.files[event_type]}')
pmu_prefix = None
if event_type in ['atom', 'core']:
pmu_prefix = f'cpu_{event_type}' if 'atom' in self.files else 'cpu'
if event_type in ['atom', 'core', 'lowpower']:
pmu_prefix = 'cpu'
if 'atom' in self.files or 'lowpower' in self.files:
pmu_prefix = f'cpu_{event_type}'
with open(self.files[event_type], 'r') as event_json:
json_data = json.load(event_json)
# UNC_IIO_BANDWIDTH_OUT events are broken on Linux pre-SPR so skip if they exist.
Expand All @@ -1658,8 +1660,11 @@ def to_perf_json(self, outdir: Path):
if self.shortname == 'SPR' or
not x["EventName"].startswith("UNC_IIO_BANDWIDTH_OUT.")]
unit = None
if event_type in ['atom', 'core'] and 'atom' in self.files and 'core' in self.files:
unit = f'cpu_{event_type}'
if event_type in ['atom', 'core', 'lowpower']:
# If the platform is a hybrid there will be a combination of atom,
# lowpower (LowPower_Atom), or core files.
if ('atom' in self.files or 'lowpower' in self.files) and 'core' in self.files:
unit = f'cpu_{event_type}'
per_pkg = '1' if event_type in ['uncore', 'uncore experimental'] else None
duplicates: Set[str] = set()
for event in pmon_events:
Expand Down Expand Up @@ -1890,8 +1895,16 @@ def __init__(self, base_path: Path):

if event_type == 'hybridcore':
# We want a core and an atom file, so change
# event_type for hybrid models.
event_type = 'core' if core_role_name == 'Core' else 'atom'
# event_type for hybrid models. Mapfile.csv core
# roles are Core, Atom, or LowPower_Atom.
core_role_mapfile_to_linux_mapping = {
'Core': 'core',
'Atom': 'atom',
'LowPower_Atom': 'lowpower',
}
if core_role_name not in core_role_mapfile_to_linux_mapping:
raise ValueError(f'Unexpected core role {core_role_name}')
event_type = core_role_mapfile_to_linux_mapping[core_role_name]

if shortname == 'KNM':
# The files for KNL and KNM are the same as are
Expand Down