diff options
author | Dave Hansen <dave.hansen@linux.intel.com> | 2013-06-21 08:51:38 -0700 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2013-06-23 11:52:58 +0200 |
commit | 0c4df02d739fed5ab081b330d67403206dd3967e (patch) | |
tree | 37296c48ff5adef1537fd5c64977a3c1a0e8cff2 /include/trace | |
parent | 14c63f17b1fde5a575a28e96547a22b451c71fb5 (diff) | |
download | op-kernel-dev-0c4df02d739fed5ab081b330d67403206dd3967e.zip op-kernel-dev-0c4df02d739fed5ab081b330d67403206dd3967e.tar.gz |
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')
-rw-r--r-- | include/trace/events/nmi.h | 37 |
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 0000000..da3ee96 --- /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> |