This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Add -fno-instrument-function
- From: Richard Biener <richard dot guenther at gmail dot com>
- To: Andi Kleen <andi at firstfloor dot org>
- Cc: Andi Kleen <ak at linux dot intel dot com>, GCC Patches <gcc-patches at gcc dot gnu dot org>
- Date: Thu, 4 Sep 2014 15:11:05 +0200
- Subject: Re: [PATCH] Add -fno-instrument-function
- Authentication-results: sourceware.org; auth=none
- References: <1409603138-18755-1-git-send-email-andi at firstfloor dot org> <CAFiYyc3=wWNqWUy5NEFxWBphKGBhFnGb2-JNb=zT-5o5cOnr4Q at mail dot gmail dot com> <20140902150015 dot GG25920 at tassilo dot jf dot intel dot com> <CAFiYyc1D=-0aGV-zNUT65VQzBdaq+C3XAkhnR0D_b8Dbju4BwQ at mail dot gmail dot com> <20140904060432 dot GC4120 at two dot firstfloor dot org>
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.