2018-07-30 22:24:23 +00:00
|
|
|
#ifdef CONFIG_PREEMPTIRQ_TRACEPOINTS
|
2017-10-10 22:51:37 +00:00
|
|
|
|
|
|
|
#undef TRACE_SYSTEM
|
|
|
|
#define TRACE_SYSTEM preemptirq
|
|
|
|
|
|
|
|
#if !defined(_TRACE_PREEMPTIRQ_H) || defined(TRACE_HEADER_MULTI_READ)
|
|
|
|
#define _TRACE_PREEMPTIRQ_H
|
|
|
|
|
|
|
|
#include <linux/ktime.h>
|
|
|
|
#include <linux/tracepoint.h>
|
|
|
|
#include <linux/string.h>
|
|
|
|
#include <asm/sections.h>
|
|
|
|
|
|
|
|
DECLARE_EVENT_CLASS(preemptirq_template,
|
|
|
|
|
|
|
|
TP_PROTO(unsigned long ip, unsigned long parent_ip),
|
|
|
|
|
|
|
|
TP_ARGS(ip, parent_ip),
|
|
|
|
|
|
|
|
TP_STRUCT__entry(
|
2020-01-02 19:46:25 +00:00
|
|
|
__field(s32, caller_offs)
|
|
|
|
__field(s32, parent_offs)
|
2017-10-10 22:51:37 +00:00
|
|
|
),
|
|
|
|
|
|
|
|
TP_fast_assign(
|
2020-01-02 19:46:25 +00:00
|
|
|
__entry->caller_offs = (s32)(ip - (unsigned long)_stext);
|
|
|
|
__entry->parent_offs = (s32)(parent_ip - (unsigned long)_stext);
|
2017-10-10 22:51:37 +00:00
|
|
|
),
|
|
|
|
|
2019-03-25 19:32:28 +00:00
|
|
|
TP_printk("caller=%pS parent=%pS",
|
2017-10-10 22:51:37 +00:00
|
|
|
(void *)((unsigned long)(_stext) + __entry->caller_offs),
|
|
|
|
(void *)((unsigned long)(_stext) + __entry->parent_offs))
|
|
|
|
);
|
|
|
|
|
2018-07-30 22:24:23 +00:00
|
|
|
#ifdef CONFIG_TRACE_IRQFLAGS
|
2017-10-10 22:51:37 +00:00
|
|
|
DEFINE_EVENT(preemptirq_template, irq_disable,
|
|
|
|
TP_PROTO(unsigned long ip, unsigned long parent_ip),
|
|
|
|
TP_ARGS(ip, parent_ip));
|
|
|
|
|
|
|
|
DEFINE_EVENT(preemptirq_template, irq_enable,
|
|
|
|
TP_PROTO(unsigned long ip, unsigned long parent_ip),
|
|
|
|
TP_ARGS(ip, parent_ip));
|
2018-07-30 22:24:23 +00:00
|
|
|
#else
|
|
|
|
#define trace_irq_enable(...)
|
|
|
|
#define trace_irq_disable(...)
|
|
|
|
#define trace_irq_enable_rcuidle(...)
|
|
|
|
#define trace_irq_disable_rcuidle(...)
|
2017-10-10 22:51:37 +00:00
|
|
|
#endif
|
|
|
|
|
2018-07-30 22:24:23 +00:00
|
|
|
#ifdef CONFIG_TRACE_PREEMPT_TOGGLE
|
2017-10-10 22:51:37 +00:00
|
|
|
DEFINE_EVENT(preemptirq_template, preempt_disable,
|
|
|
|
TP_PROTO(unsigned long ip, unsigned long parent_ip),
|
|
|
|
TP_ARGS(ip, parent_ip));
|
|
|
|
|
|
|
|
DEFINE_EVENT(preemptirq_template, preempt_enable,
|
|
|
|
TP_PROTO(unsigned long ip, unsigned long parent_ip),
|
|
|
|
TP_ARGS(ip, parent_ip));
|
2018-07-30 22:24:23 +00:00
|
|
|
#else
|
|
|
|
#define trace_preempt_enable(...)
|
|
|
|
#define trace_preempt_disable(...)
|
|
|
|
#define trace_preempt_enable_rcuidle(...)
|
|
|
|
#define trace_preempt_disable_rcuidle(...)
|
2017-10-10 22:51:37 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif /* _TRACE_PREEMPTIRQ_H */
|
|
|
|
|
|
|
|
#include <trace/define_trace.h>
|
|
|
|
|
2018-07-30 22:24:23 +00:00
|
|
|
#else /* !CONFIG_PREEMPTIRQ_TRACEPOINTS */
|
2017-10-10 22:51:37 +00:00
|
|
|
#define trace_irq_enable(...)
|
|
|
|
#define trace_irq_disable(...)
|
|
|
|
#define trace_irq_enable_rcuidle(...)
|
|
|
|
#define trace_irq_disable_rcuidle(...)
|
2017-10-19 08:32:13 +00:00
|
|
|
#define trace_preempt_enable(...)
|
|
|
|
#define trace_preempt_disable(...)
|
2017-10-10 22:51:37 +00:00
|
|
|
#define trace_preempt_enable_rcuidle(...)
|
|
|
|
#define trace_preempt_disable_rcuidle(...)
|
|
|
|
#endif
|