]> git.ipfire.org Git - thirdparty/kernel/linux.git/blame - arch/s390/kernel/trace.c
License cleanup: add SPDX GPL-2.0 license identifier to files with no license
[thirdparty/kernel/linux.git] / arch / s390 / kernel / trace.c
CommitLineData
b2441318 1// SPDX-License-Identifier: GPL-2.0
b5a6b71b
MS
2/*
3 * Tracepoint definitions for s390
4 *
5 * Copyright IBM Corp. 2015
6 * Author(s): Martin Schwidefsky <schwidefsky@de.ibm.com>
7 */
8
9#include <linux/percpu.h>
10#define CREATE_TRACE_POINTS
11#include <asm/trace/diag.h>
12
230ccb37 13EXPORT_TRACEPOINT_SYMBOL(s390_diagnose);
b5a6b71b
MS
14
15static DEFINE_PER_CPU(unsigned int, diagnose_trace_depth);
16
230ccb37 17void trace_s390_diagnose_norecursion(int diag_nr)
b5a6b71b
MS
18{
19 unsigned long flags;
20 unsigned int *depth;
21
f6c9b160
HC
22 /* Avoid lockdep recursion. */
23 if (IS_ENABLED(CONFIG_LOCKDEP))
24 return;
b5a6b71b
MS
25 local_irq_save(flags);
26 depth = this_cpu_ptr(&diagnose_trace_depth);
27 if (*depth == 0) {
28 (*depth)++;
230ccb37 29 trace_s390_diagnose(diag_nr);
b5a6b71b
MS
30 (*depth)--;
31 }
32 local_irq_restore(flags);
33}