From: Christoph Lameter <clameter@sgi.com>
To: linux-kernel@vger.kernel.org
Cc: Christoph Lameter <clameter@sgi.com>
Subject: [PATCH 2/7] Simple Performance Counters: x86_64 support
Date: Tue, 31 Jul 2007 16:25:07 -0700 [thread overview]
Message-ID: <11859243121617-git-send-email-clameter@sgi.com> (raw)
In-Reply-To: simple-perf-counters
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
next reply other threads:[~2007-07-31 23:25 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-07-31 23:25 Christoph Lameter [this message]
2007-08-01 10:53 ` [PATCH 2/7] Simple Performance Counters: x86_64 support 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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11859243121617-git-send-email-clameter@sgi.com \
--to=clameter@sgi.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox