Skip to content

Commit 36dcd67

Browse files
author
Ingo Molnar
committed
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>
1 parent 9795302 commit 36dcd67

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎include/linux/kprobes.h‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
* <jkenisto@us.ibm.com> and Prasanna S Panchamukhi
3030
* <prasanna@in.ibm.com> added function-return probes.
3131
*/
32+
#include <linux/linkage.h>
3233
#include <linux/list.h>
3334
#include <linux/notifier.h>
3435
#include <linux/smp.h>
@@ -47,7 +48,7 @@
4748
#define KPROBE_HIT_SSDONE 0x00000008
4849

4950
/* Attach to insert probes on any functions which should be ignored*/
50-
#define __kprobes __attribute__((__section__(".kprobes.text")))
51+
#define __kprobes __attribute__((__section__(".kprobes.text"))) notrace
5152

5253
struct kprobe;
5354
struct pt_regs;
@@ -256,7 +257,7 @@ void recycle_rp_inst(struct kretprobe_instance *ri, struct hlist_head *head);
256257

257258
#else /* CONFIG_KPROBES */
258259

259-
#define __kprobes /**/
260+
#define __kprobes notrace
260261
struct jprobe;
261262
struct kretprobe;
262263

‎kernel/notifier.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -550,7 +550,7 @@ EXPORT_SYMBOL(unregister_reboot_notifier);
550550

551551
static ATOMIC_NOTIFIER_HEAD(die_chain);
552552

553-
int notify_die(enum die_val val, const char *str,
553+
int notrace notify_die(enum die_val val, const char *str,
554554
struct pt_regs *regs, long err, int trap, int sig)
555555
{
556556
struct die_args args = {

0 commit comments

Comments
 (0)