Commit a633a4b8 authored by Kuan-Ying Lee's avatar Kuan-Ying Lee Committed by Andrew Morton

scripts/gdb: fix timerlist parsing issue

Patch series "Fix some GDB command error and add some GDB commands", v3.

Fix some GDB command errors and add some useful GDB commands.


This patch (of 5):

Commit 7988e5ae ("tick: Split nohz and highres features from
nohz_mode") and commit 7988e5ae ("tick: Split nohz and highres
features from nohz_mode") move 'tick_stopped' and 'nohz_mode' to flags
field which will break the gdb lx-mounts command:

(gdb) lx-timerlist
Python Exception <class 'gdb.error'>: There is no member named nohz_mode.
Error occurred in Python: There is no member named nohz_mode.

(gdb) lx-timerlist
Python Exception <class 'gdb.error'>: There is no member named tick_stopped.
Error occurred in Python: There is no member named tick_stopped.

We move 'tick_stopped' and 'nohz_mode' to flags field instead.

Link: https://lkml.kernel.org/r/20240723064902.124154-1-kuan-ying.lee@canonical.com
Link: https://lkml.kernel.org/r/20240723064902.124154-2-kuan-ying.lee@canonical.com
Fixes: a478ffb2 ("tick: Move individual bit features to debuggable mask accesses")
Fixes: 7988e5ae ("tick: Split nohz and highres features from nohz_mode")
Signed-off-by: default avatarKuan-Ying Lee <kuan-ying.lee@canonical.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Kieran Bingham <kbingham@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
parent d1c7848b
...@@ -87,21 +87,22 @@ def print_cpu(hrtimer_bases, cpu, max_clock_bases): ...@@ -87,21 +87,22 @@ def print_cpu(hrtimer_bases, cpu, max_clock_bases):
text += "\n" text += "\n"
if constants.LX_CONFIG_TICK_ONESHOT: if constants.LX_CONFIG_TICK_ONESHOT:
fmts = [(" .{} : {}", 'nohz_mode'), TS_FLAG_STOPPED = 1 << 1
(" .{} : {} nsecs", 'last_tick'), TS_FLAG_NOHZ = 1 << 4
(" .{} : {}", 'tick_stopped'), text += f" .{'nohz':15s}: {int(bool(ts['flags'] & TS_FLAG_NOHZ))}\n"
(" .{} : {}", 'idle_jiffies'), text += f" .{'last_tick':15s}: {ts['last_tick']}\n"
(" .{} : {}", 'idle_calls'), text += f" .{'tick_stopped':15s}: {int(bool(ts['flags'] & TS_FLAG_STOPPED))}\n"
(" .{} : {}", 'idle_sleeps'), text += f" .{'idle_jiffies':15s}: {ts['idle_jiffies']}\n"
(" .{} : {} nsecs", 'idle_entrytime'), text += f" .{'idle_calls':15s}: {ts['idle_calls']}\n"
(" .{} : {} nsecs", 'idle_waketime'), text += f" .{'idle_sleeps':15s}: {ts['idle_sleeps']}\n"
(" .{} : {} nsecs", 'idle_exittime'), text += f" .{'idle_entrytime':15s}: {ts['idle_entrytime']} nsecs\n"
(" .{} : {} nsecs", 'idle_sleeptime'), text += f" .{'idle_waketime':15s}: {ts['idle_waketime']} nsecs\n"
(" .{}: {} nsecs", 'iowait_sleeptime'), text += f" .{'idle_exittime':15s}: {ts['idle_exittime']} nsecs\n"
(" .{} : {}", 'last_jiffies'), text += f" .{'idle_sleeptime':15s}: {ts['idle_sleeptime']} nsecs\n"
(" .{} : {}", 'next_timer'), text += f" .{'iowait_sleeptime':15s}: {ts['iowait_sleeptime']} nsecs\n"
(" .{} : {} nsecs", 'idle_expires')] text += f" .{'last_jiffies':15s}: {ts['last_jiffies']}\n"
text += "\n".join([s.format(f, ts[f]) for s, f in fmts]) text += f" .{'next_timer':15s}: {ts['next_timer']}\n"
text += f" .{'idle_expires':15s}: {ts['idle_expires']} nsecs\n"
text += "\njiffies: {}\n".format(jiffies) text += "\njiffies: {}\n".format(jiffies)
text += "\n" text += "\n"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment