summaryrefslogtreecommitdiffstats
path: root/samples
diff options
context:
space:
mode:
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>2023-02-01 16:56:38 +0100
committerSteven Rostedt (Google) <rostedt@goodmis.org>2023-03-29 00:52:22 +0200
commit39d954200bf6ad503c722e44d0be80c7b826fa42 (patch)
tree01cc0df2f14044b41f9cedfb2c5b3fa6da26ec2c /samples
parentlib/test_fprobe: Add a test case for nr_maxactive (diff)
downloadlinux-39d954200bf6ad503c722e44d0be80c7b826fa42.tar.xz
linux-39d954200bf6ad503c722e44d0be80c7b826fa42.zip
fprobe: Skip exit_handler if entry_handler returns !0
Skip hooking function return and calling exit_handler if the entry_handler() returns !0. Link: https://lkml.kernel.org/r/167526699798.433354.10998365726830117303.stgit@mhiramat.roam.corp.google.com Cc: Florent Revest <revest@chromium.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Will Deacon <will@kernel.org> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
Diffstat (limited to 'samples')
-rw-r--r--samples/fprobe/fprobe_example.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/samples/fprobe/fprobe_example.c b/samples/fprobe/fprobe_example.c
index dd794990ad7e..4efc8feb6277 100644
--- a/samples/fprobe/fprobe_example.c
+++ b/samples/fprobe/fprobe_example.c
@@ -48,8 +48,8 @@ static void show_backtrace(void)
stack_trace_print(stacks, len, 24);
}
-static void sample_entry_handler(struct fprobe *fp, unsigned long ip,
- struct pt_regs *regs, void *data)
+static int sample_entry_handler(struct fprobe *fp, unsigned long ip,
+ struct pt_regs *regs, void *data)
{
if (use_trace)
/*
@@ -62,6 +62,7 @@ static void sample_entry_handler(struct fprobe *fp, unsigned long ip,
nhit++;
if (stackdump)
show_backtrace();
+ return 0;
}
static void sample_exit_handler(struct fprobe *fp, unsigned long ip, struct pt_regs *regs,