aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2023-05-30 04:05:39 -0700
committerAndi Kleen <ak@linux.intel.com>2023-06-12 19:22:22 -0700
commit950fa8552b9d6d6fdf9a3ad796890218a11c609e (patch)
tree4aaac65e243fc710dcad1769ab2bb8d27011e43e /contrib
parentde5f3bbf95674c2e6688b2ce7e7a01cdc236ea41 (diff)
downloadgcc-950fa8552b9d6d6fdf9a3ad796890218a11c609e.zip
gcc-950fa8552b9d6d6fdf9a3ad796890218a11c609e.tar.gz
gcc-950fa8552b9d6d6fdf9a3ad796890218a11c609e.tar.bz2
Update perf auto profile script
- Fix gen_autofdo_event: The download URL for the Intel Perfmon Event list has changed, as well as the JSON format. Also it now uses pattern matching to match CPUs. Update the script to support all of this. - Regenerate gcc-auto-profile with the latest published Intel model numbers, so it works with recent systems. - So far it's still broken on hybrid systems contrib/ChangeLog: * gen_autofdo_event.py: Update for download server changes gcc/ChangeLog * config/i386/gcc-auto-profile: Regenerate.
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/gen_autofdo_event.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/contrib/gen_autofdo_event.py b/contrib/gen_autofdo_event.py
index ac23b83..533c706 100755
--- a/contrib/gen_autofdo_event.py
+++ b/contrib/gen_autofdo_event.py
@@ -32,8 +32,9 @@ import json
import argparse
import collections
import os
+import fnmatch
-baseurl = "https://download.01.org/perfmon"
+baseurl = "https://raw.githubusercontent.com/intel/perfmon/main"
target_events = ('BR_INST_RETIRED.NEAR_TAKEN',
'BR_INST_EXEC.TAKEN',
@@ -74,7 +75,7 @@ def get_cpustr():
def find_event(eventurl, model):
print("Downloading", eventurl, file = sys.stderr)
u = urllib.request.urlopen(eventurl)
- events = json.loads(u.read())
+ events = json.loads(u.read())["Events"]
u.close()
found = 0
@@ -102,7 +103,7 @@ found = 0
cpufound = 0
for j in u:
n = j.rstrip().decode().split(',')
- if len(n) >= 4 and (args.all or n[0] == cpu) and n[3] == "core":
+ if len(n) >= 4 and (args.all or fnmatch.fnmatch(cpu, n[0])) and n[3] == "core":
components = n[0].split("-")
model = components[2]
model = int(model, 16)