public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Pan ruochen <panruochen@gmail.com>
To: gcc-help <gcc-help@gcc.gnu.org>
Subject: -finstrument-functions-exclude-file-list can't work in some case
Date: Wed, 01 Jun 2011 06:27:00 -0000	[thread overview]
Message-ID: <BANLkTin1KipM4nY+E3P6kSGsFaRiHkFD0g@mail.gmail.com> (raw)

Hi All,

I want to use -finstrument-functions options to trace some function
calls of kernel.

$cat drivers/base/power/.runtime.o.cmd
arm-none-linux-gnueabi-gcc -Wp,-MD,drivers/base/power/.runtime.o.d
-nostdinc -isystem
/opt/arm-2009q3-none-linux-gnueabi/bin/../lib/gcc/arm-none-linux-gnueabi/4.4.1/include
-I/home/PRC/git/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/,runtime.c
-D"KBUILD_STR(s)=\#s" -D"KBUILD_BASENAME=KBUILD_STR(runtime)"
-D"KBUILD_MODNAME=KBUILD_STR(runtime)"  -c -o
drivers/base/power/runtime.o drivers/base/power/runtime.c

I wish gcc invoke __cyg_profile_func_enter/__cyg_profile_func_exit
only from the functions within `runtime.c' in the driver/base/power.
It is not successful.

$nm drivers/power/base/main.o
...
 U __cyg_profile_func_enter
 U __cyg_profile_func_exit


But with the some gcc, I handle another simple source file,
$cat 1.c
void function1_1() {}

$ arm-none-linux-gnueabi-gcc -Os -finstrument-functions
-finstrument-functions-exclude-file-list=1.c -c 1.c
$ nm 1.o
00000000 t $a
00000000 r $d
         U __aeabi_unwind_cpp_pr0
00000000 T function1_1
$ arm-none-linux-gnueabi-gcc -Os -finstrument-functions -c 1.c
$ nm 1.o
00000000 t $a
00000024 t $d
00000000 r $d
         U __aeabi_unwind_cpp_pr0
         U __cyg_profile_func_enter
         U __cyg_profile_func_exit
00000000 T function1_1

I guess -finstrument-functions and
-finstrument-functions-exclude-file-list are affected by some other
options.
So what's wrong.

-
PRC

             reply	other threads:[~2011-06-01  6:27 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-01  6:27 Pan ruochen [this message]
2011-06-01  6:57 ` Ian Lance Taylor
2011-06-02  1:55   ` Pan ruochen
2011-06-02  5:18     ` Ian Lance Taylor
     [not found]       ` <BANLkTi=qhLxNnBhufXYjBwNfzgAOzeVF1w@mail.gmail.com>
2011-06-02 17:08         ` Ian Lance Taylor
2011-06-03 10:26           ` Pan ruochen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=BANLkTin1KipM4nY+E3P6kSGsFaRiHkFD0g@mail.gmail.com \
    --to=panruochen@gmail.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).