summaryrefslogtreecommitdiffstats
path: root/scripts/pybootchartgui
diff options
context:
space:
mode:
authorAdrian Freihofer <adrian.freihofer@siemens.com>2024-07-21 14:41:25 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2024-07-22 16:53:06 +0100
commita1b494e651cc34468752cc9121e8da93cadedf4b (patch)
tree990a4c16c36bc655a1534579b5b6d36be2c8ef9c /scripts/pybootchartgui
parent4462724cab96ed3990fdf9b30edcea2adc9095ee (diff)
downloadpoky-a1b494e651cc34468752cc9121e8da93cadedf4b.tar.gz
pybootchartgui.py: python 3.12+ regexes
$ ./scripts/pybootchartgui/pybootchartgui.py ./scripts/pybootchartgui/pybootchartgui/parsing.py:460: SyntaxWarning: invalid escape sequence '\d' disk_regex_re = re.compile ('^([hsv]d.|mtdblock\d|mmcblk\d|cciss/c\d+d\d+.*)$') ./scripts/pybootchartgui/pybootchartgui/parsing.py:597: SyntaxWarning: invalid escape sequence '\[' timestamp_re = re.compile ("^\[\s*(\d+\.\d+)\s*]\s+(.*)$") ./scripts/pybootchartgui/pybootchartgui/parsing.py:598: SyntaxWarning: invalid escape sequence '\S' split_re = re.compile ("^(\S+)\s+([\S\+_-]+) (.*)$") ./scripts/pybootchartgui/pybootchartgui/parsing.py:643: SyntaxWarning: invalid escape sequence '\@' p = re.match ("\@ (\d+)", rest) ./scripts/pybootchartgui/pybootchartgui/draw.py:799: SyntaxWarning: invalid escape sequence '\s' ('system.cpu', 'CPU', lambda s: re.sub('model name\s*:\s*', '', s, 1)), (From OE-Core rev: 0d94c22dd8d6c5655c2237ae740e8d9bb2adc751) Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'scripts/pybootchartgui')
-rw-r--r--scripts/pybootchartgui/pybootchartgui/parsing.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/pybootchartgui/pybootchartgui/parsing.py b/scripts/pybootchartgui/pybootchartgui/parsing.py
index 63a53b6b88..144a16c723 100644
--- a/scripts/pybootchartgui/pybootchartgui/parsing.py
+++ b/scripts/pybootchartgui/pybootchartgui/parsing.py
@@ -457,7 +457,7 @@ def _parse_proc_disk_stat_log(file):
457 not sda1, sda2 etc. The format of relevant lines should be: 457 not sda1, sda2 etc. The format of relevant lines should be:
458 {major minor name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq} 458 {major minor name rio rmerge rsect ruse wio wmerge wsect wuse running use aveq}
459 """ 459 """
460 disk_regex_re = re.compile ('^([hsv]d.|mtdblock\d|mmcblk\d|cciss/c\d+d\d+.*)$') 460 disk_regex_re = re.compile (r'^([hsv]d.|mtdblock\d|mmcblk\d|cciss/c\d+d\d+.*)$')
461 461
462 # this gets called an awful lot. 462 # this gets called an awful lot.
463 def is_relevant_line(linetokens): 463 def is_relevant_line(linetokens):
@@ -594,8 +594,8 @@ def _parse_pressure_logs(file, filename):
594# [ 0.039993] calling migration_init+0x0/0x6b @ 1 594# [ 0.039993] calling migration_init+0x0/0x6b @ 1
595# [ 0.039993] initcall migration_init+0x0/0x6b returned 1 after 0 usecs 595# [ 0.039993] initcall migration_init+0x0/0x6b returned 1 after 0 usecs
596def _parse_dmesg(writer, file): 596def _parse_dmesg(writer, file):
597 timestamp_re = re.compile ("^\[\s*(\d+\.\d+)\s*]\s+(.*)$") 597 timestamp_re = re.compile (r"^\[\s*(\d+\.\d+)\s*]\s+(.*)$")
598 split_re = re.compile ("^(\S+)\s+([\S\+_-]+) (.*)$") 598 split_re = re.compile (r"^(\S+)\s+([\S\+_-]+) (.*)$")
599 processMap = {} 599 processMap = {}
600 idx = 0 600 idx = 0
601 inc = 1.0 / 1000000 601 inc = 1.0 / 1000000
@@ -640,7 +640,7 @@ def _parse_dmesg(writer, file):
640# print "foo: '%s' '%s' '%s'" % (type, func, rest) 640# print "foo: '%s' '%s' '%s'" % (type, func, rest)
641 if type == "calling": 641 if type == "calling":
642 ppid = kernel.pid 642 ppid = kernel.pid
643 p = re.match ("\@ (\d+)", rest) 643 p = re.match (r"\@ (\d+)", rest)
644 if p is not None: 644 if p is not None:
645 ppid = float (p.group(1)) // 1000 645 ppid = float (p.group(1)) // 1000
646# print "match: '%s' ('%g') at '%s'" % (func, ppid, time_ms) 646# print "match: '%s' ('%g') at '%s'" % (func, ppid, time_ms)
@@ -742,7 +742,7 @@ def get_num_cpus(headers):
742 cpu_model = headers.get("system.cpu") 742 cpu_model = headers.get("system.cpu")
743 if cpu_model is None: 743 if cpu_model is None:
744 return 1 744 return 1
745 mat = re.match(".*\\((\\d+)\\)", cpu_model) 745 mat = re.match(r".*\\((\\d+)\\)", cpu_model)
746 if mat is None: 746 if mat is None:
747 return 1 747 return 1
748 return max (int(mat.group(1)), 1) 748 return max (int(mat.group(1)), 1)