2023-11-15 16:48:31

by David Woodhouse

[permalink] [raw]
Subject: [PATCH] PM: tools: Fix sleepgraph syntax error

From: David Woodhouse <[email protected]>

The sleepgraph tool currently fails:

File "/usr/bin/sleepgraph", line 4155
or re.match('psci: CPU(?P<cpu>[0-9]*) killed.*', msg)):
^
SyntaxError: unmatched ')'

Fixes: 34ea427e01ea ("PM: tools: sleepgraph: Recognize "CPU killed" messages")
Signed-off-by: David Woodhouse <[email protected]>

diff --git a/tools/power/pm-graph/sleepgraph.py b/tools/power/pm-graph/sleepgraph.py
index 4a356a706785..40ad221e8881 100755
--- a/tools/power/pm-graph/sleepgraph.py
+++ b/tools/power/pm-graph/sleepgraph.py
@@ -4151,7 +4151,7 @@ def parseKernelLog(data):
elif(re.match('Enabling non-boot CPUs .*', msg)):
# start of first cpu resume
cpu_start = ktime
- elif(re.match('smpboot: CPU (?P<cpu>[0-9]*) is now offline', msg)) \
+ elif(re.match('smpboot: CPU (?P<cpu>[0-9]*) is now offline', msg) \
or re.match('psci: CPU(?P<cpu>[0-9]*) killed.*', msg)):
# end of a cpu suspend, start of the next
m = re.match('smpboot: CPU (?P<cpu>[0-9]*) is now offline', msg)


Attachments:
smime.p7s (5.83 kB)

2023-11-15 17:21:56

by Wolfram Sang

[permalink] [raw]
Subject: Re: [PATCH] PM: tools: Fix sleepgraph syntax error

On Wed, Nov 15, 2023 at 11:47:51AM -0500, David Woodhouse wrote:
> From: David Woodhouse <[email protected]>
>
> The sleepgraph tool currently fails:
>
> File "/usr/bin/sleepgraph", line 4155
> or re.match('psci: CPU(?P<cpu>[0-9]*) killed.*', msg)):
> ^
> SyntaxError: unmatched ')'
>
> Fixes: 34ea427e01ea ("PM: tools: sleepgraph: Recognize "CPU killed" messages")
> Signed-off-by: David Woodhouse <[email protected]>

Had the same issue:

Reviewed-by: Wolfram Sang <[email protected]>


Attachments:
(No filename) (568.00 B)
signature.asc (849.00 B)
Download all attachments

2023-11-20 17:03:34

by Rafael J. Wysocki

[permalink] [raw]
Subject: Re: [PATCH] PM: tools: Fix sleepgraph syntax error

On Wed, Nov 15, 2023 at 6:21 PM Wolfram Sang <[email protected]> wrote:
>
> On Wed, Nov 15, 2023 at 11:47:51AM -0500, David Woodhouse wrote:
> > From: David Woodhouse <[email protected]>
> >
> > The sleepgraph tool currently fails:
> >
> > File "/usr/bin/sleepgraph", line 4155
> > or re.match('psci: CPU(?P<cpu>[0-9]*) killed.*', msg)):
> > ^
> > SyntaxError: unmatched ')'
> >
> > Fixes: 34ea427e01ea ("PM: tools: sleepgraph: Recognize "CPU killed" messages")
> > Signed-off-by: David Woodhouse <[email protected]>
>
> Had the same issue:
>
> Reviewed-by: Wolfram Sang <[email protected]>

Applied as 6.7-rc material, thanks!