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