xref: /linux/arch/x86/kernel/tracepoint.c (revision a97673a1c43d005a3ae215f4ca8b4bbb5691aea1)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * Code for supporting irq vector tracepoints.
4  *
5  * Copyright (C) 2013 Seiji Aguchi <seiji.aguchi@hds.com>
6  *
7  */
8 #include <linux/jump_label.h>
9 #include <linux/atomic.h>
10 
11 #include <asm/hw_irq.h>
12 #include <asm/desc.h>
13 #include <asm/trace/exceptions.h>
14 
15 DEFINE_STATIC_KEY_FALSE(trace_pagefault_key);
16 
17 int trace_pagefault_reg(void)
18 {
19 	static_branch_inc(&trace_pagefault_key);
20 	return 0;
21 }
22 
23 void trace_pagefault_unreg(void)
24 {
25 	static_branch_dec(&trace_pagefault_key);
26 }
27 
28 #ifdef CONFIG_SMP
29 
30 DEFINE_STATIC_KEY_FALSE(trace_resched_ipi_key);
31 
32 int trace_resched_ipi_reg(void)
33 {
34 	static_branch_inc(&trace_resched_ipi_key);
35 	return 0;
36 }
37 
38 void trace_resched_ipi_unreg(void)
39 {
40 	static_branch_dec(&trace_resched_ipi_key);
41 }
42 
43 #endif
44