Skip to content

Commit

Permalink
create_perf_json: Support EventCode FIXED
Browse files Browse the repository at this point in the history
This commit unsets EventCode for FIXED events. Previously for fixed
events the EventCode was 0x00. The get() helper used to process JSON
attributes drops 0x00 (returns None). Here we add an extra check to
also set event_code to None if EventCode is FIXED.

Example FIXED event:
    {
      "EventCode": "FIXED",
      "UMask": "0x01",
      "EventName": "INST_RETIRED.ANY",
      "Counter": "Fixed counter 0",
      "CounterHTOff": "Fixed counter 0",
      <snip>
      "Offcore": "0",
      "Deprecated": "0"
    }
  • Loading branch information
edwarddavidbaker committed Nov 1, 2023
1 parent 7af4a03 commit be3d331
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions scripts/create_perf_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,6 +353,14 @@ def get(key: str) -> str:
self.event_code = "0xff"
self.umask = None

# Unset event_code for fixed core counters. Example:
# "EventCode": "FIXED",
# "EventName": "INST_RETIRED.ANY",
# "Counter": "Fixed counter 0",
if "Counter" in jd and "fixed counter" in jd["Counter"].lower():
if str(self.event_code).lower() == 'fixed':
self.event_code = None

if self.filter:
remove_filter_start = [
"cbofilter",
Expand Down

0 comments on commit be3d331

Please sign in to comment.