public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 2/7] Simple Performance Counters: x86_64 support
@ 2007-07-31 23:25 Christoph Lameter
  2007-08-01 10:53 ` Andi Kleen
  0 siblings, 1 reply; 11+ messages in thread
From: Christoph Lameter @ 2007-07-31 23:25 UTC (permalink / raw)
  To: linux-kernel; +Cc: Christoph Lameter

Export cycles_to_ns (after renaming the cycles_2_ns to cycles_to_ns to be
conforming to other arches).

Signed-off-by: Christoph Lameter <clameter@sgi.com>
---
 arch/x86_64/kernel/tsc.c   |    4 ++--
 include/asm-x86_64/timex.h |    1 +
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/arch/x86_64/kernel/tsc.c b/arch/x86_64/kernel/tsc.c
index 2a59bde..59f69af 100644
--- a/arch/x86_64/kernel/tsc.c
+++ b/arch/x86_64/kernel/tsc.c
@@ -23,7 +23,7 @@ void set_cyc2ns_scale(unsigned long khz)
 	cyc2ns_scale = (NSEC_PER_MSEC << NS_SCALE) / khz;
 }
 
-static unsigned long long cycles_2_ns(unsigned long long cyc)
+unsigned long long cycles_to_ns(unsigned long long cyc)
 {
 	return (cyc * cyc2ns_scale) >> NS_SCALE;
 }
@@ -39,7 +39,7 @@ unsigned long long sched_clock(void)
 	 */
 
 	rdtscll(a);
-	return cycles_2_ns(a);
+	return cycles_to_ns(a);
 }
 
 static int tsc_unstable;
diff --git a/include/asm-x86_64/timex.h b/include/asm-x86_64/timex.h
index 6ed21f4..d5e126c 100644
--- a/include/asm-x86_64/timex.h
+++ b/include/asm-x86_64/timex.h
@@ -28,4 +28,5 @@ extern int read_current_timer(unsigned long *timer_value);
 
 extern void mark_tsc_unstable(char *msg);
 extern void set_cyc2ns_scale(unsigned long khz);
+unsigned long long cycles_to_ns(unsigned long long cyc);
 #endif
-- 
1.5.2.4


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

end of thread, other threads:[~2007-08-17 16:10 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-31 23:25 [PATCH 2/7] Simple Performance Counters: x86_64 support Christoph Lameter
2007-08-01 10:53 ` Andi Kleen
2007-08-01 17:52   ` Christoph Lameter
2007-08-01 18:26     ` Andi Kleen
2007-08-01 18:29       ` Christoph Lameter
2007-08-01 18:40         ` Andi Kleen
2007-08-01 18:45           ` Christoph Lameter
2007-08-01 18:57             ` Andi Kleen
2007-08-01 18:58               ` Christoph Lameter
2007-08-01 19:15                 ` Andi Kleen
2007-08-17 16:10                   ` Mathieu Desnoyers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox