Linux 4.13.16
[linux/fpc-iii.git] / arch / s390 / kernel / trace.c
blobdde7654f5c68e5d117d3493d9c0f130f2e24e830
1 /*
2 * Tracepoint definitions for s390
4 * Copyright IBM Corp. 2015
5 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
6 */
8 #include <linux/percpu.h>
9 #define CREATE_TRACE_POINTS
10 #include <asm/trace/diag.h>
12 EXPORT_TRACEPOINT_SYMBOL(s390_diagnose);
14 static DEFINE_PER_CPU(unsigned int, diagnose_trace_depth);
16 void trace_s390_diagnose_norecursion(int diag_nr)
18 unsigned long flags;
19 unsigned int *depth;
21 /* Avoid lockdep recursion. */
22 if (IS_ENABLED(CONFIG_LOCKDEP))
23 return;
24 local_irq_save(flags);
25 depth = this_cpu_ptr(&diagnose_trace_depth);
26 if (*depth == 0) {
27 (*depth)++;
28 trace_s390_diagnose(diag_nr);
29 (*depth)--;
31 local_irq_restore(flags);