mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
intel/perf: fix regex escaping
`\$` is interpreted before being passed to `re.search()`, but luckily
for us the escape is also invalid and because of that, python 3.12+
warns us about it.
Use a raw string instead, so that the `\` is passed untouched to
`re.search()`.
Fixes: aa04b47c6e ("intel/perf: add support for GtSlice/GtSliceXDualsubsliceY variables")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26355>
This commit is contained in:
parent
1492d24f89
commit
1942073112
1 changed files with 2 additions and 2 deletions
|
|
@ -251,10 +251,10 @@ hw_vars["$QueryMode"] = "perf->sys_vars.query_mode"
|
|||
def resolve_variable(name, set, allow_counters):
|
||||
if name in hw_vars:
|
||||
return hw_vars[name]
|
||||
m = re.search('\$GtSlice([0-9]+)$', name)
|
||||
m = re.search(r'\$GtSlice([0-9]+)$', name)
|
||||
if m:
|
||||
return 'intel_device_info_slice_available(&perf->devinfo, {0})'.format(m.group(1))
|
||||
m = re.search('\$GtSlice([0-9]+)XeCore([0-9]+)$', name)
|
||||
m = re.search(r'\$GtSlice([0-9]+)XeCore([0-9]+)$', name)
|
||||
if m:
|
||||
return 'intel_device_info_subslice_available(&perf->devinfo, {0}, {1})'.format(m.group(1), m.group(2))
|
||||
if allow_counters and name in set.counter_vars:
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue