- Make use of the per-cpu function for the current or a specified CPU::
- (gdb) p $lx_per_cpu("runqueues").nr_running
+ (gdb) p $lx_per_cpu(runqueues).nr_running
$3 = 1
- (gdb) p $lx_per_cpu("runqueues", 2).nr_running
+ (gdb) p $lx_per_cpu(runqueues, 2).nr_running
$4 = 0
- Dig into hrtimers using the container_of helper::
- (gdb) set $next = $lx_per_cpu("hrtimer_bases").clock_base[0].active.next
- (gdb) p *$container_of($next, "struct hrtimer", "node")
+ (gdb) set $leftmost = $lx_per_cpu(hrtimer_bases).clock_base[0].active.rb_root.rb_leftmost
+ (gdb) p *$container_of($leftmost, "struct hrtimer", "node")
$5 = {
node = {
node = {
- __rb_parent_color = 18446612133355256072,
- rb_right = 0x0 <irq_stack_union>,
- rb_left = 0x0 <irq_stack_union>
+ __rb_parent_color = 18446612686384860673,
+ rb_right = 0xffff888231da8b00,
+ rb_left = 0x0
},
- expires = {
- tv64 = 1835268000000
- }
+ expires = 1228461000000
},
- _softexpires = {
- tv64 = 1835268000000
- },
- function = 0xffffffff81078232 <tick_sched_timer>,
- base = 0xffff88003fd0d6f0,
- state = 1,
- start_pid = 0,
- start_site = 0xffffffff81055c1f <hrtimer_start_range_ns+20>,
- start_comm = "swapper/2\000\000\000\000\000\000"
+ _softexpires = 1228461000000,
+ function = 0xffffffff8137ab20 <tick_nohz_handler>,
+ base = 0xffff888231d9b4c0,
+ state = 1 '\001',
+ is_rel = 0 '\000',
+ is_soft = 0 '\000',
+ is_hard = 1 '\001'
}
- 对当前或指定的CPU使用per-cpu函数::
- (gdb) p $lx_per_cpu("runqueues").nr_running
+ (gdb) p $lx_per_cpu(runqueues).nr_running
$3 = 1
- (gdb) p $lx_per_cpu("runqueues", 2).nr_running
+ (gdb) p $lx_per_cpu(runqueues, 2).nr_running
$4 = 0
- 使用container_of查看更多hrtimers信息::
- (gdb) set $next = $lx_per_cpu("hrtimer_bases").clock_base[0].active.next
- (gdb) p *$container_of($next, "struct hrtimer", "node")
+ (gdb) set $leftmost = $lx_per_cpu(hrtimer_bases).clock_base[0].active.rb_root.rb_leftmost
+ (gdb) p *$container_of($leftmost, "struct hrtimer", "node")
$5 = {
node = {
node = {
- __rb_parent_color = 18446612133355256072,
- rb_right = 0x0 <irq_stack_union>,
- rb_left = 0x0 <irq_stack_union>
+ __rb_parent_color = 18446612686384860673,
+ rb_right = 0xffff888231da8b00,
+ rb_left = 0x0
},
- expires = {
- tv64 = 1835268000000
- }
+ expires = 1228461000000
},
- _softexpires = {
- tv64 = 1835268000000
- },
- function = 0xffffffff81078232 <tick_sched_timer>,
- base = 0xffff88003fd0d6f0,
- state = 1,
- start_pid = 0,
- start_site = 0xffffffff81055c1f <hrtimer_start_range_ns+20>,
- start_comm = "swapper/2\000\000\000\000\000\000"
+ _softexpires = 1228461000000,
+ function = 0xffffffff8137ab20 <tick_nohz_handler>,
+ base = 0xffff888231d9b4c0,
+ state = 1 '\001',
+ is_rel = 0 '\000',
+ is_soft = 0 '\000',
+ is_hard = 1 '\001'
}
- 對當前或指定的CPU使用per-cpu函數::
- (gdb) p $lx_per_cpu("runqueues").nr_running
+ (gdb) p $lx_per_cpu(runqueues).nr_running
$3 = 1
- (gdb) p $lx_per_cpu("runqueues", 2).nr_running
+ (gdb) p $lx_per_cpu(runqueues, 2).nr_running
$4 = 0
- 使用container_of查看更多hrtimers信息::
- (gdb) set $next = $lx_per_cpu("hrtimer_bases").clock_base[0].active.next
- (gdb) p *$container_of($next, "struct hrtimer", "node")
+ (gdb) set $leftmost = $lx_per_cpu(hrtimer_bases).clock_base[0].active.rb_root.rb_leftmost
+ (gdb) p *$container_of($leftmost, "struct hrtimer", "node")
$5 = {
node = {
node = {
- __rb_parent_color = 18446612133355256072,
- rb_right = 0x0 <irq_stack_union>,
- rb_left = 0x0 <irq_stack_union>
+ __rb_parent_color = 18446612686384860673,
+ rb_right = 0xffff888231da8b00,
+ rb_left = 0x0
},
- expires = {
- tv64 = 1835268000000
- }
+ expires = 1228461000000
},
- _softexpires = {
- tv64 = 1835268000000
- },
- function = 0xffffffff81078232 <tick_sched_timer>,
- base = 0xffff88003fd0d6f0,
- state = 1,
- start_pid = 0,
- start_site = 0xffffffff81055c1f <hrtimer_start_range_ns+20>,
- start_comm = "swapper/2\000\000\000\000\000\000"
+ _softexpires = 1228461000000,
+ function = 0xffffffff8137ab20 <tick_nohz_handler>,
+ base = 0xffff888231d9b4c0,
+ state = 1 '\001',
+ is_rel = 0 '\000',
+ is_soft = 0 '\000',
+ is_hard = 1 '\001'
}
class PerCpu(gdb.Function):
"""Return per-cpu variable.
-$lx_per_cpu("VAR"[, CPU]): Return the per-cpu variable called VAR for the
+$lx_per_cpu(VAR[, CPU]): Return the per-cpu variable called VAR for the
given CPU number. If CPU is omitted, the CPU of the current context is used.
Note that VAR has to be quoted as string."""
class PerCpuPtr(gdb.Function):
"""Return per-cpu pointer.
-$lx_per_cpu_ptr("VAR"[, CPU]): Return the per-cpu pointer called VAR for the
+$lx_per_cpu_ptr(VAR[, CPU]): Return the per-cpu pointer called VAR for the
given CPU number. If CPU is omitted, the CPU of the current context is used.
Note that VAR has to be quoted as string."""