가끔 아래와 같이 printk를 추가해서 로그를 보려고 빌드를 하면, 컴파일러가 아래와 같이 에러를 토해내고 컴파일이 중지되는 경우가 있다.
printk("=====!!!!!current task[%s]=======\n", current->comm);

/android/kernel/arch/arm/mach-tegra/timer.c:111:58: error: dereferencing pointer to incomplete type
make[3]: *** [arch/arm/mach-tegra/timer.o] Error 1
make[2]: *** [arch/arm/mach-tegra] Error 2
make[2]: *** Waiting for unfinished jobs....
  CHK     kernel/config_data.h
make[1]: *** [sub-make] Error 2

printk("=====!!!!!current task[%s]=======\n", current->comm);

이 때는 아래와 같은 해더 파일을 추가하면 된다.
#include <linux/sched.h>

printk("[callstack %s,%d] task[%s]========= \n", __func__,__LINE__, current->comm);

+ Recent posts