Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ftrace: ignore functions that cannot be kprobe-ed

kprobes already has an extensive list of annotations for functions
that should not be instrumented. Add notrace annotations to these
functions as well.

This is particularly useful for functions called by the NMI path.

Signed-off-by: Ingo Molnar <mingo@elte.hu>

+4 -3
+3 -2
include/linux/kprobes.h
··· 29 29 * <jkenisto@us.ibm.com> and Prasanna S Panchamukhi 30 30 * <prasanna@in.ibm.com> added function-return probes. 31 31 */ 32 + #include <linux/linkage.h> 32 33 #include <linux/list.h> 33 34 #include <linux/notifier.h> 34 35 #include <linux/smp.h> ··· 48 47 #define KPROBE_HIT_SSDONE 0x00000008 49 48 50 49 /* Attach to insert probes on any functions which should be ignored*/ 51 - #define __kprobes __attribute__((__section__(".kprobes.text"))) 50 + #define __kprobes __attribute__((__section__(".kprobes.text"))) notrace 52 51 53 52 struct kprobe; 54 53 struct pt_regs; ··· 257 256 258 257 #else /* CONFIG_KPROBES */ 259 258 260 - #define __kprobes /**/ 259 + #define __kprobes notrace 261 260 struct jprobe; 262 261 struct kretprobe; 263 262
+1 -1
kernel/notifier.c
··· 550 550 551 551 static ATOMIC_NOTIFIER_HEAD(die_chain); 552 552 553 - int notify_die(enum die_val val, const char *str, 553 + int notrace notify_die(enum die_val val, const char *str, 554 554 struct pt_regs *regs, long err, int trap, int sig) 555 555 { 556 556 struct die_args args = {