> > Your command above says to instrument all functions except those in > files whose names match linux/ or asm/ or runtime.c. The file > drivers/power/base/main.c does not match any of those strings, so it > gets instrumented. This seems consistent. > > Ian > Hi Ian, I had made some mistakes in editting the post message. Now I will post it again. $ make LD .tmp_vmlinux1 drivers/built-in.o: In function `dpm_resume': /home/prc/linux-2.6/drivers/base/power/main.c:574: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `to_device': /home/prc/linux-2.6/drivers/base/power/power.h:23: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `dpm_complete': /home/prc/linux-2.6/drivers/base/power/main.c:645: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `to_device': /home/prc/linux-2.6/drivers/base/power/power.h:23: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `dpm_prepare': /home/prc/linux-2.6/drivers/base/power/main.c:918: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `to_device': /home/prc/linux-2.6/drivers/base/power/power.h:23: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `dpm_suspend': /home/prc/linux-2.6/drivers/base/power/main.c:837: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `to_device': /home/prc/linux-2.6/drivers/base/power/power.h:23: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `pm_runtime_init': /home/prc/linux-2.6/drivers/base/power/runtime.c:1052: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `__pm_request_idle': /home/prc/linux-2.6/drivers/base/power/runtime.c:514: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `pm_request_idle': /home/prc/linux-2.6/drivers/base/power/runtime.c:551: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `__pm_runtime_set_status': /home/prc/linux-2.6/drivers/base/power/runtime.c:820: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `pm_runtime_deactivate_timer': /home/prc/linux-2.6/drivers/base/power/runtime.c:22: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `do_dump_stack': /home/prc/linux-2.6/include/linux/pm_runtime.h:48: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `__pm_request_suspend': /home/prc/linux-2.6/drivers/base/power/runtime.c:571: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `pm_suspend_timer_fn': /home/prc/linux-2.6/drivers/base/power/runtime.c:621: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `pm_runtime_cancel_pending': /home/prc/linux-2.6/drivers/base/power/runtime.c:37: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `pm_request_resume': /home/prc/linux-2.6/drivers/base/power/runtime.c:749: undefined reference to `__cyg_profile_func_enter' /home/prc/linux-2.6/drivers/base/power/runtime.c:753: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `spin_unlock_irqrestore': /home/prc/linux-2.6/include/linux/spinlock.h:336: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `__pm_runtime_idle': /home/prc/linux-2.6/drivers/base/power/runtime.c:55: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `pm_runtime_idle': /home/prc/linux-2.6/drivers/base/power/runtime.c:120: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `__pm_runtime_put': /home/prc/linux-2.6/drivers/base/power/runtime.c:791: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `__pm_runtime_resume': /home/prc/linux-2.6/drivers/base/power/runtime.c:310: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `pm_runtime_resume': /home/prc/linux-2.6/drivers/base/power/runtime.c:452: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `__pm_runtime_get': /home/prc/linux-2.6/drivers/base/power/runtime.c:770: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `__pm_runtime_suspend': /home/prc/linux-2.6/drivers/base/power/runtime.c:146: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `pm_runtime_work': /home/prc/linux-2.6/drivers/base/power/runtime.c:472: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `spin_unlock_irq': /home/prc/linux-2.6/include/linux/spinlock.h:331: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `pm_runtime_suspend': /home/prc/linux-2.6/drivers/base/power/runtime.c:283: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `pm_runtime_enable': /home/prc/linux-2.6/drivers/base/power/runtime.c:1032: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `__pm_runtime_barrier': /home/prc/linux-2.6/drivers/base/power/runtime.c:903: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `__pm_runtime_disable': /home/prc/linux-2.6/drivers/base/power/runtime.c:992: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `spin_unlock_irq': /home/prc/linux-2.6/include/linux/spinlock.h:331: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `pm_runtime_remove': /home/prc/linux-2.6/drivers/base/power/runtime.c:1085: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `pm_runtime_barrier': /home/prc/linux-2.6/drivers/base/power/runtime.c:955: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' drivers/built-in.o: In function `pm_schedule_suspend': /home/prc/linux-2.6/drivers/base/power/runtime.c:645: undefined reference to `__cyg_profile_func_enter' drivers/built-in.o: In function `__trace0': /home/prc/linux-2.6/include/linux/pm_runtime.h:37: undefined reference to `__cyg_profile_func_exit' make: *** [.tmp_vmlinux1] Error 1 $ cat drivers/base/power/Makefile ... ccflags-y := -finstrument-functions -finstrument-functions-exclude-file-list=linux/,asm/,generic_ops.c,main.c,sysfs.c,trace.c $ cat drivers/base/power/.main.o.cmd cmd_drivers/base/power/main.o := arm-none-linux-gnueabi-gcc -Wp,-MD,drivers/base/power/.main.o.d -nostdinc -isystem /opt/arm-2009q3-none-linux-gnueabi/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/include -I/home/prc/linux-2.6/arch/arm/include -Iinclude -include include/generated/autoconf.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-versatile/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -marm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=aapcs-linux -mno-thumb-interwork -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -Wframe-larger-than=1024 -fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack -finstrument-functions -finstrument-functions-exclude-file-list=linux/,asm/,generic_ops.c,main.c,sysfs.c,trace.c -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(main)" -D"KBUILD_MODNAME=KBUILD_STR(main)" -c -o drivers/base/power/main.o drivers/base/power/main.c $ cat drivers/base/power/.generic_ops.o.cmd cmd_drivers/base/power/generic_ops.o := arm-none-linux-gnueabi-gcc -Wp,-MD,drivers/base/power/.generic_ops.o.d -nostdinc -isystem /opt/arm-2009q3-none-linux-gnueabi/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/include -I/home/prc/linux-2.6/arch/arm/include -Iinclude -include include/generated/autoconf.h -D__KERNEL__ -mlittle-endian -Iarch/arm/mach-versatile/include -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -fno-delete-null-pointer-checks -Os -marm -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mabi=aapcs-linux -mno-thumb-interwork -D__LINUX_ARM_ARCH__=7 -march=armv7-a -msoft-float -Uarm -Wframe-larger-than=1024 -fno-stack-protector -fno-omit-frame-pointer -fno-optimize-sibling-calls -g -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fno-dwarf2-cfi-asm -fconserve-stack -finstrument-functions -finstrument-functions-exclude-file-list=linux/,asm/,generic_ops.c,main.c,sysfs.c,trace.c -D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(generic_ops)" -D"KBUILD_MODNAME=KBUILD_STR(generic_ops)" -c -o drivers/base/power/generic_ops.o drivers/base/power/generic_ops.c I want to inform gcc to insert __cyg_profile_func_enter/__cyg_profile_func_exit callbacks just for the functions within the file `runtime.c'. As you can see, main.c and generic_ops.c are both in the exclude list. gcc still generates __cyg_profile_func_enter/__cyg_profile_func_exit for them. And /home/prc/linux-2.6/include/linux/pm_runtime.h shall match linux/, but __cyg_profile_func_enter/__cyg_profile_func_exit are still created. BTW, the gcc version is 4.4.1 - PRC