Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] lib/i915/perf: Fix warning on codegen
@ 2024-05-01  7:01 Lucas De Marchi
  2024-05-01  8:19 ` ✗ CI.xeBAT: failure for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Lucas De Marchi @ 2024-05-01  7:01 UTC (permalink / raw)
  To: igt-dev; +Cc: Lionel Landwerlin, Lucas De Marchi

For a normal string, it's not correct to use just one backslash as
escape char as that conflicts with Python's escape. Use raw strings for
the regex patterns to avoid this problem. Fix the followin warnings:

[4/1809] Generating lib/i915-perf-registers-hsw with a custom command
/home/ldmartin/p/igt-gpu-tools/lib/i915/perf-configs/codegen.py:165: SyntaxWarning: invalid escape sequence '\$'
  m = re.search('\$GtSlice([0-9]+)XeCore([0-9]+)$', name)
/home/ldmartin/p/igt-gpu-tools/lib/i915/perf-configs/codegen.py:168: SyntaxWarning: invalid escape sequence '\$'
  m = re.search('\$GtSlice([0-9]+)$', name)
/home/ldmartin/p/igt-gpu-tools/lib/i915/perf-configs/codegen.py:171: SyntaxWarning: invalid escape sequence '\$'
  m = re.search('\$GtSlice([0-9]+)DualSubslice([0-9]+)$', name)
/home/ldmartin/p/igt-gpu-tools/lib/i915/perf-configs/codegen.py:341: SyntaxWarning: invalid escape sequence '\$'
  m = re.search('\$GtSlice([0-9]+)$', name)
/home/ldmartin/p/igt-gpu-tools/lib/i915/perf-configs/codegen.py:344: SyntaxWarning: invalid escape sequence '\$'
  m = re.search('\$GtSlice([0-9]+)DualSubslice([0-9]+)$', name)
/home/ldmartin/p/igt-gpu-tools/lib/i915/perf-configs/codegen.py:347: SyntaxWarning: invalid escape sequence '\$'
  m = re.search('\$GtSlice([0-9]+)XeCore([0-9]+)$', name)

Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
---
 lib/i915/perf-configs/codegen.py | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/lib/i915/perf-configs/codegen.py b/lib/i915/perf-configs/codegen.py
index 020e76ef4..0d1847592 100644
--- a/lib/i915/perf-configs/codegen.py
+++ b/lib/i915/perf-configs/codegen.py
@@ -162,13 +162,13 @@ hw_vars_mapping = {
 }
 
 def is_hw_var(name):
-    m = re.search('\$GtSlice([0-9]+)XeCore([0-9]+)$', name)
+    m = re.search(r'\$GtSlice([0-9]+)XeCore([0-9]+)$', name)
     if m:
         return True
-    m = re.search('\$GtSlice([0-9]+)$', name)
+    m = re.search(r'\$GtSlice([0-9]+)$', name)
     if m:
         return True
-    m = re.search('\$GtSlice([0-9]+)DualSubslice([0-9]+)$', name)
+    m = re.search(r'\$GtSlice([0-9]+)DualSubslice([0-9]+)$', name)
     if m:
         return True
     return name in hw_vars_mapping
@@ -338,13 +338,13 @@ class Gen:
             return self.hw_vars[name]['c']
         if name in set.counter_vars:
             return set.read_funcs[name] + "(perf, metric_set, accumulator)"
-        m = re.search('\$GtSlice([0-9]+)$', name)
+        m = re.search(r'\$GtSlice([0-9]+)$', name)
         if m:
             return 'intel_perf_devinfo_slice_available(&perf->devinfo, {0})'.format(m.group(1))
-        m = re.search('\$GtSlice([0-9]+)DualSubslice([0-9]+)$', name)
+        m = re.search(r'\$GtSlice([0-9]+)DualSubslice([0-9]+)$', name)
         if m:
             return 'intel_perf_devinfo_subslice_available(&perf->devinfo, {0}, {1})'.format(m.group(1), m.group(2))
-        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_perf_devinfo_subslice_available(&perf->devinfo, {0}, {1})'.format(m.group(1), m.group(2))
         return None
-- 
2.45.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-05-03 13:39 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-01  7:01 [PATCH] lib/i915/perf: Fix warning on codegen Lucas De Marchi
2024-05-01  8:19 ` ✗ CI.xeBAT: failure for " Patchwork
2024-05-01  8:25 ` ✓ Fi.CI.BAT: success " Patchwork
2024-05-01  9:35 ` ✗ CI.xeFULL: failure " Patchwork
2024-05-01 19:10 ` ✗ Fi.CI.IGT: " Patchwork
2024-05-02 16:22 ` [PATCH] " Gustavo Sousa
2024-05-03 13:39   ` Lucas De Marchi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox