blob: 9c4eb33c5a1d35d9fcfa83b8386a7c4be3ef7c9e [file] [log] [blame]
Joel Fernandes2b3a26c2017-10-05 17:54:32 -07001#ifdef CONFIG_PREEMPTIRQ_EVENTS
2
3#undef TRACE_SYSTEM
4#define TRACE_SYSTEM preemptirq
5
6#if !defined(_TRACE_PREEMPTIRQ_H) || defined(TRACE_HEADER_MULTI_READ)
7#define _TRACE_PREEMPTIRQ_H
8
9#include <linux/ktime.h>
10#include <linux/tracepoint.h>
11#include <linux/string.h>
12#include <asm/sections.h>
13
14DECLARE_EVENT_CLASS(preemptirq_template,
15
16 TP_PROTO(unsigned long ip, unsigned long parent_ip),
17
18 TP_ARGS(ip, parent_ip),
19
20 TP_STRUCT__entry(
21 __field(u32, caller_offs)
22 __field(u32, parent_offs)
23 ),
24
25 TP_fast_assign(
26 __entry->caller_offs = (u32)(ip - (unsigned long)_stext);
27 __entry->parent_offs = (u32)(parent_ip - (unsigned long)_stext);
28 ),
29
30 TP_printk("caller=%pF parent=%pF",
31 (void *)((unsigned long)(_stext) + __entry->caller_offs),
32 (void *)((unsigned long)(_stext) + __entry->parent_offs))
33);
34
35#ifndef CONFIG_PROVE_LOCKING
36DEFINE_EVENT(preemptirq_template, irq_disable,
37 TP_PROTO(unsigned long ip, unsigned long parent_ip),
38 TP_ARGS(ip, parent_ip));
39
40DEFINE_EVENT(preemptirq_template, irq_enable,
41 TP_PROTO(unsigned long ip, unsigned long parent_ip),
42 TP_ARGS(ip, parent_ip));
43#endif
44
45#ifdef CONFIG_DEBUG_PREEMPT
46DEFINE_EVENT(preemptirq_template, preempt_disable,
47 TP_PROTO(unsigned long ip, unsigned long parent_ip),
48 TP_ARGS(ip, parent_ip));
49
50DEFINE_EVENT(preemptirq_template, preempt_enable,
51 TP_PROTO(unsigned long ip, unsigned long parent_ip),
52 TP_ARGS(ip, parent_ip));
53#endif
54
55#endif /* _TRACE_PREEMPTIRQ_H */
56
57#include <trace/define_trace.h>
58
Arnd Bergmann71fce1e2017-10-19 10:32:13 +020059#endif /* !CONFIG_PREEMPTIRQ_EVENTS */
Joel Fernandes2b3a26c2017-10-05 17:54:32 -070060
Arnd Bergmann71fce1e2017-10-19 10:32:13 +020061#if !defined(CONFIG_PREEMPTIRQ_EVENTS) || defined(CONFIG_PROVE_LOCKING)
Joel Fernandes2b3a26c2017-10-05 17:54:32 -070062#define trace_irq_enable(...)
63#define trace_irq_disable(...)
Joel Fernandes2b3a26c2017-10-05 17:54:32 -070064#define trace_irq_enable_rcuidle(...)
65#define trace_irq_disable_rcuidle(...)
Arnd Bergmann71fce1e2017-10-19 10:32:13 +020066#endif
67
68#if !defined(CONFIG_PREEMPTIRQ_EVENTS) || !defined(CONFIG_DEBUG_PREEMPT)
69#define trace_preempt_enable(...)
70#define trace_preempt_disable(...)
Joel Fernandes2b3a26c2017-10-05 17:54:32 -070071#define trace_preempt_enable_rcuidle(...)
72#define trace_preempt_disable_rcuidle(...)
Joel Fernandes2b3a26c2017-10-05 17:54:32 -070073#endif