aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/trace/ftrace.txt5
-rw-r--r--arch/powerpc/include/asm/Kbuild1
-rw-r--r--arch/powerpc/include/asm/trace_clock.h19
-rw-r--r--arch/powerpc/kernel/Makefile1
-rw-r--r--arch/powerpc/kernel/trace_clock.c15
5 files changed, 40 insertions, 1 deletions
diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt
index 7ddb1e319f84..87bb4aa6a6b9 100644
--- a/Documentation/trace/ftrace.txt
+++ b/Documentation/trace/ftrace.txt
@@ -346,6 +346,11 @@ of ftrace. Here is a list of some of the key files:
346 x86-tsc: Architectures may define their own clocks. For 346 x86-tsc: Architectures may define their own clocks. For
347 example, x86 uses its own TSC cycle clock here. 347 example, x86 uses its own TSC cycle clock here.
348 348
349 ppc-tb: This uses the powerpc timebase register value.
350 This is in sync across CPUs and can also be used
351 to correlate events across hypervisor/guest if
352 tb_offset is known.
353
349 To set a clock, simply echo the clock name into this file. 354 To set a clock, simply echo the clock name into this file.
350 355
351 echo global > trace_clock 356 echo global > trace_clock
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild
index 050712e1ce41..ab9f4e0ed4cf 100644
--- a/arch/powerpc/include/asm/Kbuild
+++ b/arch/powerpc/include/asm/Kbuild
@@ -6,5 +6,4 @@ generic-y += local64.h
6generic-y += mcs_spinlock.h 6generic-y += mcs_spinlock.h
7generic-y += preempt.h 7generic-y += preempt.h
8generic-y += rwsem.h 8generic-y += rwsem.h
9generic-y += trace_clock.h
10generic-y += vtime.h 9generic-y += vtime.h
diff --git a/arch/powerpc/include/asm/trace_clock.h b/arch/powerpc/include/asm/trace_clock.h
new file mode 100644
index 000000000000..cf1ee75ca069
--- /dev/null
+++ b/arch/powerpc/include/asm/trace_clock.h
@@ -0,0 +1,19 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2, as
4 * published by the Free Software Foundation.
5 *
6 * Copyright (C) 2015 Naveen N. Rao, IBM Corporation
7 */
8
9#ifndef _ASM_PPC_TRACE_CLOCK_H
10#define _ASM_PPC_TRACE_CLOCK_H
11
12#include <linux/compiler.h>
13#include <linux/types.h>
14
15extern u64 notrace trace_clock_ppc_tb(void);
16
17#define ARCH_TRACE_CLOCKS { trace_clock_ppc_tb, "ppc-tb", 0 },
18
19#endif /* _ASM_PPC_TRACE_CLOCK_H */
diff --git a/arch/powerpc/kernel/Makefile b/arch/powerpc/kernel/Makefile
index 12868b1c4e05..ba336930d448 100644
--- a/arch/powerpc/kernel/Makefile
+++ b/arch/powerpc/kernel/Makefile
@@ -118,6 +118,7 @@ obj-$(CONFIG_PPC_IO_WORKAROUNDS) += io-workarounds.o
118obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o 118obj-$(CONFIG_DYNAMIC_FTRACE) += ftrace.o
119obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o 119obj-$(CONFIG_FUNCTION_GRAPH_TRACER) += ftrace.o
120obj-$(CONFIG_FTRACE_SYSCALLS) += ftrace.o 120obj-$(CONFIG_FTRACE_SYSCALLS) += ftrace.o
121obj-$(CONFIG_TRACING) += trace_clock.o
121 122
122ifneq ($(CONFIG_PPC_INDIRECT_PIO),y) 123ifneq ($(CONFIG_PPC_INDIRECT_PIO),y)
123obj-y += iomap.o 124obj-y += iomap.o
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 @@
1/*
2 * This program is free software; you can redistribute it and/or modify
3 * it under the terms of the GNU General Public License, version 2, as
4 * published by the Free Software Foundation.
5 *
6 * Copyright (C) 2015 Naveen N. Rao, IBM Corporation
7 */
8
9#include <asm/trace_clock.h>
10#include <asm/time.h>
11
12u64 notrace trace_clock_ppc_tb(void)
13{
14 return get_tb();
15}