summaryrefslogtreecommitdiffstats
path: root/arch/powerpc/kernel/trace_clock.c
diff options
context:
space:
mode:
authorNaveen N. Rao2015-04-24 10:54:44 +0200
committerMichael Ellerman2015-08-06 08:36:23 +0200
commit197165d44925bd0fa892990851dee4d312a44b39 (patch)
tree5a3c35443e155b69a87456624ce458ee08a4ba08 /arch/powerpc/kernel/trace_clock.c
parentpowerpc/4xx: Fix return value check in hsta_msi_probe() (diff)
downloadkernel-qcow2-linux-197165d44925bd0fa892990851dee4d312a44b39.tar.gz
kernel-qcow2-linux-197165d44925bd0fa892990851dee4d312a44b39.tar.xz
kernel-qcow2-linux-197165d44925bd0fa892990851dee4d312a44b39.zip
powerpc/ftrace: add powerpc timebase as a trace clock source
Add a new powerpc-specific trace clock using the timebase register, similar to x86-tsc. This gives us - a fast, monotonic, hardware clock source for trace entries, and - a clock that can be used to correlate events across cpus as well as across hypervisor and guests. Signed-off-by: Naveen N. Rao <naveen.n.rao@linux.vnet.ibm.com> Acked-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/kernel/trace_clock.c')
-rw-r--r--arch/powerpc/kernel/trace_clock.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/trace_clock.c b/arch/powerpc/kernel/trace_clock.c
new file mode 100644
index 000000000000..49170690946d
--- /dev/null
+++ b/arch/powerpc/kernel/trace_clock.c
@@ -0,0 +1,15 @@
+/*
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License, version 2, as
+ * published by the Free Software Foundation.
+ *
+ * Copyright (C) 2015 Naveen N. Rao, IBM Corporation
+ */
+
+#include <asm/trace_clock.h>
+#include <asm/time.h>
+
+u64 notrace trace_clock_ppc_tb(void)
+{
+ return get_tb();
+}