File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change 33
33
# define __GCC4_has_attribute___externally_visible__ 1
34
34
# define __GCC4_has_attribute___no_caller_saved_registers__ 0
35
35
# define __GCC4_has_attribute___noclone__ 1
36
+ # define __GCC4_has_attribute___no_profile_instrument_function__ 0
36
37
# define __GCC4_has_attribute___nonstring__ 0
37
38
# define __GCC4_has_attribute___no_sanitize_address__ (__GNUC_MINOR__ >= 8)
38
39
# define __GCC4_has_attribute___no_sanitize_undefined__ (__GNUC_MINOR__ >= 9)
237
238
# define __nonstring
238
239
#endif
239
240
241
+ /*
242
+ * Optional: only supported since GCC >= 7.1, clang >= 13.0.
243
+ *
244
+ * gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-no_005fprofile_005finstrument_005ffunction-function-attribute
245
+ * clang: https://clang.llvm.org/docs/AttributeReference.html#no-profile-instrument-function
246
+ */
247
+ #if __has_attribute (__no_profile_instrument_function__ )
248
+ # define __no_profile __attribute__((__no_profile_instrument_function__))
249
+ #else
250
+ # define __no_profile
251
+ #endif
252
+
240
253
/*
241
254
* gcc: https://gcc.gnu.org/onlinedocs/gcc/Common-Function-Attributes.html#index-noreturn-function-attribute
242
255
* clang: https://clang.llvm.org/docs/AttributeReference.html#noreturn
Original file line number Diff line number Diff line change @@ -210,7 +210,7 @@ struct ftrace_likely_data {
210
210
/* Section for code which can't be instrumented at all */
211
211
#define noinstr \
212
212
noinline notrace __attribute((__section__(".noinstr.text"))) \
213
- __no_kcsan __no_sanitize_address
213
+ __no_kcsan __no_sanitize_address __no_profile
214
214
215
215
#endif /* __KERNEL__ */
216
216
You can’t perform that action at this time.
0 commit comments