mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-26 15:05:24 +07:00
0c4df02d73
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>
38 lines
741 B
C
38 lines
741 B
C
#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>
|