trace_irqsoff.c 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  1. /*
  2. * trace irqs off critical timings
  3. *
  4. * Copyright (C) 2007-2008 Steven Rostedt <srostedt@redhat.com>
  5. * Copyright (C) 2008 Ingo Molnar <mingo@redhat.com>
  6. *
  7. * From code in the latency_tracer, that is:
  8. *
  9. * Copyright (C) 2004-2006 Ingo Molnar
  10. * Copyright (C) 2004 William Lee Irwin III
  11. */
  12. #include <linux/kallsyms.h>
  13. #include <linux/debugfs.h>
  14. #include <linux/uaccess.h>
  15. #include <linux/module.h>
  16. #include <linux/ftrace.h>
  17. #include <linux/fs.h>
  18. #include "trace.h"
  19. static struct trace_array *irqsoff_trace __read_mostly;
  20. static int tracer_enabled __read_mostly;
  21. static DEFINE_PER_CPU(int, tracing_cpu);
  22. static DEFINE_RAW_SPINLOCK(max_trace_lock);
  23. enum {
  24. TRACER_IRQS_OFF = (1 << 1),
  25. TRACER_PREEMPT_OFF = (1 << 2),
  26. };
  27. static int trace_type __read_mostly;
  28. static int save_flags;
  29. static void stop_irqsoff_tracer(struct trace_array *tr, int graph);
  30. static int start_irqsoff_tracer(struct trace_array *tr, int graph);
  31. #ifdef CONFIG_PREEMPT_TRACER
  32. static inline int
  33. preempt_trace(void)
  34. {
  35. return ((trace_type & TRACER_PREEMPT_OFF) && preempt_count());
  36. }
  37. #else
  38. # define preempt_trace() (0)
  39. #endif
  40. #ifdef CONFIG_IRQSOFF_TRACER
  41. static inline int
  42. irq_trace(void)
  43. {
  44. return ((trace_type & TRACER_IRQS_OFF) &&
  45. irqs_disabled());
  46. }
  47. #else
  48. # define irq_trace() (0)
  49. #endif
  50. #define TRACE_DISPLAY_GRAPH 1
  51. static struct tracer_opt trace_opts[] = {
  52. #ifdef CONFIG_FUNCTION_GRAPH_TRACER
  53. /* display latency trace as call graph */
  54. { TRACER_OPT(display-graph, TRACE_DISPLAY_GRAPH) },
  55. #endif
  56. { } /* Empty entry */
  57. };
  58. static struct tracer_flags tracer_flags = {
  59. .val = 0,
  60. .opts = trace_opts,
  61. };
  62. #define is_graph() (tracer_flags.val & TRACE_DISPLAY_GRAPH)
  63. /*
  64. * Sequence count - we record it when starting a measurement and
  65. * skip the latency if the sequence has changed - some other section
  66. * did a maximum and could disturb our measurement with serial console
  67. * printouts, etc. Truly coinciding maximum latencies should be rare
  68. * and what happens together happens separately as well, so this doesn't
  69. * decrease the validity of the maximum found:
  70. */
  71. static __cacheline_aligned_in_smp unsigned long max_sequence;
  72. #ifdef CONFIG_FUNCTION_TRACER
  73. /*
  74. * Prologue for the preempt and irqs off function tracers.
  75. *
  76. * Returns 1 if it is OK to continue, and data->disabled is
  77. * incremented.
  78. * 0 if the trace is to be ignored, and data->disabled
  79. * is kept the same.
  80. *
  81. * Note, this function is also used outside this ifdef but
  82. * inside the #ifdef of the function graph tracer below.
  83. * This is OK, since the function graph tracer is
  84. * dependent on the function tracer.
  85. */
  86. static int func_prolog_dec(struct trace_array *tr,
  87. struct trace_array_cpu **data,
  88. unsigned long *flags)
  89. {
  90. long disabled;
  91. int cpu;
  92. /*
  93. * Does not matter if we preempt. We test the flags
  94. * afterward, to see if irqs are disabled or not.
  95. * If we preempt and get a false positive, the flags
  96. * test will fail.
  97. */
  98. cpu = raw_smp_processor_id();
  99. if (likely(!per_cpu(tracing_cpu, cpu)))
  100. return 0;
  101. local_save_flags(*flags);
  102. /* slight chance to get a false positive on tracing_cpu */
  103. if (!irqs_disabled_flags(*flags))
  104. return 0;
  105. *data = tr->data[cpu];
  106. disabled = atomic_inc_return(&(*data)->disabled);
  107. if (likely(disabled == 1))
  108. return 1;
  109. atomic_dec(&(*data)->disabled);
  110. return 0;
  111. }
  112. /*
  113. * irqsoff uses its own tracer function to keep the overhead down:
  114. */
  115. static void
  116. irqsoff_tracer_call(unsigned long ip, unsigned long parent_ip)
  117. {
  118. struct trace_array *tr = irqsoff_trace;
  119. struct trace_array_cpu *data;
  120. unsigned long flags;
  121. if (!func_prolog_dec(tr, &data, &flags))
  122. return;
  123. trace_function(tr, ip, parent_ip, flags, preempt_count());
  124. atomic_dec(&data->disabled);
  125. }
  126. static struct ftrace_ops trace_ops __read_mostly =
  127. {
  128. .func = irqsoff_tracer_call,
  129. .flags = FTRACE_OPS_FL_GLOBAL,
  130. };
  131. #endif /* CONFIG_FUNCTION_TRACER */
  132. #ifdef CONFIG_FUNCTION_GRAPH_TRACER
  133. static int irqsoff_set_flag(u32 old_flags, u32 bit, int set)
  134. {
  135. int cpu;
  136. if (!(bit & TRACE_DISPLAY_GRAPH))
  137. return -EINVAL;
  138. if (!(is_graph() ^ set))
  139. return 0;
  140. stop_irqsoff_tracer(irqsoff_trace, !set);
  141. for_each_possible_cpu(cpu)
  142. per_cpu(tracing_cpu, cpu) = 0;
  143. tracing_max_latency = 0;
  144. tracing_reset_online_cpus(irqsoff_trace);
  145. return start_irqsoff_tracer(irqsoff_trace, set);
  146. }
  147. static int irqsoff_graph_entry(struct ftrace_graph_ent *trace)
  148. {
  149. struct trace_array *tr = irqsoff_trace;
  150. struct trace_array_cpu *data;
  151. unsigned long flags;
  152. int ret;
  153. int pc;
  154. if (!func_prolog_dec(tr, &data, &flags))
  155. return 0;
  156. pc = preempt_count();
  157. ret = __trace_graph_entry(tr, trace, flags, pc);
  158. atomic_dec(&data->disabled);
  159. return ret;
  160. }
  161. static void irqsoff_graph_return(struct ftrace_graph_ret *trace)
  162. {
  163. struct trace_array *tr = irqsoff_trace;
  164. struct trace_array_cpu *data;
  165. unsigned long flags;
  166. int pc;
  167. if (!func_prolog_dec(tr, &data, &flags))
  168. return;
  169. pc = preempt_count();
  170. __trace_graph_return(tr, trace, flags, pc);
  171. atomic_dec(&data->disabled);
  172. }
  173. static void irqsoff_trace_open(struct trace_iterator *iter)
  174. {
  175. if (is_graph())
  176. graph_trace_open(iter);
  177. }
  178. static void irqsoff_trace_close(struct trace_iterator *iter)
  179. {
  180. if (iter->private)
  181. graph_trace_close(iter);
  182. }
  183. #define GRAPH_TRACER_FLAGS (TRACE_GRAPH_PRINT_CPU | \
  184. TRACE_GRAPH_PRINT_PROC | \
  185. TRACE_GRAPH_PRINT_ABS_TIME | \
  186. TRACE_GRAPH_PRINT_DURATION)
  187. static enum print_line_t irqsoff_print_line(struct trace_iterator *iter)
  188. {
  189. /*
  190. * In graph mode call the graph tracer output function,
  191. * otherwise go with the TRACE_FN event handler
  192. */
  193. if (is_graph())
  194. return print_graph_function_flags(iter, GRAPH_TRACER_FLAGS);
  195. return TRACE_TYPE_UNHANDLED;
  196. }
  197. static void irqsoff_print_header(struct seq_file *s)
  198. {
  199. if (is_graph())
  200. print_graph_headers_flags(s, GRAPH_TRACER_FLAGS);
  201. else
  202. trace_default_header(s);
  203. }
  204. static void
  205. __trace_function(struct trace_array *tr,
  206. unsigned long ip, unsigned long parent_ip,
  207. unsigned long flags, int pc)
  208. {
  209. if (is_graph())
  210. trace_graph_function(tr, ip, parent_ip, flags, pc);
  211. else
  212. trace_function(tr, ip, parent_ip, flags, pc);
  213. }
  214. #else
  215. #define __trace_function trace_function
  216. static int irqsoff_set_flag(u32 old_flags, u32 bit, int set)
  217. {
  218. return -EINVAL;
  219. }
  220. static int irqsoff_graph_entry(struct ftrace_graph_ent *trace)
  221. {
  222. return -1;
  223. }
  224. static enum print_line_t irqsoff_print_line(struct trace_iterator *iter)
  225. {
  226. return TRACE_TYPE_UNHANDLED;
  227. }
  228. static void irqsoff_graph_return(struct ftrace_graph_ret *trace) { }
  229. static void irqsoff_trace_open(struct trace_iterator *iter) { }
  230. static void irqsoff_trace_close(struct trace_iterator *iter) { }
  231. #ifdef CONFIG_FUNCTION_TRACER
  232. static void irqsoff_print_header(struct seq_file *s)
  233. {
  234. trace_default_header(s);
  235. }
  236. #else
  237. static void irqsoff_print_header(struct seq_file *s)
  238. {
  239. trace_latency_header(s);
  240. }
  241. #endif /* CONFIG_FUNCTION_TRACER */
  242. #endif /* CONFIG_FUNCTION_GRAPH_TRACER */
  243. /*
  244. * Should this new latency be reported/recorded?
  245. */
  246. static int report_latency(cycle_t delta)
  247. {
  248. if (tracing_thresh) {
  249. if (delta < tracing_thresh)
  250. return 0;
  251. } else {
  252. if (delta <= tracing_max_latency)
  253. return 0;
  254. }
  255. return 1;
  256. }
  257. static void
  258. check_critical_timing(struct trace_array *tr,
  259. struct trace_array_cpu *data,
  260. unsigned long parent_ip,
  261. int cpu)
  262. {
  263. cycle_t T0, T1, delta;
  264. unsigned long flags;
  265. int pc;
  266. T0 = data->preempt_timestamp;
  267. T1 = ftrace_now(cpu);
  268. delta = T1-T0;
  269. local_save_flags(flags);
  270. pc = preempt_count();
  271. if (!report_latency(delta))
  272. goto out;
  273. raw_spin_lock_irqsave(&max_trace_lock, flags);
  274. /* check if we are still the max latency */
  275. if (!report_latency(delta))
  276. goto out_unlock;
  277. __trace_function(tr, CALLER_ADDR0, parent_ip, flags, pc);
  278. /* Skip 5 functions to get to the irq/preempt enable function */
  279. __trace_stack(tr, flags, 5, pc);
  280. if (data->critical_sequence != max_sequence)
  281. goto out_unlock;
  282. data->critical_end = parent_ip;
  283. if (likely(!is_tracing_stopped())) {
  284. tracing_max_latency = delta;
  285. update_max_tr_single(tr, current, cpu);
  286. }
  287. max_sequence++;
  288. out_unlock:
  289. raw_spin_unlock_irqrestore(&max_trace_lock, flags);
  290. out:
  291. data->critical_sequence = max_sequence;
  292. data->preempt_timestamp = ftrace_now(cpu);
  293. __trace_function(tr, CALLER_ADDR0, parent_ip, flags, pc);
  294. }
  295. static inline void
  296. start_critical_timing(unsigned long ip, unsigned long parent_ip)
  297. {
  298. int cpu;
  299. struct trace_array *tr = irqsoff_trace;
  300. struct trace_array_cpu *data;
  301. unsigned long flags;
  302. if (likely(!tracer_enabled))
  303. return;
  304. cpu = raw_smp_processor_id();
  305. if (per_cpu(tracing_cpu, cpu))
  306. return;
  307. data = tr->data[cpu];
  308. if (unlikely(!data) || atomic_read(&data->disabled))
  309. return;
  310. atomic_inc(&data->disabled);
  311. data->critical_sequence = max_sequence;
  312. data->preempt_timestamp = ftrace_now(cpu);
  313. data->critical_start = parent_ip ? : ip;
  314. local_save_flags(flags);
  315. __trace_function(tr, ip, parent_ip, flags, preempt_count());
  316. per_cpu(tracing_cpu, cpu) = 1;
  317. atomic_dec(&data->disabled);
  318. }
  319. static inline void
  320. stop_critical_timing(unsigned long ip, unsigned long parent_ip)
  321. {
  322. int cpu;
  323. struct trace_array *tr = irqsoff_trace;
  324. struct trace_array_cpu *data;
  325. unsigned long flags;
  326. cpu = raw_smp_processor_id();
  327. /* Always clear the tracing cpu on stopping the trace */
  328. if (unlikely(per_cpu(tracing_cpu, cpu)))
  329. per_cpu(tracing_cpu, cpu) = 0;
  330. else
  331. return;
  332. if (!tracer_enabled)
  333. return;
  334. data = tr->data[cpu];
  335. if (unlikely(!data) ||
  336. !data->critical_start || atomic_read(&data->disabled))
  337. return;
  338. atomic_inc(&data->disabled);
  339. local_save_flags(flags);
  340. __trace_function(tr, ip, parent_ip, flags, preempt_count());
  341. check_critical_timing(tr, data, parent_ip ? : ip, cpu);
  342. data->critical_start = 0;
  343. atomic_dec(&data->disabled);
  344. }
  345. /* start and stop critical timings used to for stoppage (in idle) */
  346. void start_critical_timings(void)
  347. {
  348. if (preempt_trace() || irq_trace())
  349. start_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
  350. }
  351. EXPORT_SYMBOL_GPL(start_critical_timings);
  352. void stop_critical_timings(void)
  353. {
  354. if (preempt_trace() || irq_trace())
  355. stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
  356. }
  357. EXPORT_SYMBOL_GPL(stop_critical_timings);
  358. #ifdef CONFIG_IRQSOFF_TRACER
  359. #ifdef CONFIG_PROVE_LOCKING
  360. void time_hardirqs_on(unsigned long a0, unsigned long a1)
  361. {
  362. if (!preempt_trace() && irq_trace())
  363. stop_critical_timing(a0, a1);
  364. }
  365. void time_hardirqs_off(unsigned long a0, unsigned long a1)
  366. {
  367. if (!preempt_trace() && irq_trace())
  368. start_critical_timing(a0, a1);
  369. }
  370. #else /* !CONFIG_PROVE_LOCKING */
  371. /*
  372. * Stubs:
  373. */
  374. void trace_softirqs_on(unsigned long ip)
  375. {
  376. }
  377. void trace_softirqs_off(unsigned long ip)
  378. {
  379. }
  380. inline void print_irqtrace_events(struct task_struct *curr)
  381. {
  382. }
  383. /*
  384. * We are only interested in hardirq on/off events:
  385. */
  386. void trace_hardirqs_on(void)
  387. {
  388. if (!preempt_trace() && irq_trace())
  389. stop_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
  390. }
  391. EXPORT_SYMBOL(trace_hardirqs_on);
  392. void trace_hardirqs_off(void)
  393. {
  394. if (!preempt_trace() && irq_trace())
  395. start_critical_timing(CALLER_ADDR0, CALLER_ADDR1);
  396. }
  397. EXPORT_SYMBOL(trace_hardirqs_off);
  398. void trace_hardirqs_on_caller(unsigned long caller_addr)
  399. {
  400. if (!preempt_trace() && irq_trace())
  401. stop_critical_timing(CALLER_ADDR0, caller_addr);
  402. }
  403. EXPORT_SYMBOL(trace_hardirqs_on_caller);
  404. void trace_hardirqs_off_caller(unsigned long caller_addr)
  405. {
  406. if (!preempt_trace() && irq_trace())
  407. start_critical_timing(CALLER_ADDR0, caller_addr);
  408. }
  409. EXPORT_SYMBOL(trace_hardirqs_off_caller);
  410. #endif /* CONFIG_PROVE_LOCKING */
  411. #endif /* CONFIG_IRQSOFF_TRACER */
  412. #ifdef CONFIG_PREEMPT_TRACER
  413. void trace_preempt_on(unsigned long a0, unsigned long a1)
  414. {
  415. if (preempt_trace() && !irq_trace())
  416. stop_critical_timing(a0, a1);
  417. }
  418. void trace_preempt_off(unsigned long a0, unsigned long a1)
  419. {
  420. if (preempt_trace() && !irq_trace())
  421. start_critical_timing(a0, a1);
  422. }
  423. #endif /* CONFIG_PREEMPT_TRACER */
  424. static int start_irqsoff_tracer(struct trace_array *tr, int graph)
  425. {
  426. int ret = 0;
  427. if (!graph)
  428. ret = register_ftrace_function(&trace_ops);
  429. else
  430. ret = register_ftrace_graph(&irqsoff_graph_return,
  431. &irqsoff_graph_entry);
  432. if (!ret && tracing_is_enabled())
  433. tracer_enabled = 1;
  434. else
  435. tracer_enabled = 0;
  436. return ret;
  437. }
  438. static void stop_irqsoff_tracer(struct trace_array *tr, int graph)
  439. {
  440. tracer_enabled = 0;
  441. if (!graph)
  442. unregister_ftrace_function(&trace_ops);
  443. else
  444. unregister_ftrace_graph();
  445. }
  446. static void __irqsoff_tracer_init(struct trace_array *tr)
  447. {
  448. save_flags = trace_flags;
  449. /* non overwrite screws up the latency tracers */
  450. set_tracer_flag(TRACE_ITER_OVERWRITE, 1);
  451. set_tracer_flag(TRACE_ITER_LATENCY_FMT, 1);
  452. tracing_max_latency = 0;
  453. irqsoff_trace = tr;
  454. /* make sure that the tracer is visible */
  455. smp_wmb();
  456. tracing_reset_online_cpus(tr);
  457. if (start_irqsoff_tracer(tr, is_graph()))
  458. printk(KERN_ERR "failed to start irqsoff tracer\n");
  459. }
  460. static void irqsoff_tracer_reset(struct trace_array *tr)
  461. {
  462. int lat_flag = save_flags & TRACE_ITER_LATENCY_FMT;
  463. int overwrite_flag = save_flags & TRACE_ITER_OVERWRITE;
  464. stop_irqsoff_tracer(tr, is_graph());
  465. set_tracer_flag(TRACE_ITER_LATENCY_FMT, lat_flag);
  466. set_tracer_flag(TRACE_ITER_OVERWRITE, overwrite_flag);
  467. }
  468. static void irqsoff_tracer_start(struct trace_array *tr)
  469. {
  470. tracer_enabled = 1;
  471. }
  472. static void irqsoff_tracer_stop(struct trace_array *tr)
  473. {
  474. tracer_enabled = 0;
  475. }
  476. #ifdef CONFIG_IRQSOFF_TRACER
  477. static int irqsoff_tracer_init(struct trace_array *tr)
  478. {
  479. trace_type = TRACER_IRQS_OFF;
  480. __irqsoff_tracer_init(tr);
  481. return 0;
  482. }
  483. static struct tracer irqsoff_tracer __read_mostly =
  484. {
  485. .name = "irqsoff",
  486. .init = irqsoff_tracer_init,
  487. .reset = irqsoff_tracer_reset,
  488. .start = irqsoff_tracer_start,
  489. .stop = irqsoff_tracer_stop,
  490. .print_max = 1,
  491. .print_header = irqsoff_print_header,
  492. .print_line = irqsoff_print_line,
  493. .flags = &tracer_flags,
  494. .set_flag = irqsoff_set_flag,
  495. .flag_changed = trace_keep_overwrite,
  496. #ifdef CONFIG_FTRACE_SELFTEST
  497. .selftest = trace_selftest_startup_irqsoff,
  498. #endif
  499. .open = irqsoff_trace_open,
  500. .close = irqsoff_trace_close,
  501. .use_max_tr = 1,
  502. };
  503. # define register_irqsoff(trace) register_tracer(&trace)
  504. #else
  505. # define register_irqsoff(trace) do { } while (0)
  506. #endif
  507. #ifdef CONFIG_PREEMPT_TRACER
  508. static int preemptoff_tracer_init(struct trace_array *tr)
  509. {
  510. trace_type = TRACER_PREEMPT_OFF;
  511. __irqsoff_tracer_init(tr);
  512. return 0;
  513. }
  514. static struct tracer preemptoff_tracer __read_mostly =
  515. {
  516. .name = "preemptoff",
  517. .init = preemptoff_tracer_init,
  518. .reset = irqsoff_tracer_reset,
  519. .start = irqsoff_tracer_start,
  520. .stop = irqsoff_tracer_stop,
  521. .print_max = 1,
  522. .print_header = irqsoff_print_header,
  523. .print_line = irqsoff_print_line,
  524. .flags = &tracer_flags,
  525. .set_flag = irqsoff_set_flag,
  526. .flag_changed = trace_keep_overwrite,
  527. #ifdef CONFIG_FTRACE_SELFTEST
  528. .selftest = trace_selftest_startup_preemptoff,
  529. #endif
  530. .open = irqsoff_trace_open,
  531. .close = irqsoff_trace_close,
  532. .use_max_tr = 1,
  533. };
  534. # define register_preemptoff(trace) register_tracer(&trace)
  535. #else
  536. # define register_preemptoff(trace) do { } while (0)
  537. #endif
  538. #if defined(CONFIG_IRQSOFF_TRACER) && \
  539. defined(CONFIG_PREEMPT_TRACER)
  540. static int preemptirqsoff_tracer_init(struct trace_array *tr)
  541. {
  542. trace_type = TRACER_IRQS_OFF | TRACER_PREEMPT_OFF;
  543. __irqsoff_tracer_init(tr);
  544. return 0;
  545. }
  546. static struct tracer preemptirqsoff_tracer __read_mostly =
  547. {
  548. .name = "preemptirqsoff",
  549. .init = preemptirqsoff_tracer_init,
  550. .reset = irqsoff_tracer_reset,
  551. .start = irqsoff_tracer_start,
  552. .stop = irqsoff_tracer_stop,
  553. .print_max = 1,
  554. .print_header = irqsoff_print_header,
  555. .print_line = irqsoff_print_line,
  556. .flags = &tracer_flags,
  557. .set_flag = irqsoff_set_flag,
  558. .flag_changed = trace_keep_overwrite,
  559. #ifdef CONFIG_FTRACE_SELFTEST
  560. .selftest = trace_selftest_startup_preemptirqsoff,
  561. #endif
  562. .open = irqsoff_trace_open,
  563. .close = irqsoff_trace_close,
  564. .use_max_tr = 1,
  565. };
  566. # define register_preemptirqsoff(trace) register_tracer(&trace)
  567. #else
  568. # define register_preemptirqsoff(trace) do { } while (0)
  569. #endif
  570. __init static int init_irqsoff_tracer(void)
  571. {
  572. register_irqsoff(irqsoff_tracer);
  573. register_preemptoff(preemptoff_tracer);
  574. register_preemptirqsoff(preemptirqsoff_tracer);
  575. return 0;
  576. }
  577. device_initcall(init_irqsoff_tracer);