lkml.org 
[lkml]   [2007]   [Jul]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 2/7] Simple Performance Counters: x86_64 support
Date
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
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-08-01 01:29    [W:0.047 / U:29.936 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site