可用的核心参数可以参考Documents/kernel-parameters.txt
或者看代码的时候有调试功能的函数对应的开关变量。
kernel参数里面加入:initcall_debug即可调用do_one_initcall_debug
int __init_or_module do_one_initcall(initcall_t fn)
{
int count = preempt_count();
int ret;
char msgbuf[64];
if (initcall_blacklisted(fn))
return -EPERM;
if (initcall_debug)
ret = do_one_initcall_debug(fn);
else
ret = fn();
static int __init_or_module
do_one_initcall_debug(initcall_t fn)
{
ktime_t calltime, delta, rettime;
unsigned long long duration;
int ret;
printk(KERN_DEBUG "calling %pF @ %i\n", fn, task_pid_nr(current));
calltime = ktime_get();
ret = fn();
rettime = ktime_get();
delta = ktime_sub(rettime, calltime);
duration = (unsigned long long) ktime_to_ns(delta) >> 10;
printk(KERN_DEBUG "initcall %pF returned %d after %lld usecs\n",
fn, ret, duration);
return ret;
}
以calling开始,以initcall结束:
[ 2.359680] calling acpi_thermal_init+0x0/0x3c @ 1
[ 2.360809] ACPI: [Package] has zero elements (f5636f00)
[ 2.360813] ACPI: Invalid passive threshold
[ 2.365070] thermal LNXTHERM:00: registered as thermal_zone0
[ 2.365078] ACPI: Thermal Zone [THRM] (55 C)
[ 2.365180] initcall acpi_thermal_init+0x0/0x3c returned 0 after 5365 usecs
可以看出ACPI: [Package] has zero elements这个信息出现在acpi_thermal_init()函数中