Skip to content

Commit

Permalink
Fix for event option handling
Browse files Browse the repository at this point in the history
  • Loading branch information
calebbiggers committed May 15, 2024
1 parent 285cfd6 commit 3f6e1b3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
14 changes: 7 additions & 7 deletions scripts/config/replacements_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,27 +49,27 @@
"SW_", "RS", "DSB2MITE_", "ARB_"],
"unit":"cpu",
"translations":{
"C":"cmask",
"U":"umask",
"I":"inv",
"E":"edge"
"c":"cmask",
"u":"umask",
"i":"inv",
"e":"edge"
},
"scale":1
},
{
"events": ["UNC_CHA_"],
"unit":"cha",
"translations":{
"FILTER1":"config1"
"filter1":"config1"
},
"scale":100000000
},
{
"events":["UNC_C_"],
"unit":"cbox",
"translations":{
"OPC":"filter_opc",
"TID":"filter_tid"
"opc":"filter_opc",
"tid":"filter_tid"
},
"scale":1
}
Expand Down
4 changes: 2 additions & 2 deletions scripts/perf_format_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def translate_event_options(self, split, event_info):
translation = event_info["unit"] + "@" + split[0]
for option in split[1:]:
if "=" in option:
split = option.split("=")
split = [s.lower() for s in option.split("=")]
if split[0] in event_info["translations"]:
if "x" in split[1] or "X" in split[1]:
translation += "\\," + event_info["translations"][split[0]] + "\\=" + split[1]
Expand All @@ -319,7 +319,7 @@ def translate_event_options(self, split, event_info):
if split[0] in event_info["translations"]:
translation += "\\," + event_info["translations"][split[0]] + "\\=" + "0x" + split[1]
else:
match = re.match(r"([a-zA-Z]+)([\d]+)", option)
match = re.match(r"([a-zA-Z]+)([\d]+)", option.lower())
if match:
if match[1] in event_info["translations"]:
translation += "\\,"+ event_info["translations"][match[1]] + "\\=" + "0x" + match[2]
Expand Down

0 comments on commit 3f6e1b3

Please sign in to comment.