Skip to content

Commit 73142ca

Browse files
olsajirimhiramat
authored andcommitted
fprobe: Add entry/exit callbacks types
We are going to store callbacks in following change, so this will ease up the code. Link: https://lore.kernel.org/all/20240207153550.856536-2-jolsa@kernel.org/ Signed-off-by: Jiri Olsa <jolsa@kernel.org> Acked-by: Masami Hiramatsu (Google) <mhiramat@kernel.org> Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
1 parent ee97e5e commit 73142ca

1 file changed

Lines changed: 12 additions & 6 deletions

File tree

include/linux/fprobe.h

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,16 @@
77
#include <linux/ftrace.h>
88
#include <linux/rethook.h>
99

10+
struct fprobe;
11+
12+
typedef int (*fprobe_entry_cb)(struct fprobe *fp, unsigned long entry_ip,
13+
unsigned long ret_ip, struct pt_regs *regs,
14+
void *entry_data);
15+
16+
typedef void (*fprobe_exit_cb)(struct fprobe *fp, unsigned long entry_ip,
17+
unsigned long ret_ip, struct pt_regs *regs,
18+
void *entry_data);
19+
1020
/**
1121
* struct fprobe - ftrace based probe.
1222
* @ops: The ftrace_ops.
@@ -34,12 +44,8 @@ struct fprobe {
3444
size_t entry_data_size;
3545
int nr_maxactive;
3646

37-
int (*entry_handler)(struct fprobe *fp, unsigned long entry_ip,
38-
unsigned long ret_ip, struct pt_regs *regs,
39-
void *entry_data);
40-
void (*exit_handler)(struct fprobe *fp, unsigned long entry_ip,
41-
unsigned long ret_ip, struct pt_regs *regs,
42-
void *entry_data);
47+
fprobe_entry_cb entry_handler;
48+
fprobe_exit_cb exit_handler;
4349
};
4450

4551
/* This fprobe is soft-disabled. */

0 commit comments

Comments
 (0)