summaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/tsc.c
diff options
context:
space:
mode:
authorAdrian Hunter2013-06-28 15:22:18 +0200
committerIngo Molnar2013-07-23 12:17:45 +0200
commitc73deb6aecda2955716f31572516f09d930ef450 (patch)
tree037f7945cb4289545d5ffbe9506e071a83d6c1a6 /arch/x86/kernel/tsc.c
parentperf: Fix broken union in 'struct perf_event_mmap_page' (diff)
downloadkernel-qcow2-linux-c73deb6aecda2955716f31572516f09d930ef450.tar.gz
kernel-qcow2-linux-c73deb6aecda2955716f31572516f09d930ef450.tar.xz
kernel-qcow2-linux-c73deb6aecda2955716f31572516f09d930ef450.zip
perf/x86: Add ability to calculate TSC from perf sample timestamps
For modern CPUs, perf clock is directly related to TSC. TSC can be calculated from perf clock and vice versa using a simple calculation. Two of the three componenets of that calculation are already exported in struct perf_event_mmap_page. This patch exports the third. Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Signed-off-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: "H. Peter Anvin" <hpa@zytor.com> Link: http://lkml.kernel.org/r/1372425741-1676-3-git-send-email-adrian.hunter@intel.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/kernel/tsc.c')
-rw-r--r--arch/x86/kernel/tsc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/arch/x86/kernel/tsc.c b/arch/x86/kernel/tsc.c
index 6ff49247edf8..930e5d48f560 100644
--- a/arch/x86/kernel/tsc.c
+++ b/arch/x86/kernel/tsc.c
@@ -89,6 +89,12 @@ int check_tsc_unstable(void)
}
EXPORT_SYMBOL_GPL(check_tsc_unstable);
+int check_tsc_disabled(void)
+{
+ return tsc_disabled;
+}
+EXPORT_SYMBOL_GPL(check_tsc_disabled);
+
#ifdef CONFIG_X86_TSC
int __init notsc_setup(char *str)
{