This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH RFC: More control over which functions are instrumented


Ian Lance Taylor <iant@google.com> writes:

> This patch was developed a while back by Yaz Saito at Google.  It adds
> two new options: -finstrument-functions-exclude-file-list and
> -finstrument-functions-exclude-function-list which give more control
> over which functions are instrumented.

I have committed this patch.

I also added some simple test cases, as follows.

Ian


2007-08-07  Ian Lance Taylor  <iant@google.com>

	* gcc.dg/instrument-1.c: New test.
	* gcc.dg/instrument-2.c: New test.
	* gcc.dg/instrument-3.c: New test.


instrument-1.c:

/* { dg-do compile } */
/* { dg-options "-finstrument-functions" } */

void fn () { }

/* { dg-final { scan-assembler "__cyg_profile_func_enter" } } */
/* { dg-final { scan-assembler "__cyg_profile_func_exit" } } */


instrument-2.c:

/* { dg-do compile } */
/* { dg-options "-finstrument-functions -finstrument-functions-exclude-function-list=fn" } */

void fn () { }

/* { dg-final { scan-assembler-not "__cyg_profile_func_enter" } } */
/* { dg-final { scan-assembler-not "__cyg_profile_func_exit" } } */


instrument-3.c:

/* { dg-do compile } */
/* { dg-options "-finstrument-functions -finstrument-functions-exclude-file-list=instrument-3" } */

void fn () { }

/* { dg-final { scan-assembler-not "__cyg_profile_func_enter" } } */
/* { dg-final { scan-assembler-not "__cyg_profile_func_exit" } } */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]