Steven Rostedt (VMware) | bcea3f9 | 2018-08-16 11:23:53 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 2 | /* |
Wenji Huang | 73d8b8b | 2009-02-17 01:10:02 -0500 | [diff] [blame] | 3 | * trace irqs off critical timings |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 4 | * |
| 5 | * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com> |
| 6 | * Copyright (C) 2008 Ingo Molnar <mingo@redhat.com> |
| 7 | * |
| 8 | * From code in the latency_tracer, that is: |
| 9 | * |
| 10 | * Copyright (C) 2004-2006 Ingo Molnar |
Nadia Yvette Chambers | 6d49e35 | 2012-12-06 10:39:54 +0100 | [diff] [blame] | 11 | * Copyright (C) 2004 Nadia Yvette Chambers |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 12 | */ |
| 13 | #include <linux/kallsyms.h> |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 14 | #include <linux/uaccess.h> |
| 15 | #include <linux/module.h> |
| 16 | #include <linux/ftrace.h> |
Masami Hiramatsu | eeeb080 | 2019-02-13 01:13:40 +0900 | [diff] [blame] | 17 | #include <linux/kprobes.h> |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 18 | |
| 19 | #include "trace.h" |
| 20 | |
Joel Fernandes | d591581 | 2017-10-10 15:51:37 -0700 | [diff] [blame] | 21 | #include <trace/events/preemptirq.h> |
| 22 | |
Joel Fernandes | aaecaa0 | 2017-10-05 17:54:31 -0700 | [diff] [blame] | 23 | #if defined(CONFIG_IRQSOFF_TRACER) || defined(CONFIG_PREEMPT_TRACER) |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 24 | static struct trace_array *irqsoff_trace __read_mostly; |
| 25 | static int tracer_enabled __read_mostly; |
| 26 | |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 27 | static DEFINE_PER_CPU(int, tracing_cpu); |
| 28 | |
Thomas Gleixner | 5389f6f | 2009-07-25 17:13:33 +0200 | [diff] [blame] | 29 | static DEFINE_RAW_SPINLOCK(max_trace_lock); |
Steven Rostedt | 89b2f97 | 2008-05-12 21:20:44 +0200 | [diff] [blame] | 30 | |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 31 | enum { |
| 32 | TRACER_IRQS_OFF = (1 << 1), |
| 33 | TRACER_PREEMPT_OFF = (1 << 2), |
| 34 | }; |
| 35 | |
| 36 | static int trace_type __read_mostly; |
| 37 | |
Steven Rostedt (Red Hat) | 613f04a | 2013-03-14 15:03:53 -0400 | [diff] [blame] | 38 | static int save_flags; |
Steven Rostedt | e9d25fe | 2009-03-04 22:15:30 -0500 | [diff] [blame] | 39 | |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 40 | static void stop_irqsoff_tracer(struct trace_array *tr, int graph); |
| 41 | static int start_irqsoff_tracer(struct trace_array *tr, int graph); |
| 42 | |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 43 | #ifdef CONFIG_PREEMPT_TRACER |
Ingo Molnar | e309b41 | 2008-05-12 21:20:51 +0200 | [diff] [blame] | 44 | static inline int |
Steven Rostedt (VMware) | f27107f | 2018-08-07 17:03:12 -0400 | [diff] [blame] | 45 | preempt_trace(int pc) |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 46 | { |
Steven Rostedt (VMware) | f27107f | 2018-08-07 17:03:12 -0400 | [diff] [blame] | 47 | return ((trace_type & TRACER_PREEMPT_OFF) && pc); |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 48 | } |
| 49 | #else |
Steven Rostedt (VMware) | f27107f | 2018-08-07 17:03:12 -0400 | [diff] [blame] | 50 | # define preempt_trace(pc) (0) |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 51 | #endif |
| 52 | |
| 53 | #ifdef CONFIG_IRQSOFF_TRACER |
Ingo Molnar | e309b41 | 2008-05-12 21:20:51 +0200 | [diff] [blame] | 54 | static inline int |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 55 | irq_trace(void) |
| 56 | { |
| 57 | return ((trace_type & TRACER_IRQS_OFF) && |
| 58 | irqs_disabled()); |
| 59 | } |
| 60 | #else |
| 61 | # define irq_trace() (0) |
| 62 | #endif |
| 63 | |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 64 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
Steven Rostedt (Red Hat) | 0390558 | 2015-09-28 15:37:49 -0400 | [diff] [blame] | 65 | static int irqsoff_display_graph(struct trace_array *tr, int set); |
Steven Rostedt (Red Hat) | 983f938 | 2015-09-30 09:42:05 -0400 | [diff] [blame] | 66 | # define is_graph(tr) ((tr)->trace_flags & TRACE_ITER_DISPLAY_GRAPH) |
Steven Rostedt (Red Hat) | 0390558 | 2015-09-28 15:37:49 -0400 | [diff] [blame] | 67 | #else |
| 68 | static inline int irqsoff_display_graph(struct trace_array *tr, int set) |
| 69 | { |
| 70 | return -EINVAL; |
| 71 | } |
Steven Rostedt (Red Hat) | 983f938 | 2015-09-30 09:42:05 -0400 | [diff] [blame] | 72 | # define is_graph(tr) false |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 73 | #endif |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 74 | |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 75 | /* |
| 76 | * Sequence count - we record it when starting a measurement and |
| 77 | * skip the latency if the sequence has changed - some other section |
| 78 | * did a maximum and could disturb our measurement with serial console |
| 79 | * printouts, etc. Truly coinciding maximum latencies should be rare |
Lucas De Marchi | 25985ed | 2011-03-30 22:57:33 -0300 | [diff] [blame] | 80 | * and what happens together happens separately as well, so this doesn't |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 81 | * decrease the validity of the maximum found: |
| 82 | */ |
| 83 | static __cacheline_aligned_in_smp unsigned long max_sequence; |
| 84 | |
Steven Rostedt | 606576c | 2008-10-06 19:06:12 -0400 | [diff] [blame] | 85 | #ifdef CONFIG_FUNCTION_TRACER |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 86 | /* |
Steven Rostedt | 5e6d2b9 | 2010-10-05 19:41:43 -0400 | [diff] [blame] | 87 | * Prologue for the preempt and irqs off function tracers. |
| 88 | * |
| 89 | * Returns 1 if it is OK to continue, and data->disabled is |
| 90 | * incremented. |
| 91 | * 0 if the trace is to be ignored, and data->disabled |
| 92 | * is kept the same. |
| 93 | * |
| 94 | * Note, this function is also used outside this ifdef but |
| 95 | * inside the #ifdef of the function graph tracer below. |
| 96 | * This is OK, since the function graph tracer is |
| 97 | * dependent on the function tracer. |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 98 | */ |
Steven Rostedt | 5e6d2b9 | 2010-10-05 19:41:43 -0400 | [diff] [blame] | 99 | static int func_prolog_dec(struct trace_array *tr, |
| 100 | struct trace_array_cpu **data, |
| 101 | unsigned long *flags) |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 102 | { |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 103 | long disabled; |
| 104 | int cpu; |
| 105 | |
Steven Rostedt | 361943a | 2008-05-12 21:20:44 +0200 | [diff] [blame] | 106 | /* |
| 107 | * Does not matter if we preempt. We test the flags |
| 108 | * afterward, to see if irqs are disabled or not. |
| 109 | * If we preempt and get a false positive, the flags |
| 110 | * test will fail. |
| 111 | */ |
| 112 | cpu = raw_smp_processor_id(); |
| 113 | if (likely(!per_cpu(tracing_cpu, cpu))) |
Steven Rostedt | 5e6d2b9 | 2010-10-05 19:41:43 -0400 | [diff] [blame] | 114 | return 0; |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 115 | |
Steven Rostedt | 5e6d2b9 | 2010-10-05 19:41:43 -0400 | [diff] [blame] | 116 | local_save_flags(*flags); |
Steven Rostedt (Red Hat) | cb86e05 | 2016-03-18 12:27:43 -0400 | [diff] [blame] | 117 | /* |
| 118 | * Slight chance to get a false positive on tracing_cpu, |
| 119 | * although I'm starting to think there isn't a chance. |
| 120 | * Leave this for now just to be paranoid. |
| 121 | */ |
| 122 | if (!irqs_disabled_flags(*flags) && !preempt_count()) |
Steven Rostedt | 5e6d2b9 | 2010-10-05 19:41:43 -0400 | [diff] [blame] | 123 | return 0; |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 124 | |
Steven Rostedt (VMware) | 1c5eb44 | 2020-01-09 18:53:48 -0500 | [diff] [blame] | 125 | *data = per_cpu_ptr(tr->array_buffer.data, cpu); |
Steven Rostedt | 5e6d2b9 | 2010-10-05 19:41:43 -0400 | [diff] [blame] | 126 | disabled = atomic_inc_return(&(*data)->disabled); |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 127 | |
| 128 | if (likely(disabled == 1)) |
Steven Rostedt | 5e6d2b9 | 2010-10-05 19:41:43 -0400 | [diff] [blame] | 129 | return 1; |
| 130 | |
| 131 | atomic_dec(&(*data)->disabled); |
| 132 | |
| 133 | return 0; |
| 134 | } |
| 135 | |
| 136 | /* |
| 137 | * irqsoff uses its own tracer function to keep the overhead down: |
| 138 | */ |
| 139 | static void |
Steven Rostedt | 2f5f6ad | 2011-08-08 16:57:47 -0400 | [diff] [blame] | 140 | irqsoff_tracer_call(unsigned long ip, unsigned long parent_ip, |
Steven Rostedt (VMware) | d19ad07 | 2020-10-28 17:42:17 -0400 | [diff] [blame] | 141 | struct ftrace_ops *op, struct ftrace_regs *fregs) |
Steven Rostedt | 5e6d2b9 | 2010-10-05 19:41:43 -0400 | [diff] [blame] | 142 | { |
| 143 | struct trace_array *tr = irqsoff_trace; |
| 144 | struct trace_array_cpu *data; |
| 145 | unsigned long flags; |
| 146 | |
| 147 | if (!func_prolog_dec(tr, &data, &flags)) |
| 148 | return; |
| 149 | |
| 150 | trace_function(tr, ip, parent_ip, flags, preempt_count()); |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 151 | |
| 152 | atomic_dec(&data->disabled); |
| 153 | } |
Steven Rostedt | 606576c | 2008-10-06 19:06:12 -0400 | [diff] [blame] | 154 | #endif /* CONFIG_FUNCTION_TRACER */ |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 155 | |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 156 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
Steven Rostedt (Red Hat) | 0390558 | 2015-09-28 15:37:49 -0400 | [diff] [blame] | 157 | static int irqsoff_display_graph(struct trace_array *tr, int set) |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 158 | { |
| 159 | int cpu; |
| 160 | |
Steven Rostedt (Red Hat) | 983f938 | 2015-09-30 09:42:05 -0400 | [diff] [blame] | 161 | if (!(is_graph(tr) ^ set)) |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 162 | return 0; |
| 163 | |
| 164 | stop_irqsoff_tracer(irqsoff_trace, !set); |
| 165 | |
| 166 | for_each_possible_cpu(cpu) |
| 167 | per_cpu(tracing_cpu, cpu) = 0; |
| 168 | |
Steven Rostedt (Red Hat) | 6d9b3fa | 2014-01-14 11:28:38 -0500 | [diff] [blame] | 169 | tr->max_latency = 0; |
Steven Rostedt (VMware) | 1c5eb44 | 2020-01-09 18:53:48 -0500 | [diff] [blame] | 170 | tracing_reset_online_cpus(&irqsoff_trace->array_buffer); |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 171 | |
| 172 | return start_irqsoff_tracer(irqsoff_trace, set); |
| 173 | } |
| 174 | |
| 175 | static int irqsoff_graph_entry(struct ftrace_graph_ent *trace) |
| 176 | { |
| 177 | struct trace_array *tr = irqsoff_trace; |
| 178 | struct trace_array_cpu *data; |
| 179 | unsigned long flags; |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 180 | int ret; |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 181 | int pc; |
| 182 | |
Steven Rostedt (Red Hat) | 1a41442 | 2016-12-08 19:28:28 -0500 | [diff] [blame] | 183 | if (ftrace_graph_ignore_func(trace)) |
| 184 | return 0; |
| 185 | /* |
| 186 | * Do not trace a function if it's filtered by set_graph_notrace. |
| 187 | * Make the index of ret stack negative to indicate that it should |
| 188 | * ignore further functions. But it needs its own ret stack entry |
| 189 | * to recover the original index in order to continue tracing after |
| 190 | * returning from the function. |
| 191 | */ |
| 192 | if (ftrace_graph_notrace_addr(trace->func)) |
| 193 | return 1; |
| 194 | |
Steven Rostedt | 5e6d2b9 | 2010-10-05 19:41:43 -0400 | [diff] [blame] | 195 | if (!func_prolog_dec(tr, &data, &flags)) |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 196 | return 0; |
| 197 | |
Steven Rostedt | 5e6d2b9 | 2010-10-05 19:41:43 -0400 | [diff] [blame] | 198 | pc = preempt_count(); |
| 199 | ret = __trace_graph_entry(tr, trace, flags, pc); |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 200 | atomic_dec(&data->disabled); |
Steven Rostedt | 5e6d2b9 | 2010-10-05 19:41:43 -0400 | [diff] [blame] | 201 | |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 202 | return ret; |
| 203 | } |
| 204 | |
| 205 | static void irqsoff_graph_return(struct ftrace_graph_ret *trace) |
| 206 | { |
| 207 | struct trace_array *tr = irqsoff_trace; |
| 208 | struct trace_array_cpu *data; |
| 209 | unsigned long flags; |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 210 | int pc; |
| 211 | |
Steven Rostedt (VMware) | 5cf99a0f | 2018-11-29 08:50:27 -0500 | [diff] [blame] | 212 | ftrace_graph_addr_finish(trace); |
| 213 | |
Steven Rostedt | 5e6d2b9 | 2010-10-05 19:41:43 -0400 | [diff] [blame] | 214 | if (!func_prolog_dec(tr, &data, &flags)) |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 215 | return; |
| 216 | |
Steven Rostedt | 5e6d2b9 | 2010-10-05 19:41:43 -0400 | [diff] [blame] | 217 | pc = preempt_count(); |
| 218 | __trace_graph_return(tr, trace, flags, pc); |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 219 | atomic_dec(&data->disabled); |
| 220 | } |
| 221 | |
Steven Rostedt (VMware) | 688f708 | 2018-11-15 14:06:47 -0500 | [diff] [blame] | 222 | static struct fgraph_ops fgraph_ops = { |
| 223 | .entryfunc = &irqsoff_graph_entry, |
| 224 | .retfunc = &irqsoff_graph_return, |
| 225 | }; |
| 226 | |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 227 | static void irqsoff_trace_open(struct trace_iterator *iter) |
| 228 | { |
Steven Rostedt (Red Hat) | 983f938 | 2015-09-30 09:42:05 -0400 | [diff] [blame] | 229 | if (is_graph(iter->tr)) |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 230 | graph_trace_open(iter); |
| 231 | |
| 232 | } |
| 233 | |
| 234 | static void irqsoff_trace_close(struct trace_iterator *iter) |
| 235 | { |
| 236 | if (iter->private) |
| 237 | graph_trace_close(iter); |
| 238 | } |
| 239 | |
| 240 | #define GRAPH_TRACER_FLAGS (TRACE_GRAPH_PRINT_CPU | \ |
Jiri Olsa | 321e68b | 2011-06-03 16:58:47 +0200 | [diff] [blame] | 241 | TRACE_GRAPH_PRINT_PROC | \ |
Changbin Du | 9acd8de | 2019-01-01 23:46:10 +0800 | [diff] [blame] | 242 | TRACE_GRAPH_PRINT_REL_TIME | \ |
Jiri Olsa | 321e68b | 2011-06-03 16:58:47 +0200 | [diff] [blame] | 243 | TRACE_GRAPH_PRINT_DURATION) |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 244 | |
| 245 | static enum print_line_t irqsoff_print_line(struct trace_iterator *iter) |
| 246 | { |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 247 | /* |
| 248 | * In graph mode call the graph tracer output function, |
| 249 | * otherwise go with the TRACE_FN event handler |
| 250 | */ |
Steven Rostedt (Red Hat) | 983f938 | 2015-09-30 09:42:05 -0400 | [diff] [blame] | 251 | if (is_graph(iter->tr)) |
Jiri Olsa | 0a77262 | 2010-09-23 14:00:52 +0200 | [diff] [blame] | 252 | return print_graph_function_flags(iter, GRAPH_TRACER_FLAGS); |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 253 | |
| 254 | return TRACE_TYPE_UNHANDLED; |
| 255 | } |
| 256 | |
| 257 | static void irqsoff_print_header(struct seq_file *s) |
| 258 | { |
Steven Rostedt (Red Hat) | 983f938 | 2015-09-30 09:42:05 -0400 | [diff] [blame] | 259 | struct trace_array *tr = irqsoff_trace; |
| 260 | |
| 261 | if (is_graph(tr)) |
Jiri Olsa | 0a77262 | 2010-09-23 14:00:52 +0200 | [diff] [blame] | 262 | print_graph_headers_flags(s, GRAPH_TRACER_FLAGS); |
| 263 | else |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 264 | trace_default_header(s); |
| 265 | } |
| 266 | |
| 267 | static void |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 268 | __trace_function(struct trace_array *tr, |
| 269 | unsigned long ip, unsigned long parent_ip, |
| 270 | unsigned long flags, int pc) |
| 271 | { |
Steven Rostedt (Red Hat) | 983f938 | 2015-09-30 09:42:05 -0400 | [diff] [blame] | 272 | if (is_graph(tr)) |
Jiri Olsa | 0a77262 | 2010-09-23 14:00:52 +0200 | [diff] [blame] | 273 | trace_graph_function(tr, ip, parent_ip, flags, pc); |
| 274 | else |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 275 | trace_function(tr, ip, parent_ip, flags, pc); |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 276 | } |
| 277 | |
| 278 | #else |
| 279 | #define __trace_function trace_function |
| 280 | |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 281 | static enum print_line_t irqsoff_print_line(struct trace_iterator *iter) |
| 282 | { |
| 283 | return TRACE_TYPE_UNHANDLED; |
| 284 | } |
| 285 | |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 286 | static void irqsoff_trace_open(struct trace_iterator *iter) { } |
| 287 | static void irqsoff_trace_close(struct trace_iterator *iter) { } |
Jiri Olsa | 7e9a49e | 2011-11-07 16:08:49 +0100 | [diff] [blame] | 288 | |
| 289 | #ifdef CONFIG_FUNCTION_TRACER |
| 290 | static void irqsoff_print_header(struct seq_file *s) |
| 291 | { |
| 292 | trace_default_header(s); |
| 293 | } |
| 294 | #else |
| 295 | static void irqsoff_print_header(struct seq_file *s) |
| 296 | { |
| 297 | trace_latency_header(s); |
| 298 | } |
| 299 | #endif /* CONFIG_FUNCTION_TRACER */ |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 300 | #endif /* CONFIG_FUNCTION_GRAPH_TRACER */ |
| 301 | |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 302 | /* |
| 303 | * Should this new latency be reported/recorded? |
| 304 | */ |
Thomas Gleixner | a5a1d1c | 2016-12-21 20:32:01 +0100 | [diff] [blame] | 305 | static bool report_latency(struct trace_array *tr, u64 delta) |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 306 | { |
| 307 | if (tracing_thresh) { |
| 308 | if (delta < tracing_thresh) |
Yaowei Bai | 7985182 | 2015-09-29 22:43:30 +0800 | [diff] [blame] | 309 | return false; |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 310 | } else { |
Steven Rostedt (Red Hat) | 6d9b3fa | 2014-01-14 11:28:38 -0500 | [diff] [blame] | 311 | if (delta <= tr->max_latency) |
Yaowei Bai | 7985182 | 2015-09-29 22:43:30 +0800 | [diff] [blame] | 312 | return false; |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 313 | } |
Yaowei Bai | 7985182 | 2015-09-29 22:43:30 +0800 | [diff] [blame] | 314 | return true; |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 315 | } |
| 316 | |
Ingo Molnar | e309b41 | 2008-05-12 21:20:51 +0200 | [diff] [blame] | 317 | static void |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 318 | check_critical_timing(struct trace_array *tr, |
| 319 | struct trace_array_cpu *data, |
| 320 | unsigned long parent_ip, |
| 321 | int cpu) |
| 322 | { |
Thomas Gleixner | a5a1d1c | 2016-12-21 20:32:01 +0100 | [diff] [blame] | 323 | u64 T0, T1, delta; |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 324 | unsigned long flags; |
Steven Rostedt | 3869705 | 2008-10-01 13:14:09 -0400 | [diff] [blame] | 325 | int pc; |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 326 | |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 327 | T0 = data->preempt_timestamp; |
Ingo Molnar | 750ed1a | 2008-05-12 21:20:46 +0200 | [diff] [blame] | 328 | T1 = ftrace_now(cpu); |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 329 | delta = T1-T0; |
| 330 | |
| 331 | local_save_flags(flags); |
| 332 | |
Steven Rostedt | 6450c1d | 2008-10-02 19:23:04 -0400 | [diff] [blame] | 333 | pc = preempt_count(); |
| 334 | |
Steven Rostedt (Red Hat) | 6d9b3fa | 2014-01-14 11:28:38 -0500 | [diff] [blame] | 335 | if (!report_latency(tr, delta)) |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 336 | goto out; |
| 337 | |
Thomas Gleixner | 5389f6f | 2009-07-25 17:13:33 +0200 | [diff] [blame] | 338 | raw_spin_lock_irqsave(&max_trace_lock, flags); |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 339 | |
Steven Rostedt | 89b2f97 | 2008-05-12 21:20:44 +0200 | [diff] [blame] | 340 | /* check if we are still the max latency */ |
Steven Rostedt (Red Hat) | 6d9b3fa | 2014-01-14 11:28:38 -0500 | [diff] [blame] | 341 | if (!report_latency(tr, delta)) |
Steven Rostedt | 89b2f97 | 2008-05-12 21:20:44 +0200 | [diff] [blame] | 342 | goto out_unlock; |
| 343 | |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 344 | __trace_function(tr, CALLER_ADDR0, parent_ip, flags, pc); |
Steven Rostedt | cc51a0f | 2009-12-11 11:54:51 -0500 | [diff] [blame] | 345 | /* Skip 5 functions to get to the irq/preempt enable function */ |
| 346 | __trace_stack(tr, flags, 5, pc); |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 347 | |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 348 | if (data->critical_sequence != max_sequence) |
Steven Rostedt | 89b2f97 | 2008-05-12 21:20:44 +0200 | [diff] [blame] | 349 | goto out_unlock; |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 350 | |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 351 | data->critical_end = parent_ip; |
| 352 | |
Carsten Emde | b5130b1 | 2009-09-13 01:43:07 +0200 | [diff] [blame] | 353 | if (likely(!is_tracing_stopped())) { |
Steven Rostedt (Red Hat) | 6d9b3fa | 2014-01-14 11:28:38 -0500 | [diff] [blame] | 354 | tr->max_latency = delta; |
Carsten Emde | b5130b1 | 2009-09-13 01:43:07 +0200 | [diff] [blame] | 355 | update_max_tr_single(tr, current, cpu); |
| 356 | } |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 357 | |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 358 | max_sequence++; |
| 359 | |
Steven Rostedt | 89b2f97 | 2008-05-12 21:20:44 +0200 | [diff] [blame] | 360 | out_unlock: |
Thomas Gleixner | 5389f6f | 2009-07-25 17:13:33 +0200 | [diff] [blame] | 361 | raw_spin_unlock_irqrestore(&max_trace_lock, flags); |
Steven Rostedt | 89b2f97 | 2008-05-12 21:20:44 +0200 | [diff] [blame] | 362 | |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 363 | out: |
| 364 | data->critical_sequence = max_sequence; |
Ingo Molnar | 750ed1a | 2008-05-12 21:20:46 +0200 | [diff] [blame] | 365 | data->preempt_timestamp = ftrace_now(cpu); |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 366 | __trace_function(tr, CALLER_ADDR0, parent_ip, flags, pc); |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 367 | } |
| 368 | |
Masami Hiramatsu | eeeb080 | 2019-02-13 01:13:40 +0900 | [diff] [blame] | 369 | static nokprobe_inline void |
Steven Rostedt (VMware) | f27107f | 2018-08-07 17:03:12 -0400 | [diff] [blame] | 370 | start_critical_timing(unsigned long ip, unsigned long parent_ip, int pc) |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 371 | { |
| 372 | int cpu; |
| 373 | struct trace_array *tr = irqsoff_trace; |
| 374 | struct trace_array_cpu *data; |
| 375 | unsigned long flags; |
| 376 | |
Steven Rostedt (Red Hat) | 10246fa | 2013-07-01 15:58:24 -0400 | [diff] [blame] | 377 | if (!tracer_enabled || !tracing_is_enabled()) |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 378 | return; |
| 379 | |
Steven Rostedt | c5f888c | 2008-05-12 21:20:55 +0200 | [diff] [blame] | 380 | cpu = raw_smp_processor_id(); |
| 381 | |
| 382 | if (per_cpu(tracing_cpu, cpu)) |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 383 | return; |
| 384 | |
Steven Rostedt (VMware) | 1c5eb44 | 2020-01-09 18:53:48 -0500 | [diff] [blame] | 385 | data = per_cpu_ptr(tr->array_buffer.data, cpu); |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 386 | |
Steven Rostedt | c5f888c | 2008-05-12 21:20:55 +0200 | [diff] [blame] | 387 | if (unlikely(!data) || atomic_read(&data->disabled)) |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 388 | return; |
| 389 | |
| 390 | atomic_inc(&data->disabled); |
| 391 | |
| 392 | data->critical_sequence = max_sequence; |
Ingo Molnar | 750ed1a | 2008-05-12 21:20:46 +0200 | [diff] [blame] | 393 | data->preempt_timestamp = ftrace_now(cpu); |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 394 | data->critical_start = parent_ip ? : ip; |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 395 | |
| 396 | local_save_flags(flags); |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 397 | |
Steven Rostedt (VMware) | f27107f | 2018-08-07 17:03:12 -0400 | [diff] [blame] | 398 | __trace_function(tr, ip, parent_ip, flags, pc); |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 399 | |
Steven Rostedt | c5f888c | 2008-05-12 21:20:55 +0200 | [diff] [blame] | 400 | per_cpu(tracing_cpu, cpu) = 1; |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 401 | |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 402 | atomic_dec(&data->disabled); |
| 403 | } |
| 404 | |
Masami Hiramatsu | eeeb080 | 2019-02-13 01:13:40 +0900 | [diff] [blame] | 405 | static nokprobe_inline void |
Steven Rostedt (VMware) | f27107f | 2018-08-07 17:03:12 -0400 | [diff] [blame] | 406 | stop_critical_timing(unsigned long ip, unsigned long parent_ip, int pc) |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 407 | { |
| 408 | int cpu; |
| 409 | struct trace_array *tr = irqsoff_trace; |
| 410 | struct trace_array_cpu *data; |
| 411 | unsigned long flags; |
| 412 | |
Steven Rostedt | c5f888c | 2008-05-12 21:20:55 +0200 | [diff] [blame] | 413 | cpu = raw_smp_processor_id(); |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 414 | /* Always clear the tracing cpu on stopping the trace */ |
Steven Rostedt | c5f888c | 2008-05-12 21:20:55 +0200 | [diff] [blame] | 415 | if (unlikely(per_cpu(tracing_cpu, cpu))) |
| 416 | per_cpu(tracing_cpu, cpu) = 0; |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 417 | else |
| 418 | return; |
| 419 | |
Steven Rostedt (Red Hat) | 10246fa | 2013-07-01 15:58:24 -0400 | [diff] [blame] | 420 | if (!tracer_enabled || !tracing_is_enabled()) |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 421 | return; |
| 422 | |
Steven Rostedt (VMware) | 1c5eb44 | 2020-01-09 18:53:48 -0500 | [diff] [blame] | 423 | data = per_cpu_ptr(tr->array_buffer.data, cpu); |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 424 | |
Steven Rostedt | 3928a8a | 2008-09-29 23:02:41 -0400 | [diff] [blame] | 425 | if (unlikely(!data) || |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 426 | !data->critical_start || atomic_read(&data->disabled)) |
| 427 | return; |
| 428 | |
| 429 | atomic_inc(&data->disabled); |
Steven Rostedt | c5f888c | 2008-05-12 21:20:55 +0200 | [diff] [blame] | 430 | |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 431 | local_save_flags(flags); |
Steven Rostedt (VMware) | f27107f | 2018-08-07 17:03:12 -0400 | [diff] [blame] | 432 | __trace_function(tr, ip, parent_ip, flags, pc); |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 433 | check_critical_timing(tr, data, parent_ip ? : ip, cpu); |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 434 | data->critical_start = 0; |
| 435 | atomic_dec(&data->disabled); |
| 436 | } |
| 437 | |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 438 | /* start and stop critical timings used to for stoppage (in idle) */ |
Ingo Molnar | e309b41 | 2008-05-12 21:20:51 +0200 | [diff] [blame] | 439 | void start_critical_timings(void) |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 440 | { |
Steven Rostedt (VMware) | f27107f | 2018-08-07 17:03:12 -0400 | [diff] [blame] | 441 | int pc = preempt_count(); |
| 442 | |
| 443 | if (preempt_trace(pc) || irq_trace()) |
| 444 | start_critical_timing(CALLER_ADDR0, CALLER_ADDR1, pc); |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 445 | } |
Ingo Molnar | 1fe3710 | 2008-07-26 15:09:47 +0200 | [diff] [blame] | 446 | EXPORT_SYMBOL_GPL(start_critical_timings); |
Masami Hiramatsu | eeeb080 | 2019-02-13 01:13:40 +0900 | [diff] [blame] | 447 | NOKPROBE_SYMBOL(start_critical_timings); |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 448 | |
Ingo Molnar | e309b41 | 2008-05-12 21:20:51 +0200 | [diff] [blame] | 449 | void stop_critical_timings(void) |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 450 | { |
Steven Rostedt (VMware) | f27107f | 2018-08-07 17:03:12 -0400 | [diff] [blame] | 451 | int pc = preempt_count(); |
| 452 | |
| 453 | if (preempt_trace(pc) || irq_trace()) |
| 454 | stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1, pc); |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 455 | } |
Ingo Molnar | 1fe3710 | 2008-07-26 15:09:47 +0200 | [diff] [blame] | 456 | EXPORT_SYMBOL_GPL(stop_critical_timings); |
Masami Hiramatsu | eeeb080 | 2019-02-13 01:13:40 +0900 | [diff] [blame] | 457 | NOKPROBE_SYMBOL(stop_critical_timings); |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 458 | |
Steven Rostedt (Red Hat) | 8179e8a | 2015-09-29 10:24:56 -0400 | [diff] [blame] | 459 | #ifdef CONFIG_FUNCTION_TRACER |
| 460 | static bool function_enabled; |
| 461 | |
Steven Rostedt (Red Hat) | 4104d32 | 2014-01-10 17:01:58 -0500 | [diff] [blame] | 462 | static int register_irqsoff_function(struct trace_array *tr, int graph, int set) |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 463 | { |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 464 | int ret; |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 465 | |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 466 | /* 'set' is set if TRACE_ITER_FUNCTION is about to be set */ |
Steven Rostedt (Red Hat) | 983f938 | 2015-09-30 09:42:05 -0400 | [diff] [blame] | 467 | if (function_enabled || (!set && !(tr->trace_flags & TRACE_ITER_FUNCTION))) |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 468 | return 0; |
| 469 | |
| 470 | if (graph) |
Steven Rostedt (VMware) | 688f708 | 2018-11-15 14:06:47 -0500 | [diff] [blame] | 471 | ret = register_ftrace_graph(&fgraph_ops); |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 472 | else |
Steven Rostedt (Red Hat) | 4104d32 | 2014-01-10 17:01:58 -0500 | [diff] [blame] | 473 | ret = register_ftrace_function(tr->ops); |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 474 | |
| 475 | if (!ret) |
| 476 | function_enabled = true; |
| 477 | |
| 478 | return ret; |
| 479 | } |
| 480 | |
Steven Rostedt (Red Hat) | 4104d32 | 2014-01-10 17:01:58 -0500 | [diff] [blame] | 481 | static void unregister_irqsoff_function(struct trace_array *tr, int graph) |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 482 | { |
| 483 | if (!function_enabled) |
| 484 | return; |
| 485 | |
| 486 | if (graph) |
Steven Rostedt (VMware) | 688f708 | 2018-11-15 14:06:47 -0500 | [diff] [blame] | 487 | unregister_ftrace_graph(&fgraph_ops); |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 488 | else |
Steven Rostedt (Red Hat) | 4104d32 | 2014-01-10 17:01:58 -0500 | [diff] [blame] | 489 | unregister_ftrace_function(tr->ops); |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 490 | |
| 491 | function_enabled = false; |
| 492 | } |
| 493 | |
Steven Rostedt (Red Hat) | 8179e8a | 2015-09-29 10:24:56 -0400 | [diff] [blame] | 494 | static int irqsoff_function_set(struct trace_array *tr, u32 mask, int set) |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 495 | { |
Steven Rostedt (Red Hat) | 8179e8a | 2015-09-29 10:24:56 -0400 | [diff] [blame] | 496 | if (!(mask & TRACE_ITER_FUNCTION)) |
| 497 | return 0; |
| 498 | |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 499 | if (set) |
Steven Rostedt (Red Hat) | 983f938 | 2015-09-30 09:42:05 -0400 | [diff] [blame] | 500 | register_irqsoff_function(tr, is_graph(tr), 1); |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 501 | else |
Steven Rostedt (Red Hat) | 983f938 | 2015-09-30 09:42:05 -0400 | [diff] [blame] | 502 | unregister_irqsoff_function(tr, is_graph(tr)); |
Steven Rostedt (Red Hat) | 8179e8a | 2015-09-29 10:24:56 -0400 | [diff] [blame] | 503 | return 1; |
| 504 | } |
| 505 | #else |
| 506 | static int register_irqsoff_function(struct trace_array *tr, int graph, int set) |
| 507 | { |
Steven Rostedt (Red Hat) | 0390558 | 2015-09-28 15:37:49 -0400 | [diff] [blame] | 508 | return 0; |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 509 | } |
Steven Rostedt (Red Hat) | 8179e8a | 2015-09-29 10:24:56 -0400 | [diff] [blame] | 510 | static void unregister_irqsoff_function(struct trace_array *tr, int graph) { } |
| 511 | static inline int irqsoff_function_set(struct trace_array *tr, u32 mask, int set) |
| 512 | { |
| 513 | return 0; |
| 514 | } |
| 515 | #endif /* CONFIG_FUNCTION_TRACER */ |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 516 | |
Steven Rostedt (Red Hat) | bf6065b | 2014-01-10 17:51:01 -0500 | [diff] [blame] | 517 | static int irqsoff_flag_changed(struct trace_array *tr, u32 mask, int set) |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 518 | { |
Steven Rostedt (Red Hat) | bf6065b | 2014-01-10 17:51:01 -0500 | [diff] [blame] | 519 | struct tracer *tracer = tr->current_trace; |
| 520 | |
Steven Rostedt (Red Hat) | 8179e8a | 2015-09-29 10:24:56 -0400 | [diff] [blame] | 521 | if (irqsoff_function_set(tr, mask, set)) |
| 522 | return 0; |
Steven Rostedt (Red Hat) | 0390558 | 2015-09-28 15:37:49 -0400 | [diff] [blame] | 523 | |
Steven Rostedt (Red Hat) | 729358d | 2015-09-29 10:15:10 -0400 | [diff] [blame] | 524 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
Steven Rostedt (Red Hat) | 0390558 | 2015-09-28 15:37:49 -0400 | [diff] [blame] | 525 | if (mask & TRACE_ITER_DISPLAY_GRAPH) |
| 526 | return irqsoff_display_graph(tr, set); |
Steven Rostedt (Red Hat) | 729358d | 2015-09-29 10:15:10 -0400 | [diff] [blame] | 527 | #endif |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 528 | |
| 529 | return trace_keep_overwrite(tracer, mask, set); |
| 530 | } |
| 531 | |
| 532 | static int start_irqsoff_tracer(struct trace_array *tr, int graph) |
| 533 | { |
| 534 | int ret; |
| 535 | |
Steven Rostedt (Red Hat) | 4104d32 | 2014-01-10 17:01:58 -0500 | [diff] [blame] | 536 | ret = register_irqsoff_function(tr, graph, 0); |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 537 | |
| 538 | if (!ret && tracing_is_enabled()) |
Steven Rostedt | 9036990 | 2008-11-05 16:05:44 -0500 | [diff] [blame] | 539 | tracer_enabled = 1; |
Steven Rostedt | 94523e8 | 2009-01-22 11:18:06 -0500 | [diff] [blame] | 540 | else |
Steven Rostedt | 9036990 | 2008-11-05 16:05:44 -0500 | [diff] [blame] | 541 | tracer_enabled = 0; |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 542 | |
| 543 | return ret; |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 544 | } |
| 545 | |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 546 | static void stop_irqsoff_tracer(struct trace_array *tr, int graph) |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 547 | { |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 548 | tracer_enabled = 0; |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 549 | |
Steven Rostedt (Red Hat) | 4104d32 | 2014-01-10 17:01:58 -0500 | [diff] [blame] | 550 | unregister_irqsoff_function(tr, graph); |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 551 | } |
| 552 | |
Steven Rostedt (Red Hat) | 02f2f76 | 2014-01-14 09:32:58 -0500 | [diff] [blame] | 553 | static bool irqsoff_busy; |
| 554 | |
| 555 | static int __irqsoff_tracer_init(struct trace_array *tr) |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 556 | { |
Steven Rostedt (Red Hat) | 02f2f76 | 2014-01-14 09:32:58 -0500 | [diff] [blame] | 557 | if (irqsoff_busy) |
| 558 | return -EBUSY; |
| 559 | |
Steven Rostedt (Red Hat) | 983f938 | 2015-09-30 09:42:05 -0400 | [diff] [blame] | 560 | save_flags = tr->trace_flags; |
Steven Rostedt (Red Hat) | 613f04a | 2013-03-14 15:03:53 -0400 | [diff] [blame] | 561 | |
| 562 | /* non overwrite screws up the latency tracers */ |
Steven Rostedt | 2b6080f | 2012-05-11 13:29:49 -0400 | [diff] [blame] | 563 | set_tracer_flag(tr, TRACE_ITER_OVERWRITE, 1); |
| 564 | set_tracer_flag(tr, TRACE_ITER_LATENCY_FMT, 1); |
Viktor Rosendahl | da7f84c | 2021-01-19 17:43:43 +0100 | [diff] [blame] | 565 | /* without pause, we will produce garbage if another latency occurs */ |
| 566 | set_tracer_flag(tr, TRACE_ITER_PAUSE_ON_TRACE, 1); |
Steven Rostedt | e9d25fe | 2009-03-04 22:15:30 -0500 | [diff] [blame] | 567 | |
Steven Rostedt (Red Hat) | 6d9b3fa | 2014-01-14 11:28:38 -0500 | [diff] [blame] | 568 | tr->max_latency = 0; |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 569 | irqsoff_trace = tr; |
Steven Rostedt | c5f888c | 2008-05-12 21:20:55 +0200 | [diff] [blame] | 570 | /* make sure that the tracer is visible */ |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 571 | smp_wmb(); |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 572 | |
Steven Rostedt (Red Hat) | 4104d32 | 2014-01-10 17:01:58 -0500 | [diff] [blame] | 573 | ftrace_init_array_ops(tr, irqsoff_tracer_call); |
| 574 | |
| 575 | /* Only toplevel instance supports graph tracing */ |
| 576 | if (start_irqsoff_tracer(tr, (tr->flags & TRACE_ARRAY_FL_GLOBAL && |
Steven Rostedt (Red Hat) | 983f938 | 2015-09-30 09:42:05 -0400 | [diff] [blame] | 577 | is_graph(tr)))) |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 578 | printk(KERN_ERR "failed to start irqsoff tracer\n"); |
Steven Rostedt (Red Hat) | 02f2f76 | 2014-01-14 09:32:58 -0500 | [diff] [blame] | 579 | |
| 580 | irqsoff_busy = true; |
| 581 | return 0; |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 582 | } |
| 583 | |
Joel Fernandes (Google) | 2b27ece | 2018-06-28 11:21:45 -0700 | [diff] [blame] | 584 | static void __irqsoff_tracer_reset(struct trace_array *tr) |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 585 | { |
Steven Rostedt (Red Hat) | 613f04a | 2013-03-14 15:03:53 -0400 | [diff] [blame] | 586 | int lat_flag = save_flags & TRACE_ITER_LATENCY_FMT; |
| 587 | int overwrite_flag = save_flags & TRACE_ITER_OVERWRITE; |
Viktor Rosendahl | da7f84c | 2021-01-19 17:43:43 +0100 | [diff] [blame] | 588 | int pause_flag = save_flags & TRACE_ITER_PAUSE_ON_TRACE; |
Steven Rostedt (Red Hat) | 613f04a | 2013-03-14 15:03:53 -0400 | [diff] [blame] | 589 | |
Steven Rostedt (Red Hat) | 983f938 | 2015-09-30 09:42:05 -0400 | [diff] [blame] | 590 | stop_irqsoff_tracer(tr, is_graph(tr)); |
Steven Rostedt | e9d25fe | 2009-03-04 22:15:30 -0500 | [diff] [blame] | 591 | |
Steven Rostedt | 2b6080f | 2012-05-11 13:29:49 -0400 | [diff] [blame] | 592 | set_tracer_flag(tr, TRACE_ITER_LATENCY_FMT, lat_flag); |
| 593 | set_tracer_flag(tr, TRACE_ITER_OVERWRITE, overwrite_flag); |
Viktor Rosendahl | da7f84c | 2021-01-19 17:43:43 +0100 | [diff] [blame] | 594 | set_tracer_flag(tr, TRACE_ITER_PAUSE_ON_TRACE, pause_flag); |
Steven Rostedt (Red Hat) | 4104d32 | 2014-01-10 17:01:58 -0500 | [diff] [blame] | 595 | ftrace_reset_array_ops(tr); |
Steven Rostedt (Red Hat) | 02f2f76 | 2014-01-14 09:32:58 -0500 | [diff] [blame] | 596 | |
| 597 | irqsoff_busy = false; |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 598 | } |
| 599 | |
Steven Rostedt | 9036990 | 2008-11-05 16:05:44 -0500 | [diff] [blame] | 600 | static void irqsoff_tracer_start(struct trace_array *tr) |
| 601 | { |
Steven Rostedt | 9036990 | 2008-11-05 16:05:44 -0500 | [diff] [blame] | 602 | tracer_enabled = 1; |
Steven Rostedt | 9036990 | 2008-11-05 16:05:44 -0500 | [diff] [blame] | 603 | } |
| 604 | |
| 605 | static void irqsoff_tracer_stop(struct trace_array *tr) |
| 606 | { |
| 607 | tracer_enabled = 0; |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 608 | } |
| 609 | |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 610 | #ifdef CONFIG_IRQSOFF_TRACER |
Joel Fernandes (Google) | c3bc8fd | 2018-07-30 15:24:23 -0700 | [diff] [blame] | 611 | /* |
| 612 | * We are only interested in hardirq on/off events: |
| 613 | */ |
Steven Rostedt (VMware) | 3f1756d | 2018-08-08 21:28:05 -0400 | [diff] [blame] | 614 | void tracer_hardirqs_on(unsigned long a0, unsigned long a1) |
Joel Fernandes (Google) | c3bc8fd | 2018-07-30 15:24:23 -0700 | [diff] [blame] | 615 | { |
Steven Rostedt (VMware) | f27107f | 2018-08-07 17:03:12 -0400 | [diff] [blame] | 616 | unsigned int pc = preempt_count(); |
| 617 | |
Steven Rostedt (VMware) | f27107f | 2018-08-07 17:03:12 -0400 | [diff] [blame] | 618 | if (!preempt_trace(pc) && irq_trace()) |
| 619 | stop_critical_timing(a0, a1, pc); |
Joel Fernandes (Google) | c3bc8fd | 2018-07-30 15:24:23 -0700 | [diff] [blame] | 620 | } |
Masami Hiramatsu | eeeb080 | 2019-02-13 01:13:40 +0900 | [diff] [blame] | 621 | NOKPROBE_SYMBOL(tracer_hardirqs_on); |
Joel Fernandes (Google) | c3bc8fd | 2018-07-30 15:24:23 -0700 | [diff] [blame] | 622 | |
Steven Rostedt (VMware) | 3f1756d | 2018-08-08 21:28:05 -0400 | [diff] [blame] | 623 | void tracer_hardirqs_off(unsigned long a0, unsigned long a1) |
Joel Fernandes (Google) | c3bc8fd | 2018-07-30 15:24:23 -0700 | [diff] [blame] | 624 | { |
Steven Rostedt (VMware) | f27107f | 2018-08-07 17:03:12 -0400 | [diff] [blame] | 625 | unsigned int pc = preempt_count(); |
| 626 | |
Steven Rostedt (VMware) | f27107f | 2018-08-07 17:03:12 -0400 | [diff] [blame] | 627 | if (!preempt_trace(pc) && irq_trace()) |
| 628 | start_critical_timing(a0, a1, pc); |
Joel Fernandes (Google) | c3bc8fd | 2018-07-30 15:24:23 -0700 | [diff] [blame] | 629 | } |
Masami Hiramatsu | eeeb080 | 2019-02-13 01:13:40 +0900 | [diff] [blame] | 630 | NOKPROBE_SYMBOL(tracer_hardirqs_off); |
Joel Fernandes (Google) | c3bc8fd | 2018-07-30 15:24:23 -0700 | [diff] [blame] | 631 | |
Frederic Weisbecker | 1c80025 | 2008-11-16 05:57:26 +0100 | [diff] [blame] | 632 | static int irqsoff_tracer_init(struct trace_array *tr) |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 633 | { |
| 634 | trace_type = TRACER_IRQS_OFF; |
| 635 | |
Steven Rostedt (Red Hat) | 02f2f76 | 2014-01-14 09:32:58 -0500 | [diff] [blame] | 636 | return __irqsoff_tracer_init(tr); |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 637 | } |
Joel Fernandes (Google) | 2b27ece | 2018-06-28 11:21:45 -0700 | [diff] [blame] | 638 | |
| 639 | static void irqsoff_tracer_reset(struct trace_array *tr) |
| 640 | { |
| 641 | __irqsoff_tracer_reset(tr); |
| 642 | } |
| 643 | |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 644 | static struct tracer irqsoff_tracer __read_mostly = |
| 645 | { |
| 646 | .name = "irqsoff", |
| 647 | .init = irqsoff_tracer_init, |
| 648 | .reset = irqsoff_tracer_reset, |
Steven Rostedt | 9036990 | 2008-11-05 16:05:44 -0500 | [diff] [blame] | 649 | .start = irqsoff_tracer_start, |
| 650 | .stop = irqsoff_tracer_stop, |
Hiraku Toyooka | f43c738 | 2012-10-02 17:27:10 +0900 | [diff] [blame] | 651 | .print_max = true, |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 652 | .print_header = irqsoff_print_header, |
| 653 | .print_line = irqsoff_print_line, |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 654 | .flag_changed = irqsoff_flag_changed, |
Steven Rostedt | 60a1177 | 2008-05-12 21:20:44 +0200 | [diff] [blame] | 655 | #ifdef CONFIG_FTRACE_SELFTEST |
| 656 | .selftest = trace_selftest_startup_irqsoff, |
| 657 | #endif |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 658 | .open = irqsoff_trace_open, |
| 659 | .close = irqsoff_trace_close, |
Steven Rostedt (Red Hat) | 02f2f76 | 2014-01-14 09:32:58 -0500 | [diff] [blame] | 660 | .allow_instances = true, |
Hiraku Toyooka | f43c738 | 2012-10-02 17:27:10 +0900 | [diff] [blame] | 661 | .use_max_tr = true, |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 662 | }; |
Joel Fernandes (Google) | c3bc8fd | 2018-07-30 15:24:23 -0700 | [diff] [blame] | 663 | #endif /* CONFIG_IRQSOFF_TRACER */ |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 664 | |
| 665 | #ifdef CONFIG_PREEMPT_TRACER |
Steven Rostedt (VMware) | 3f1756d | 2018-08-08 21:28:05 -0400 | [diff] [blame] | 666 | void tracer_preempt_on(unsigned long a0, unsigned long a1) |
Joel Fernandes (Google) | c3bc8fd | 2018-07-30 15:24:23 -0700 | [diff] [blame] | 667 | { |
Steven Rostedt (VMware) | f27107f | 2018-08-07 17:03:12 -0400 | [diff] [blame] | 668 | int pc = preempt_count(); |
| 669 | |
| 670 | if (preempt_trace(pc) && !irq_trace()) |
| 671 | stop_critical_timing(a0, a1, pc); |
Joel Fernandes (Google) | c3bc8fd | 2018-07-30 15:24:23 -0700 | [diff] [blame] | 672 | } |
| 673 | |
Steven Rostedt (VMware) | 3f1756d | 2018-08-08 21:28:05 -0400 | [diff] [blame] | 674 | void tracer_preempt_off(unsigned long a0, unsigned long a1) |
Joel Fernandes (Google) | c3bc8fd | 2018-07-30 15:24:23 -0700 | [diff] [blame] | 675 | { |
Steven Rostedt (VMware) | f27107f | 2018-08-07 17:03:12 -0400 | [diff] [blame] | 676 | int pc = preempt_count(); |
| 677 | |
| 678 | if (preempt_trace(pc) && !irq_trace()) |
| 679 | start_critical_timing(a0, a1, pc); |
Joel Fernandes (Google) | c3bc8fd | 2018-07-30 15:24:23 -0700 | [diff] [blame] | 680 | } |
| 681 | |
Frederic Weisbecker | 1c80025 | 2008-11-16 05:57:26 +0100 | [diff] [blame] | 682 | static int preemptoff_tracer_init(struct trace_array *tr) |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 683 | { |
| 684 | trace_type = TRACER_PREEMPT_OFF; |
| 685 | |
Steven Rostedt (Red Hat) | 02f2f76 | 2014-01-14 09:32:58 -0500 | [diff] [blame] | 686 | return __irqsoff_tracer_init(tr); |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 687 | } |
| 688 | |
Joel Fernandes (Google) | 2b27ece | 2018-06-28 11:21:45 -0700 | [diff] [blame] | 689 | static void preemptoff_tracer_reset(struct trace_array *tr) |
| 690 | { |
| 691 | __irqsoff_tracer_reset(tr); |
| 692 | } |
| 693 | |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 694 | static struct tracer preemptoff_tracer __read_mostly = |
| 695 | { |
| 696 | .name = "preemptoff", |
| 697 | .init = preemptoff_tracer_init, |
Joel Fernandes (Google) | 2b27ece | 2018-06-28 11:21:45 -0700 | [diff] [blame] | 698 | .reset = preemptoff_tracer_reset, |
Steven Rostedt | 9036990 | 2008-11-05 16:05:44 -0500 | [diff] [blame] | 699 | .start = irqsoff_tracer_start, |
| 700 | .stop = irqsoff_tracer_stop, |
Hiraku Toyooka | f43c738 | 2012-10-02 17:27:10 +0900 | [diff] [blame] | 701 | .print_max = true, |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 702 | .print_header = irqsoff_print_header, |
| 703 | .print_line = irqsoff_print_line, |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 704 | .flag_changed = irqsoff_flag_changed, |
Steven Rostedt | 60a1177 | 2008-05-12 21:20:44 +0200 | [diff] [blame] | 705 | #ifdef CONFIG_FTRACE_SELFTEST |
| 706 | .selftest = trace_selftest_startup_preemptoff, |
| 707 | #endif |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 708 | .open = irqsoff_trace_open, |
| 709 | .close = irqsoff_trace_close, |
Steven Rostedt (Red Hat) | 02f2f76 | 2014-01-14 09:32:58 -0500 | [diff] [blame] | 710 | .allow_instances = true, |
Hiraku Toyooka | f43c738 | 2012-10-02 17:27:10 +0900 | [diff] [blame] | 711 | .use_max_tr = true, |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 712 | }; |
Joel Fernandes (Google) | c3bc8fd | 2018-07-30 15:24:23 -0700 | [diff] [blame] | 713 | #endif /* CONFIG_PREEMPT_TRACER */ |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 714 | |
Joel Fernandes (Google) | c3bc8fd | 2018-07-30 15:24:23 -0700 | [diff] [blame] | 715 | #if defined(CONFIG_IRQSOFF_TRACER) && defined(CONFIG_PREEMPT_TRACER) |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 716 | |
Frederic Weisbecker | 1c80025 | 2008-11-16 05:57:26 +0100 | [diff] [blame] | 717 | static int preemptirqsoff_tracer_init(struct trace_array *tr) |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 718 | { |
| 719 | trace_type = TRACER_IRQS_OFF | TRACER_PREEMPT_OFF; |
| 720 | |
Steven Rostedt (Red Hat) | 02f2f76 | 2014-01-14 09:32:58 -0500 | [diff] [blame] | 721 | return __irqsoff_tracer_init(tr); |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 722 | } |
| 723 | |
Joel Fernandes (Google) | 2b27ece | 2018-06-28 11:21:45 -0700 | [diff] [blame] | 724 | static void preemptirqsoff_tracer_reset(struct trace_array *tr) |
| 725 | { |
| 726 | __irqsoff_tracer_reset(tr); |
| 727 | } |
| 728 | |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 729 | static struct tracer preemptirqsoff_tracer __read_mostly = |
| 730 | { |
| 731 | .name = "preemptirqsoff", |
| 732 | .init = preemptirqsoff_tracer_init, |
Joel Fernandes (Google) | 2b27ece | 2018-06-28 11:21:45 -0700 | [diff] [blame] | 733 | .reset = preemptirqsoff_tracer_reset, |
Steven Rostedt | 9036990 | 2008-11-05 16:05:44 -0500 | [diff] [blame] | 734 | .start = irqsoff_tracer_start, |
| 735 | .stop = irqsoff_tracer_stop, |
Hiraku Toyooka | f43c738 | 2012-10-02 17:27:10 +0900 | [diff] [blame] | 736 | .print_max = true, |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 737 | .print_header = irqsoff_print_header, |
| 738 | .print_line = irqsoff_print_line, |
Steven Rostedt (Red Hat) | 328df47 | 2013-03-14 12:10:40 -0400 | [diff] [blame] | 739 | .flag_changed = irqsoff_flag_changed, |
Steven Rostedt | 60a1177 | 2008-05-12 21:20:44 +0200 | [diff] [blame] | 740 | #ifdef CONFIG_FTRACE_SELFTEST |
| 741 | .selftest = trace_selftest_startup_preemptirqsoff, |
| 742 | #endif |
Jiri Olsa | 62b915f | 2010-04-02 19:01:22 +0200 | [diff] [blame] | 743 | .open = irqsoff_trace_open, |
| 744 | .close = irqsoff_trace_close, |
Steven Rostedt (Red Hat) | 02f2f76 | 2014-01-14 09:32:58 -0500 | [diff] [blame] | 745 | .allow_instances = true, |
Hiraku Toyooka | f43c738 | 2012-10-02 17:27:10 +0900 | [diff] [blame] | 746 | .use_max_tr = true, |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 747 | }; |
Steven Rostedt | 6cd8a4b | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 748 | #endif |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 749 | |
| 750 | __init static int init_irqsoff_tracer(void) |
| 751 | { |
Joel Fernandes (Google) | c3bc8fd | 2018-07-30 15:24:23 -0700 | [diff] [blame] | 752 | #ifdef CONFIG_IRQSOFF_TRACER |
| 753 | register_tracer(&irqsoff_tracer); |
| 754 | #endif |
| 755 | #ifdef CONFIG_PREEMPT_TRACER |
| 756 | register_tracer(&preemptoff_tracer); |
| 757 | #endif |
| 758 | #if defined(CONFIG_IRQSOFF_TRACER) && defined(CONFIG_PREEMPT_TRACER) |
| 759 | register_tracer(&preemptirqsoff_tracer); |
| 760 | #endif |
Steven Rostedt | 81d68a9 | 2008-05-12 21:20:42 +0200 | [diff] [blame] | 761 | |
| 762 | return 0; |
| 763 | } |
Steven Rostedt | 6f41567 | 2012-10-05 12:13:07 -0400 | [diff] [blame] | 764 | core_initcall(init_irqsoff_tracer); |
Joel Fernandes | aaecaa0 | 2017-10-05 17:54:31 -0700 | [diff] [blame] | 765 | #endif /* IRQSOFF_TRACER || PREEMPTOFF_TRACER */ |