Re: problem with -finstrument functions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 5, 2015 at 4:28 PM, Shrikanth Hegde <sshegde99@xxxxxxxxx> wrote:
> Hello,
>
> I am trying to use -finstrument-function provided by gcc.(4.9.2).
>
> It is large code base. i have defined a header file, and source file
> containing declaration and definition of following functions...

The header is not needed.

>
>
> __attribute__((no_instrument_function)) void __cyg_profile_func_enter
> (void *this_fn, void *call_site);
>
> __attribute__((no_instrument_function)) void __cyg_profile_func_exit
> (void *this_fn, void *call_site);
>
>
> and definitions as-->
>
>
> void __cyg_profile_func_enter (void *this_fn, void *call_site)
> {
> printf("Function Entering : %p %p \n", this_fn, call_site);
> }
>
> void __cyg_profile_func_exit (void *this_fn, void *call_site)
> {
> printf("Function Exiting : %p %p \n", this_fn, call_site);
> }

I would rather compile this file without the -finstrument-function
flag, though you can also add the attribute into the C file.

>
>
>
> Problem:
> When i compile source code without instrumentation, it compiles. But
> with instrumentation, I get lot of errors "undefined Reference to
> 'symbols' . There is change in the linking process.

What is 'symbol'? Any examples to give? Though you may hit this bug:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=52544

Which means, you should not instrument inline and always_inline functions.


HTH,
Bert

>
> Does -finstrument-function changes the linking process. If yes, how?
>
> Please help me, not much data available on net regarding the same..
>
>
> --
> Shrikanth Hegde
> +91 9738172579




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux