mirror of
https://github.com/torvalds/linux.git
synced 2024-12-21 02:21:36 +00:00
8cbd9cc625
In order to promote interoperability between userspace tracers and ftrace, add a trace_clock that reports raw TSC values which will then be recorded in the ring buffer. Userspace tracers that also record TSCs are then on exactly the same time base as the kernel and events can be unambiguously interlaced. Tested: Enabled a tracepoint and the "tsc" trace_clock and saw very large timestamp values. v2: Move arch-specific bits out of generic code. v3: Rename "x86-tsc", cleanups v7: Generic arch bits in Kbuild. Google-Bug-Id: 6980623 Link: http://lkml.kernel.org/r/1352837903-32191-1-git-send-email-dhsharp@google.com Acked-by: Ingo Molnar <mingo@kernel.org> Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: "H. Peter Anvin" <hpa@linux.intel.com> Signed-off-by: David Sharp <dhsharp@google.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
21 lines
355 B
C
21 lines
355 B
C
#ifndef _ASM_X86_TRACE_CLOCK_H
|
|
#define _ASM_X86_TRACE_CLOCK_H
|
|
|
|
#include <linux/compiler.h>
|
|
#include <linux/types.h>
|
|
|
|
#ifdef CONFIG_X86_TSC
|
|
|
|
extern u64 notrace trace_clock_x86_tsc(void);
|
|
|
|
# define ARCH_TRACE_CLOCKS \
|
|
{ trace_clock_x86_tsc, "x86-tsc" },
|
|
|
|
#else /* !CONFIG_X86_TSC */
|
|
|
|
#define ARCH_TRACE_CLOCKS
|
|
|
|
#endif
|
|
|
|
#endif /* _ASM_X86_TRACE_CLOCK_H */
|