diff options
Diffstat (limited to 'scripts/gdb/linux/timerlist.py')
| -rw-r--r-- | scripts/gdb/linux/timerlist.py | 12 | 
1 files changed, 7 insertions, 5 deletions
| diff --git a/scripts/gdb/linux/timerlist.py b/scripts/gdb/linux/timerlist.py index 071d0dd5a634..64bc87191003 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_leftmost']      idx = 0      while curr:          yield print_timer(curr, idx) @@ -73,7 +72,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]) @@ -158,6 +157,8 @@ def pr_cpumask(mask):      num_bytes = (nr_cpu_ids + 7) / 8      buf = utils.read_memoryview(inf, bits, num_bytes).tobytes()      buf = binascii.b2a_hex(buf) +    if type(buf) is not str: +        buf=buf.decode()      chunks = []      i = num_bytes @@ -173,7 +174,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): @@ -187,7 +188,8 @@ class LxTimerList(gdb.Command):          max_clock_bases = gdb.parse_and_eval("HRTIMER_MAX_CLOCK_BASES")          text = "Timer List Version: gdb scripts\n" -        text += "HRTIMER_MAX_CLOCK_BASES: {}\n".format(max_clock_bases) +        text += "HRTIMER_MAX_CLOCK_BASES: {}\n".format( +            max_clock_bases.type.fields()[max_clock_bases].enumval)          text += "now at {} nsecs\n".format(ktime_get())          for cpu in cpus.each_online_cpu(): | 
