All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libcflag: define the "noinline" macro
@ 2021-08-26 21:04 Bill Wendling
  2021-08-27 21:00 ` Sean Christopherson
  0 siblings, 1 reply; 2+ messages in thread
From: Bill Wendling @ 2021-08-26 21:04 UTC (permalink / raw)
  To: kvm, Paolo Bonzini, Roman Bolshakov, David Matlack, Sean Christopherson
  Cc: Bill Wendling

Define "noline" macro to reduce the amount of typing for functions using
the "noinline" attribute.

Signed-off-by: Bill Wendling <morbo@google.com>
---
 lib/libcflat.h | 1 +
 x86/pmu_lbr.c  | 4 ++--
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/libcflat.h b/lib/libcflat.h
index 97db9e3..a652c76 100644
--- a/lib/libcflat.h
+++ b/lib/libcflat.h
@@ -29,6 +29,7 @@
 #include <stdbool.h>
 
 #define __unused __attribute__((__unused__))
+#define noinline __attribute__((noinline))
 
 #define xstr(s...) xxstr(s)
 #define xxstr(s...) #s
diff --git a/x86/pmu_lbr.c b/x86/pmu_lbr.c
index 3bd9e9f..5ff805a 100644
--- a/x86/pmu_lbr.c
+++ b/x86/pmu_lbr.c
@@ -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;
-- 
2.33.0.259.gc128427fd7-goog


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

* Re: [PATCH] libcflag: define the "noinline" macro
  2021-08-26 21:04 [PATCH] libcflag: define the "noinline" macro Bill Wendling
@ 2021-08-27 21:00 ` Sean Christopherson
  0 siblings, 0 replies; 2+ messages in thread
From: Sean Christopherson @ 2021-08-27 21:00 UTC (permalink / raw)
  To: Bill Wendling; +Cc: kvm, Paolo Bonzini, Roman Bolshakov, David Matlack

On Thu, Aug 26, 2021, Bill Wendling wrote:
> Define "noline" macro to reduce the amount of typing for functions using
> the "noinline" attribute.
> 
> Signed-off-by: Bill Wendling <morbo@google.com>
> ---

Reviewed-by: Sean Christopherson <seanjc@google.com>

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.

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

end of thread, other threads:[~2021-08-27 21:01 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-08-26 21:04 [PATCH] libcflag: define the "noinline" macro Bill Wendling
2021-08-27 21:00 ` Sean Christopherson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.