summaryrefslogtreecommitdiff
path: root/include/trace/events/nmi.h
diff options
context:
space:
mode:
authorDave Hansen <dave.hansen@linux.intel.com>2013-06-21 19:51:38 +0400
committerIngo Molnar <mingo@kernel.org>2013-06-23 13:52:58 +0400
commit0c4df02d739fed5ab081b330d67403206dd3967e (patch)
tree37296c48ff5adef1537fd5c64977a3c1a0e8cff2 /include/trace/events/nmi.h
parent14c63f17b1fde5a575a28e96547a22b451c71fb5 (diff)
downloadlinux-0c4df02d739fed5ab081b330d67403206dd3967e.tar.xz
x86: Add NMI duration tracepoints
This patch has been invaluable in my adventures finding issues in the perf NMI handler. I'm as big a fan of printk() as anybody is, but using printk() in NMIs is deadly when they're happening frequently. Even hacking in trace_printk() ended up eating enough CPU to throw off some of the measurements I was making. Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: paulus@samba.org Cc: acme@ghostprotocols.net Cc: Dave Hansen <dave@sr71.net> Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/trace/events/nmi.h')
-rw-r--r--include/trace/events/nmi.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/include/trace/events/nmi.h b/include/trace/events/nmi.h
new file mode 100644
index 000000000000..da3ee96b8d03
--- /dev/null
+++ b/include/trace/events/nmi.h
@@ -0,0 +1,37 @@
+#undef TRACE_SYSTEM
+#define TRACE_SYSTEM nmi
+
+#if !defined(_TRACE_NMI_H) || defined(TRACE_HEADER_MULTI_READ)
+#define _TRACE_NMI_H
+
+#include <linux/ktime.h>
+#include <linux/tracepoint.h>
+
+TRACE_EVENT(nmi_handler,
+
+ TP_PROTO(void *handler, s64 delta_ns, int handled),
+
+ TP_ARGS(handler, delta_ns, handled),
+
+ TP_STRUCT__entry(
+ __field( void *, handler )
+ __field( s64, delta_ns)
+ __field( int, handled )
+ ),
+
+ TP_fast_assign(
+ __entry->handler = handler;
+ __entry->delta_ns = delta_ns;
+ __entry->handled = handled;
+ ),
+
+ TP_printk("%ps() delta_ns: %lld handled: %d",
+ __entry->handler,
+ __entry->delta_ns,
+ __entry->handled)
+);
+
+#endif /* _TRACE_NMI_H */
+
+/* This part ust be outside protection */
+#include <trace/define_trace.h>