All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] PM: tools: add "CPU killed" messages to fix an error in suspend flow
@ 2023-03-16  1:33 Xueqin Luo
  2023-03-27 17:25 ` Rafael J. Wysocki
  0 siblings, 1 reply; 2+ messages in thread
From: Xueqin Luo @ 2023-03-16  1:33 UTC (permalink / raw)
  To: rafael, todd.e.brandt, linux-pm, linux-kernel; +Cc: luoxueqin, xiongxin

On the arm64 platform, the core log of cpu offline is as follows:

[  100.431501] CPU1: shutdown
[  100.454820] psci: CPU1 killed (polled 20 ms)
[  100.459266] CPU2: shutdown
[  100.482575] psci: CPU2 killed (polled 20 ms)
[  100.486057] CPU3: shutdown
[  100.513974] psci: CPU3 killed (polled 28 ms)
[  100.518068] CPU4: shutdown
[  100.541481] psci: CPU4 killed (polled 24 ms)

And this goal of this patch is to prevent sleepgraph from mistakenly
treating the "CPU up" message as part of the suspend flow (because it
should be regarded as part of the resume flow).

Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn>
---

v2: update changelog

 tools/power/pm-graph/sleepgraph.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/tools/power/pm-graph/sleepgraph.py b/tools/power/pm-graph/sleepgraph.py
index 82c09cd25cc2..d816970b0a3d 100755
--- a/tools/power/pm-graph/sleepgraph.py
+++ b/tools/power/pm-graph/sleepgraph.py
@@ -4132,9 +4132,12 @@ 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)
+				if(not m):
+					m = re.match('psci: CPU(?P<cpu>[0-9]*) killed.*', msg)
 				cpu = 'CPU'+m.group('cpu')
 				if(cpu not in actions):
 					actions[cpu] = []
-- 
2.25.1


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

* Re: [PATCH v2] PM: tools: add "CPU killed" messages to fix an error in suspend flow
  2023-03-16  1:33 [PATCH v2] PM: tools: add "CPU killed" messages to fix an error in suspend flow Xueqin Luo
@ 2023-03-27 17:25 ` Rafael J. Wysocki
  0 siblings, 0 replies; 2+ messages in thread
From: Rafael J. Wysocki @ 2023-03-27 17:25 UTC (permalink / raw)
  To: Xueqin Luo; +Cc: rafael, todd.e.brandt, linux-pm, linux-kernel, xiongxin

On Thu, Mar 16, 2023 at 2:33 AM Xueqin Luo <luoxueqin@kylinos.cn> wrote:
>
> On the arm64 platform, the core log of cpu offline is as follows:
>
> [  100.431501] CPU1: shutdown
> [  100.454820] psci: CPU1 killed (polled 20 ms)
> [  100.459266] CPU2: shutdown
> [  100.482575] psci: CPU2 killed (polled 20 ms)
> [  100.486057] CPU3: shutdown
> [  100.513974] psci: CPU3 killed (polled 28 ms)
> [  100.518068] CPU4: shutdown
> [  100.541481] psci: CPU4 killed (polled 24 ms)
>
> And this goal of this patch is to prevent sleepgraph from mistakenly
> treating the "CPU up" message as part of the suspend flow (because it
> should be regarded as part of the resume flow).
>
> Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn>
> ---
>
> v2: update changelog
>
>  tools/power/pm-graph/sleepgraph.py | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/tools/power/pm-graph/sleepgraph.py b/tools/power/pm-graph/sleepgraph.py
> index 82c09cd25cc2..d816970b0a3d 100755
> --- a/tools/power/pm-graph/sleepgraph.py
> +++ b/tools/power/pm-graph/sleepgraph.py
> @@ -4132,9 +4132,12 @@ 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)
> +                               if(not m):
> +                                       m = re.match('psci: CPU(?P<cpu>[0-9]*) killed.*', msg)
>                                 cpu = 'CPU'+m.group('cpu')
>                                 if(cpu not in actions):
>                                         actions[cpu] = []
> --

Applied as 6.4 material with some edits in the subject and changelog.

Thanks!

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

end of thread, other threads:[~2023-03-27 17:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-16  1:33 [PATCH v2] PM: tools: add "CPU killed" messages to fix an error in suspend flow Xueqin Luo
2023-03-27 17:25 ` Rafael J. Wysocki

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.