libcflag: define the "noinline" macro
Subsystems (2)
PATCH 1/1 libcflag: define the "noinline" macro
Define "noline" macro to reduce the amount of typing for functions using the "noinline" attribute.
Signed-off-by Bill Wendling <[email protected]>
--- lib/libcflat.h | 1 + x86/pmu_lbr.c | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-)
lib/libcflat.h +1 -0
@@ -29,6 +29,7 @@#include <stdbool.h> #define __unused __attribute__((__unused__)) +#define noinline __attribute__((noinline)) #define xstr(s...) xxstr(s) #define xxstr(s...) #s
x86/pmu_lbr.c +2 -2
@@ -16,14 +16,14 @@volatile int count; -static __attribute__((noinline))int compute_flag (int i) +static noinline int compute_flag(int i) {if (i %10 <4 )return i +1 ;return 0 ; } -static __attribute__((noinline))int lbr_test (void ) +static noinline int lbr_test(void) {int i;int flag;
Signature · 1 line
2.33.0.259.gc128427fd7-goog
Quoted 5 lines · Bill Wendling
Define "noline" macro to reduce the amount of typing for functions using the "noinline" attribute.
Signed-off-by Bill Wendling <[email protected]>---
Reviewed-by Sean Christopherson <[email protected]>
For your own sanity, you'll probably want to send this as part of your other series to fix clang's zealous inlining, there's a decent chance Paolo won't get to this for several weeks.