PM: tools: Fix sleepgraph syntax error

Message ID a5f86bcf03b2ed809245d57f5971ae42a8b85128.camel@infradead.org
State New
Headers
Series PM: tools: Fix sleepgraph syntax error |

Commit Message

David Woodhouse Nov. 15, 2023, 4:47 p.m. UTC
  From: David Woodhouse <dwmw@amazon.co.uk>

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 <dwmw@amazon.co.uk>
  

Comments

Wolfram Sang Nov. 15, 2023, 5:21 p.m. UTC | #1
On Wed, Nov 15, 2023 at 11:47:51AM -0500, David Woodhouse wrote:
> From: David Woodhouse <dwmw@amazon.co.uk>
> 
> 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 <dwmw@amazon.co.uk>

Had the same issue:

Reviewed-by: Wolfram Sang <wsa@kernel.org>
  
Rafael J. Wysocki Nov. 20, 2023, 5:01 p.m. UTC | #2
On Wed, Nov 15, 2023 at 6:21 PM Wolfram Sang <wsa@kernel.org> wrote:
>
> On Wed, Nov 15, 2023 at 11:47:51AM -0500, David Woodhouse wrote:
> > From: David Woodhouse <dwmw@amazon.co.uk>
> >
> > 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 <dwmw@amazon.co.uk>
>
> Had the same issue:
>
> Reviewed-by: Wolfram Sang <wsa@kernel.org>

Applied as 6.7-rc material, thanks!
  

Patch

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)