* [PATCH RESEND 1/3] scripts/gdb: timerlist: use range instead of xrange
2023-04-06 22:12 [PATCH RESEND 0/3] scripts/gdb: timerlist fixes Florian Fainelli
@ 2023-04-06 22:12 ` Florian Fainelli
2023-04-06 22:12 ` [PATCH RESEND 2/3] scripts/gdb: timerlist: fix rb_node access Florian Fainelli
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2023-04-06 22:12 UTC (permalink / raw)
To: linux-kernel
Cc: Andrew Morton, Amjad Ouled-Ameur, Florian Fainelli, Jan Kiszka,
Kieran Bingham
From: Amjad Ouled-Ameur <aouledameur@baylibre.com>
xrange has been renamed to range in Python 3. Therefore,
timerlist currently fails with NameError exception:
Python Exception <class 'NameError'> name 'xrange' is not defined.
Use range instead of xrange.
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
---
scripts/gdb/linux/timerlist.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/gdb/linux/timerlist.py b/scripts/gdb/linux/timerlist.py
index 071d0dd5a634..fac951236dc4 100644
--- a/scripts/gdb/linux/timerlist.py
+++ b/scripts/gdb/linux/timerlist.py
@@ -73,7 +73,7 @@ def print_cpu(hrtimer_bases, cpu, max_clock_bases):
ts = cpus.per_cpu(tick_sched_ptr, cpu)
text = "cpu: {}\n".format(cpu)
- for i in xrange(max_clock_bases):
+ for i in range(max_clock_bases):
text += " clock {}:\n".format(i)
text += print_base(cpu_base['clock_base'][i])
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH RESEND 2/3] scripts/gdb: timerlist: fix rb_node access
2023-04-06 22:12 [PATCH RESEND 0/3] scripts/gdb: timerlist fixes Florian Fainelli
2023-04-06 22:12 ` [PATCH RESEND 1/3] scripts/gdb: timerlist: use range instead of xrange Florian Fainelli
@ 2023-04-06 22:12 ` Florian Fainelli
2023-04-06 22:12 ` [PATCH RESEND 3/3] scripts/gdb: timerlist: convert int chunks to str Florian Fainelli
2023-04-06 23:18 ` [PATCH RESEND 0/3] scripts/gdb: timerlist fixes Andrew Morton
3 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2023-04-06 22:12 UTC (permalink / raw)
To: linux-kernel
Cc: Andrew Morton, Amjad Ouled-Ameur, Florian Fainelli, Jan Kiszka,
Kieran Bingham
From: Amjad Ouled-Ameur <aouledameur@baylibre.com>
"struct timerqueue_head" no longer has "next" member since v5.4-rc1:
commit 511885d7061e ("lib/timerqueue: Rely on rbtree semantics for next
timer")
Therefore, access "rb_node" through active->rb_root->rb_root->rb_node.
Moreoever, remove curr.address.cast() on rb_node as this breaks the code
and is not necessary.
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
---
scripts/gdb/linux/timerlist.py | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/scripts/gdb/linux/timerlist.py b/scripts/gdb/linux/timerlist.py
index fac951236dc4..d16909f8df35 100644
--- a/scripts/gdb/linux/timerlist.py
+++ b/scripts/gdb/linux/timerlist.py
@@ -43,8 +43,7 @@ def print_timer(rb_node, idx):
def print_active_timers(base):
- curr = base['active']['next']['node']
- curr = curr.address.cast(rbtree.rb_node_type.get_type().pointer())
+ curr = base['active']['rb_root']['rb_root']['rb_node']
idx = 0
while curr:
yield print_timer(curr, idx)
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread* [PATCH RESEND 3/3] scripts/gdb: timerlist: convert int chunks to str
2023-04-06 22:12 [PATCH RESEND 0/3] scripts/gdb: timerlist fixes Florian Fainelli
2023-04-06 22:12 ` [PATCH RESEND 1/3] scripts/gdb: timerlist: use range instead of xrange Florian Fainelli
2023-04-06 22:12 ` [PATCH RESEND 2/3] scripts/gdb: timerlist: fix rb_node access Florian Fainelli
@ 2023-04-06 22:12 ` Florian Fainelli
2023-04-06 23:18 ` [PATCH RESEND 0/3] scripts/gdb: timerlist fixes Andrew Morton
3 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2023-04-06 22:12 UTC (permalink / raw)
To: linux-kernel
Cc: Andrew Morton, Amjad Ouled-Ameur, Florian Fainelli, Jan Kiszka,
Kieran Bingham
From: Amjad Ouled-Ameur <aouledameur@baylibre.com>
join() expects strings but integers are given.
Convert chunks list to strings before passing it to join()
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Amjad Ouled-Ameur <aouledameur@baylibre.com>
---
scripts/gdb/linux/timerlist.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/gdb/linux/timerlist.py b/scripts/gdb/linux/timerlist.py
index d16909f8df35..98bb9a239283 100644
--- a/scripts/gdb/linux/timerlist.py
+++ b/scripts/gdb/linux/timerlist.py
@@ -172,7 +172,7 @@ def pr_cpumask(mask):
if 0 < extra <= 4:
chunks[0] = chunks[0][0] # Cut off the first 0
- return "".join(chunks)
+ return "".join(str(chunks))
class LxTimerList(gdb.Command):
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH RESEND 0/3] scripts/gdb: timerlist fixes
2023-04-06 22:12 [PATCH RESEND 0/3] scripts/gdb: timerlist fixes Florian Fainelli
` (2 preceding siblings ...)
2023-04-06 22:12 ` [PATCH RESEND 3/3] scripts/gdb: timerlist: convert int chunks to str Florian Fainelli
@ 2023-04-06 23:18 ` Andrew Morton
2023-04-08 3:51 ` Florian Fainelli
3 siblings, 1 reply; 6+ messages in thread
From: Andrew Morton @ 2023-04-06 23:18 UTC (permalink / raw)
To: Florian Fainelli
Cc: linux-kernel, Jan Kiszka, Kieran Bingham, Amjad Ouled-Ameur, Peng Liu
On Thu, 6 Apr 2023 15:12:14 -0700 Florian Fainelli <f.fainelli@gmail.com> wrote:
> Since you have been collecting my patches touching scripts/gdb,
> (re)sending those fixes from Amjad that restore a functional
> "lx-timerlist" scripts.
The first two issues appear to have already been fixed:
https://lore.kernel.org/all/TYCP286MB21463BD277330B26DDC18903C6819@TYCP286MB2146.JPNP286.PROD.OUTLOOK.COM/T/#u
https://lore.kernel.org/all/TYCP286MB2146EE1180A4D5176CBA8AB2C6819@TYCP286MB2146.JPNP286.PROD.OUTLOOK.COM/T/#u
https://lore.kernel.org/all/TYCP286MB214640FF0E7F04AC3926A39EC6819@TYCP286MB2146.JPNP286.PROD.OUTLOOK.COM/T/#u
Thanks, I'll queue up the third patch.
(And I'm going to have to redo the above three patches and rebase,
because I now see hotmail's Message-ID's fooled my Link: extraction
script, grr)
While I'm there, I'm wondering if the xrange patch should be backported
to -stable kernels. We want gdb to work well with Python3 on older
kernels, yes?
Also, I added your Signed-off-by: to "scripts/gdb: timerlist: convert
int chunks to str", since you were on the patch delivery path.
^ permalink raw reply [flat|nested] 6+ messages in thread* Re: [PATCH RESEND 0/3] scripts/gdb: timerlist fixes
2023-04-06 23:18 ` [PATCH RESEND 0/3] scripts/gdb: timerlist fixes Andrew Morton
@ 2023-04-08 3:51 ` Florian Fainelli
0 siblings, 0 replies; 6+ messages in thread
From: Florian Fainelli @ 2023-04-08 3:51 UTC (permalink / raw)
To: Andrew Morton
Cc: linux-kernel, Jan Kiszka, Kieran Bingham, Amjad Ouled-Ameur, Peng Liu
On 4/6/2023 4:18 PM, Andrew Morton wrote:
> On Thu, 6 Apr 2023 15:12:14 -0700 Florian Fainelli <f.fainelli@gmail.com> wrote:
>
>> Since you have been collecting my patches touching scripts/gdb,
>> (re)sending those fixes from Amjad that restore a functional
>> "lx-timerlist" scripts.
>
> The first two issues appear to have already been fixed:
>
> https://lore.kernel.org/all/TYCP286MB21463BD277330B26DDC18903C6819@TYCP286MB2146.JPNP286.PROD.OUTLOOK.COM/T/#u
> https://lore.kernel.org/all/TYCP286MB2146EE1180A4D5176CBA8AB2C6819@TYCP286MB2146.JPNP286.PROD.OUTLOOK.COM/T/#u
> https://lore.kernel.org/all/TYCP286MB214640FF0E7F04AC3926A39EC6819@TYCP286MB2146.JPNP286.PROD.OUTLOOK.COM/T/#u
Oh yes, indeed there was a prior submission by Peng.
>
> Thanks, I'll queue up the third patch.
>
> (And I'm going to have to redo the above three patches and rebase,
> because I now see hotmail's Message-ID's fooled my Link: extraction
> script, grr)
>
>
> While I'm there, I'm wondering if the xrange patch should be backported
> to -stable kernels. We want gdb to work well with Python3 on older
> kernels, yes?
I would say so, yes.
>
>
> Also, I added your Signed-off-by: to "scripts/gdb: timerlist: convert
> int chunks to str", since you were on the patch delivery path.
>
Thanks!
--
Florian
^ permalink raw reply [flat|nested] 6+ messages in thread