blob: 060eab094e5a2284a2a3a8b5c5492a13d8656423 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001/* SPDX-License-Identifier: GPL-2.0 */
Luis R. Rodriguez7d134b22017-02-27 14:26:56 -08002#ifndef _ASM_GENERIC_KPROBES_H
3#define _ASM_GENERIC_KPROBES_H
4
5#if defined(__KERNEL__) && !defined(__ASSEMBLY__)
6#ifdef CONFIG_KPROBES
7/*
8 * Blacklist ganerating macro. Specify functions which is not probed
9 * by using this macro.
10 */
11# define __NOKPROBE_SYMBOL(fname) \
12static unsigned long __used \
Joe Perches33def842020-10-21 19:36:07 -070013 __section("_kprobe_blacklist") \
Luis R. Rodriguez7d134b22017-02-27 14:26:56 -080014 _kbl_addr_##fname = (unsigned long)fname;
15# define NOKPROBE_SYMBOL(fname) __NOKPROBE_SYMBOL(fname)
16/* Use this to forbid a kprobes attach on very low level functions */
Joe Perches33def842020-10-21 19:36:07 -070017# define __kprobes __section(".kprobes.text")
Luis R. Rodriguez7d134b22017-02-27 14:26:56 -080018# define nokprobe_inline __always_inline
19#else
20# define NOKPROBE_SYMBOL(fname)
21# define __kprobes
22# define nokprobe_inline inline
23#endif
24#endif /* defined(__KERNEL__) && !defined(__ASSEMBLY__) */
25
26#endif /* _ASM_GENERIC_KPROBES_H */