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] Add -fno-instrument-function


On Thu, Sep 4, 2014 at 8:04 AM, Andi Kleen <andi@firstfloor.org> wrote:
>> No, not a new "fake" option either but just initialize
>> DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT properly when
>> not doing -pg or -mfentry (that is, set it to 1).
>
> The only way would be to handle it in build_decl itself.
> There seem to be a bazillion callers all over the tree that all do their
> custom thing.
>
> It would also need a new target hook to check for fentry.
>
> Far more complicated patch.

Well, then make it the opposite as I suggested - mark functions
to be instrumented - DECL_INSTRUMENT_FUNCTION_ENTRY_EXIT
and do that in the instrumentation code or the target hook that
gets called when a struct function is initialized.

Or as all this is only a hack for LTO, "set"
DECL_NO_INSTRUMENT_FUNCTION_ENTRY_EXIT in
tree-streamer-out.c:pack_ts_function_decl_value_fields.

Yes, you need a target hook for -mfentry, but that's way better
than a user-visible option for such kind of "hack".

Richard.

> -Andi
>
>
> --
> ak@linux.intel.com -- Speaking for myself only.


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