Skip to content

Commit 217bb19

Browse files
microbuildernashif
authored andcommitted
toolchain: gcc: Add __no_instrumentation__ definition
Adds a new '__no_instrumentation__' preprocessor definition for GCC, mapping it to '__attribute__((__no_instrument_function__))'. This new macro is used to disable code instrumentation (enabled when '-finstrument-functions' flag is passed to the compiler) for specific functions when placed before a function definition. Signed-off-by: Kevin Townsend <[email protected]> Signed-off-by: Gustavo Romero <[email protected]>
1 parent 03fcfcd commit 217bb19

File tree

1 file changed

+6
-0
lines changed
  • include/zephyr/toolchain

1 file changed

+6
-0
lines changed

include/zephyr/toolchain/gcc.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -667,6 +667,12 @@ do { \
667667
#define FUNC_NO_STACK_PROTECTOR
668668
#endif
669669

670+
#if defined(CONFIG_INSTRUMENTATION)
671+
#define __no_instrumentation__ __attribute__((__no_instrument_function__))
672+
#else
673+
#define __no_instrumentation__ /**/
674+
#endif
675+
670676
#endif /* !_LINKER */
671677

672678
#define TOOLCHAIN_WARNING_ADDRESS_OF_PACKED_MEMBER "-Waddress-of-packed-member"

0 commit comments

Comments
 (0)