public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Define __attribute__((no_instrument_function)) but still got instrumented
@ 2020-08-07  6:33 Shuai Wang
  2020-08-07  6:54 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: Shuai Wang @ 2020-08-07  6:33 UTC (permalink / raw)
  To: GCC Development

Hello!

I am working on a ARM GCC plugin which instruments each GIMPLE function
with some new function calls.

Currently I want to skip certain functions by adding the
no_instrument_function attribute. However, I do see that in the
disassembled code, all functions are still instrumented.

Am I missed anything here? From this page (
https://www.keil.com/support/man/docs/armcc/armcc_chr1359124976163.htm), I
do see that no_instrument_function is used to skip --gnu_instrument, but
might not be applicable to my case where I use the following command to
compile:

arm-none-eabi-g++ -fplugin=my_plugin.so -mcpu=cortex-m4 -mthumb
-mfloat-abi=soft -Og -fmessage-length=0 -fsigned-char -ffunction-sections
-fdata-sections -fno-move-loop-invariants -Wall -Wextra  -g3 -DDEBUG
-DUSE_FULL_ASSERT -DOS_USE_SEMIHOSTING -DTRACE -DOS_USE_TRACE_SEMIH
OSTING_DEBUG -DSTM32F429xx -DUSE_HAL_DRIVER -DHSE_VALUE=8000000
-DLOS_KERNEL_DEBUG_OUT

But overall, could anyone shed some lights on: 1) how to skip instrument
certain functions with GCC plugin? 2: is it possible to check the function
attribute in GIMPLE code? If so, I can simply check if certain functions
are marked as "no_instrument_function" and skip by myself.

Thank you!
Shuai

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Define __attribute__((no_instrument_function)) but still got instrumented
  2020-08-07  6:33 Define __attribute__((no_instrument_function)) but still got instrumented Shuai Wang
@ 2020-08-07  6:54 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2020-08-07  6:54 UTC (permalink / raw)
  To: Shuai Wang; +Cc: GCC Development

On Fri, Aug 7, 2020 at 8:35 AM Shuai Wang via Gcc <gcc@gcc.gnu.org> wrote:
>
> Hello!
>
> I am working on a ARM GCC plugin which instruments each GIMPLE function
> with some new function calls.
>
> Currently I want to skip certain functions by adding the
> no_instrument_function attribute. However, I do see that in the
> disassembled code, all functions are still instrumented.
>
> Am I missed anything here? From this page (
> https://www.keil.com/support/man/docs/armcc/armcc_chr1359124976163.htm), I
> do see that no_instrument_function is used to skip --gnu_instrument, but
> might not be applicable to my case where I use the following command to
> compile:
>
> arm-none-eabi-g++ -fplugin=my_plugin.so -mcpu=cortex-m4 -mthumb
> -mfloat-abi=soft -Og -fmessage-length=0 -fsigned-char -ffunction-sections
> -fdata-sections -fno-move-loop-invariants -Wall -Wextra  -g3 -DDEBUG
> -DUSE_FULL_ASSERT -DOS_USE_SEMIHOSTING -DTRACE -DOS_USE_TRACE_SEMIH
> OSTING_DEBUG -DSTM32F429xx -DUSE_HAL_DRIVER -DHSE_VALUE=8000000
> -DLOS_KERNEL_DEBUG_OUT
>
> But overall, could anyone shed some lights on: 1) how to skip instrument
> certain functions with GCC plugin? 2: is it possible to check the function
> attribute in GIMPLE code? If so, I can simply check if certain functions
> are marked as "no_instrument_function" and skip by myself.

You can check lookup_attribute("no_instrument_function",
DECL_ATTRIBUTES (cfun->decl))

> Thank you!
> Shuai

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-08-07  6:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-07  6:33 Define __attribute__((no_instrument_function)) but still got instrumented Shuai Wang
2020-08-07  6:54 ` Richard Biener

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).