[PATCH 5/6] x86-64: Omit frame pointers on vread_tsc
From: Andy Lutomirski
Date: Mon Mar 28 2011 - 11:07:42 EST
vread_tsc is short and hot, and it's userspace code so the usual
reasons to keep frame pointers around don't apply.
Signed-off-by: Andy Lutomirski <luto@xxxxxxx>
---
It might be nicer to move vread_tsc into a separate file and change
the options directly.
arch/x86/kernel/tsc.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index a159fba..1aea4a6 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -764,6 +764,8 @@ static cycle_t read_tsc(struct clocksource *cs)
}
#ifdef CONFIG_X86_64
+#pragma GCC push_options
+#pragma GCC optimize ("omit-frame-pointer")
static cycle_t __vsyscall_fn vread_tsc(void)
{
cycle_t ret;
@@ -807,6 +809,7 @@ static cycle_t __vsyscall_fn vread_tsc(void)
asm volatile ("");
return last;
}
+#pragma GCC pop_options
#endif
static void resume_tsc(struct clocksource *cs)
--
1.7.4
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/