[PATCH 0/8] dyndbg: WIP diet plan

jim.cromie at gmail.com jim.cromie at gmail.com
Wed Aug 5 18:15:31 EDT 2020


> Im sending to kernelnewbies 1st, to see if theres any low-speed
> test-crashes I can get post-mortems of, before I take it to the races.
>
>

So, I might as well narrate a bit here, see if I can get to a
compelling story ..

$ gdb -x ../cmds vmlinux

$ more ../cmds
target remote :1234
# hbreak ddebug_zpool_init
# c
# return

hbreak run_init_process
break dynamic_emit_prefix
break __dynamic_pr_debug
c


OK, so in the middle of stepping / nexting I get into apic-* stuff

its hard to read w/o the colorized context..

ddebug_callsite_put (dp=<optimized out>) at ../lib/dynamic_debug.c:650
650 ddebug_callsite_put(dp);
(gdb) s
177 if (dp->flags & _DPRINTK_FLAGS_PRINT)
(gdb)
dynamic_emit_prefix (dp=0xffffffff827a7458 <__UNIQUE_ID_ddebug356.11>,
    buf=0xffffc90000013ea0 "main:run_init_process: ") at
../lib/dynamic_debug.c:652
652 return buf;
(gdb)
printk (fmt=0xffffffff824773b6 "\001\067%s%pV") at
../kernel/printk/printk.c:2069
2069 va_start(args, fmt);
(gdb)
2070 r = vprintk_func(fmt, args);
(gdb)
vprintk_func (fmt=0xffffffff824773b6 "\001\067%s%pV", args=0xffffc90000013e18)
    at ../kernel/printk/printk_safe.c:374
374 if ((this_cpu_read(printk_context) & PRINTK_NMI_DIRECT_CONTEXT_MASK) &&



(gdb) bt
#0  vprintk_func (fmt=0xffffffff824773b6 "\001\067%s%pV",
args=0xffffc90000013e18)
    at ../kernel/printk/printk_safe.c:374
#1  0xffffffff811475bc in printk (fmt=<optimized out>) at
../kernel/printk/printk.c:2070
#2  0xffffffff814aec2a in __dynamic_pr_debug (descriptor=<optimized
out>, fmt=<optimized out>)
    at ../lib/dynamic_debug.c:669
#3  0xffffffff810010a1 in run_init_process
(init_filename=0xffff888007fd6545 "/bin/sh")
    at ../init/main.c:1326
#4  0xffffffff81c64741 in kernel_init (unused=<optimized out>) at
../init/main.c:1434
#5  0xffffffff81001f62 in ret_from_fork () at ../arch/x86/entry/entry_64.S:293
#6  0x0000000000000000 in ?? ()
(gdb) ret
Make vprintk_func return now? (y or n) y
#0  printk (fmt=<optimized out>) at ../kernel/printk/printk.c:2073
2073 return r;

HERE, I NEXT INTO LAPIC, SHUTDOWN mumble.
is there anything I can unconfigure to avoid
how can I avoid these kind of things ?
is there something I can un-configure for a virtual kernel

(gdb) n
lapic_timer_shutdown (evt=<optimized out>) at ../arch/x86/kernel/apic/apic.c:490
490 apic_write(APIC_LVTT, v);
(gdb) n
491 apic_write(APIC_TMICT, 0);
(gdb)
492 return 0;
(gdb)
clockevents_switch_state (dev=0xffff888007a174c0,
state=CLOCK_EVT_STATE_ONESHOT_STOPPED)
    at ../kernel/time/clockevents.c:154
154 clockevent_set_state(dev, state);
(gdb)
152 return dev->state_use_accessors == CLOCK_EVT_STATE_ONESHOT;
(gdb)
tick_program_event (expires=9223372036854775807, force=<optimized out>)
    at ../kernel/time/tick-oneshot.c:32
32 dev->next_event = KTIME_MAX;
(gdb)
33 return 0;
(gdb)
remove_hrtimer (restart=<optimized out>, base=<optimized out>,
timer=<optimized out>)
    at ../kernel/time/hrtimer.c:1038
1038 return 1;
(gdb)
__hrtimer_start_range_ns (timer=0xffff888007a1e5c0, tim=1101350314, delta_ns=0,
    mode=<optimized out>, base=0xffff888007a1e0c0) at
../kernel/time/hrtimer.c:1093
1093 if (mode & HRTIMER_MODE_REL)
(gdb)
1098 hrtimer_set_expires_range_ns(timer, tim, delta_ns);
(gdb)
1101 new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED);
(gdb)
334 return res;
(gdb)
1101 new_base = switch_hrtimer_base(timer, base, mode & HRTIMER_MODE_PINNED);
(gdb)
1103 return enqueue_hrtimer(timer, new_base, mode);
(gdb)
hrtimer_start_range_ns (timer=0xffff888007a1e5c0, tim=1101350314,
delta_ns=<optimized out>,
    mode=HRTIMER_MODE_ABS_PINNED_HARD) at ../kernel/time/hrtimer.c:1134
1134 hrtimer_reprogram(timer, true);
(gdb)
1136 unlock_hrtimer_base(timer, &flags);
(gdb)
898 raw_spin_unlock_irqrestore(&timer->base->cpu_base->lock, *flags);
(gdb)
__tick_nohz_idle_stop_tick (ts=<optimized out>) at
../kernel/time/tick-sched.c:978
978 if (!was_stopped && ts->tick_stopped) {
(gdb)
979 ts->idle_jiffies = ts->last_jiffies;
(gdb)
980 nohz_balance_enter_idle(cpu);
(gdb)
cpuidle_idle_call () at ../kernel/sched/idle.c:161
161 rcu_idle_enter();
(gdb)
163 default_idle_call();
(gdb)
164 goto exit_idle;
(gdb)



More information about the Kernelnewbies mailing list