Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

PM: tools: sleepgraph: Recognize "CPU killed" messages

On the arm64 platform with PSCI, 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)

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) by making it recognize the "CPU* killed" messages above.

Signed-off-by: Xueqin Luo <luoxueqin@kylinos.cn>
[ rjw: Subject and changelog edits ]
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>

authored by

Xueqin Luo and committed by
Rafael J. Wysocki
34ea427e 04175527

+4 -1
+4 -1
tools/power/pm-graph/sleepgraph.py
··· 4151 4151 elif(re.match('Enabling non-boot CPUs .*', msg)): 4152 4152 # start of first cpu resume 4153 4153 cpu_start = ktime 4154 - elif(re.match('smpboot: CPU (?P<cpu>[0-9]*) is now offline', msg)): 4154 + elif(re.match('smpboot: CPU (?P<cpu>[0-9]*) is now offline', msg)) \ 4155 + or re.match('psci: CPU(?P<cpu>[0-9]*) killed.*', msg)): 4155 4156 # end of a cpu suspend, start of the next 4156 4157 m = re.match('smpboot: CPU (?P<cpu>[0-9]*) is now offline', msg) 4158 + if(not m): 4159 + m = re.match('psci: CPU(?P<cpu>[0-9]*) killed.*', msg) 4157 4160 cpu = 'CPU'+m.group('cpu') 4158 4161 if(cpu not in actions): 4159 4162 actions[cpu] = []