All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] scripts/gdb: timerlist: fix rb_node access and python errors
@ 2022-07-27 14:14 Amjad Ouled-Ameur
  2022-07-27 14:14 ` [PATCH 1/3] scripts/gdb: timerlist: use range instead of xrange Amjad Ouled-Ameur
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Amjad Ouled-Ameur @ 2022-07-27 14:14 UTC (permalink / raw)
  To: jan.kiszka; +Cc: linux-kernel, narmstrong, kbingham, Amjad Ouled-Ameur

This patchset fixes use of lx-timerlist with kgdb.

It has been tested on Amlogic libretech-cc s905X and works fine [0]

[0]: https://pastebin.com/RAhQYh6L

Amjad Ouled-Ameur (3):
  scripts/gdb: timerlist: use range instead of xrange
  scripts/gdb: timerlist: fix rb_node access
  scripts/gdb: timerlist: convert int chunks to str

 scripts/gdb/linux/timerlist.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

-- 
2.37.1


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

* [PATCH 1/3] scripts/gdb: timerlist: use range instead of xrange
  2022-07-27 14:14 [PATCH 0/3] scripts/gdb: timerlist: fix rb_node access and python errors Amjad Ouled-Ameur
@ 2022-07-27 14:14 ` Amjad Ouled-Ameur
  2022-07-27 14:14 ` [PATCH 2/3] scripts/gdb: timerlist: fix rb_node access Amjad Ouled-Ameur
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 6+ messages in thread
From: Amjad Ouled-Ameur @ 2022-07-27 14:14 UTC (permalink / raw)
  To: jan.kiszka; +Cc: linux-kernel, narmstrong, kbingham, Amjad Ouled-Ameur

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.

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.37.1


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

* [PATCH 2/3] scripts/gdb: timerlist: fix rb_node access
  2022-07-27 14:14 [PATCH 0/3] scripts/gdb: timerlist: fix rb_node access and python errors Amjad Ouled-Ameur
  2022-07-27 14:14 ` [PATCH 1/3] scripts/gdb: timerlist: use range instead of xrange Amjad Ouled-Ameur
@ 2022-07-27 14:14 ` Amjad Ouled-Ameur
  2022-07-27 14:14 ` [PATCH 3/3] scripts/gdb: timerlist: convert int chunks to str Amjad Ouled-Ameur
  2023-03-24 13:03 ` [PATCH 0/3] scripts/gdb: timerlist: fix rb_node access and python errors Florian Fainelli
  3 siblings, 0 replies; 6+ messages in thread
From: Amjad Ouled-Ameur @ 2022-07-27 14:14 UTC (permalink / raw)
  To: jan.kiszka; +Cc: linux-kernel, narmstrong, kbingham, Amjad Ouled-Ameur

"strcut 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.

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.37.1


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

* [PATCH 3/3] scripts/gdb: timerlist: convert int chunks to str
  2022-07-27 14:14 [PATCH 0/3] scripts/gdb: timerlist: fix rb_node access and python errors Amjad Ouled-Ameur
  2022-07-27 14:14 ` [PATCH 1/3] scripts/gdb: timerlist: use range instead of xrange Amjad Ouled-Ameur
  2022-07-27 14:14 ` [PATCH 2/3] scripts/gdb: timerlist: fix rb_node access Amjad Ouled-Ameur
@ 2022-07-27 14:14 ` Amjad Ouled-Ameur
  2023-03-24 13:03 ` [PATCH 0/3] scripts/gdb: timerlist: fix rb_node access and python errors Florian Fainelli
  3 siblings, 0 replies; 6+ messages in thread
From: Amjad Ouled-Ameur @ 2022-07-27 14:14 UTC (permalink / raw)
  To: jan.kiszka; +Cc: linux-kernel, narmstrong, kbingham, Amjad Ouled-Ameur

join() expects strings but integers are given.

Convert chunks list to strings before passing it to join()

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.37.1


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

* Re: [PATCH 0/3] scripts/gdb: timerlist: fix rb_node access and python errors
  2022-07-27 14:14 [PATCH 0/3] scripts/gdb: timerlist: fix rb_node access and python errors Amjad Ouled-Ameur
                   ` (2 preceding siblings ...)
  2022-07-27 14:14 ` [PATCH 3/3] scripts/gdb: timerlist: convert int chunks to str Amjad Ouled-Ameur
@ 2023-03-24 13:03 ` Florian Fainelli
  2023-03-26 14:26   ` Amjad Ouled-Ameur
  3 siblings, 1 reply; 6+ messages in thread
From: Florian Fainelli @ 2023-03-24 13:03 UTC (permalink / raw)
  To: Amjad Ouled-Ameur, jan.kiszka; +Cc: linux-kernel, narmstrong, kbingham

Hi Amjad, Jan,

On 7/27/2022 7:14 AM, Amjad Ouled-Ameur wrote:
> This patchset fixes use of lx-timerlist with kgdb.
> 
> It has been tested on Amlogic libretech-cc s905X and works fine [0]
> 
> [0]: https://pastebin.com/RAhQYh6L

Was right about to submit similar fixes. The whole series is:

Tested-by: Florian Fainelli <f.fainelli@gmail.com>

Jan, it would appear there were earlier attempts at fixing timerlist.py, 
however as of 6.3-rc3, none of those patches have been merged, can you 
take them? Thanks!
-- 
Florian

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

* Re: [PATCH 0/3] scripts/gdb: timerlist: fix rb_node access and python errors
  2023-03-24 13:03 ` [PATCH 0/3] scripts/gdb: timerlist: fix rb_node access and python errors Florian Fainelli
@ 2023-03-26 14:26   ` Amjad Ouled-Ameur
  0 siblings, 0 replies; 6+ messages in thread
From: Amjad Ouled-Ameur @ 2023-03-26 14:26 UTC (permalink / raw)
  To: Florian Fainelli, jan.kiszka
  Cc: linux-kernel, narmstrong, kbingham, ouledameur.amjad

Hi Florian,

Thank you for testing the series.


Regards,

Amjad

On 3/24/23 14:03, Florian Fainelli wrote:
> Hi Amjad, Jan,
>
> On 7/27/2022 7:14 AM, Amjad Ouled-Ameur wrote:
>> This patchset fixes use of lx-timerlist with kgdb.
>>
>> It has been tested on Amlogic libretech-cc s905X and works fine [0]
>>
>> [0]: https://pastebin.com/RAhQYh6L
>
> Was right about to submit similar fixes. The whole series is:
>
> Tested-by: Florian Fainelli <f.fainelli@gmail.com>
>
> Jan, it would appear there were earlier attempts at fixing timerlist.py, however as of 6.3-rc3, none of those patches have been merged, can you take them? Thanks!

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

end of thread, other threads:[~2023-03-26 14:26 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-27 14:14 [PATCH 0/3] scripts/gdb: timerlist: fix rb_node access and python errors Amjad Ouled-Ameur
2022-07-27 14:14 ` [PATCH 1/3] scripts/gdb: timerlist: use range instead of xrange Amjad Ouled-Ameur
2022-07-27 14:14 ` [PATCH 2/3] scripts/gdb: timerlist: fix rb_node access Amjad Ouled-Ameur
2022-07-27 14:14 ` [PATCH 3/3] scripts/gdb: timerlist: convert int chunks to str Amjad Ouled-Ameur
2023-03-24 13:03 ` [PATCH 0/3] scripts/gdb: timerlist: fix rb_node access and python errors Florian Fainelli
2023-03-26 14:26   ` Amjad Ouled-Ameur

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.