Jelajahi Sumber

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>
Ingo Molnar 17 tahun lalu
induk
melakukan
36dcd67ae9
2 mengubah file dengan 4 tambahan dan 3 penghapusan
  1. 3 2
      include/linux/kprobes.h
  2. 1 1
      kernel/notifier.c

+ 3 - 2
include/linux/kprobes.h

@@ -29,6 +29,7 @@
  *		<jkenisto@us.ibm.com>  and Prasanna S Panchamukhi
  *		<jkenisto@us.ibm.com>  and Prasanna S Panchamukhi
  *		<prasanna@in.ibm.com> added function-return probes.
  *		<prasanna@in.ibm.com> added function-return probes.
  */
  */
+#include <linux/linkage.h>
 #include <linux/list.h>
 #include <linux/list.h>
 #include <linux/notifier.h>
 #include <linux/notifier.h>
 #include <linux/smp.h>
 #include <linux/smp.h>
@@ -47,7 +48,7 @@
 #define KPROBE_HIT_SSDONE	0x00000008
 #define KPROBE_HIT_SSDONE	0x00000008
 
 
 /* Attach to insert probes on any functions which should be ignored*/
 /* Attach to insert probes on any functions which should be ignored*/
-#define __kprobes	__attribute__((__section__(".kprobes.text")))
+#define __kprobes	__attribute__((__section__(".kprobes.text"))) notrace
 
 
 struct kprobe;
 struct kprobe;
 struct pt_regs;
 struct pt_regs;
@@ -256,7 +257,7 @@ void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head);
 
 
 #else /* CONFIG_KPROBES */
 #else /* CONFIG_KPROBES */
 
 
-#define __kprobes	/**/
+#define __kprobes	notrace
 struct jprobe;
 struct jprobe;
 struct kretprobe;
 struct kretprobe;
 
 

+ 1 - 1
kernel/notifier.c

@@ -550,7 +550,7 @@ EXPORT_SYMBOL(unregister_reboot_notifier);
 
 
 static ATOMIC_NOTIFIER_HEAD(die_chain);
 static ATOMIC_NOTIFIER_HEAD(die_chain);
 
 
-int notify_die(enum die_val val, const char *str,
+int notrace notify_die(enum die_val val, const char *str,
 	       struct pt_regs *regs, long err, int trap, int sig)
 	       struct pt_regs *regs, long err, int trap, int sig)
 {
 {
 	struct die_args args = {
 	struct die_args args = {