Skip to content

Commit af38b77

Browse files
authored
Update ftrace_utils.c
1 parent c73ea8e commit af38b77

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/utils/ftrace_utils.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
#include "utils/ftrace_utils.h"
22

3+
#ifdef FTRACE_OPS_FL_RECURSION_SAFE
4+
#define D_FTRACE_RECURSION_FLAG FTRACE_OPS_FL_RECURSION_SAFE
5+
#else
6+
#define D_FTRACE_RECURSION_FLAG FTRACE_OPS_FL_RECURSION
7+
#endif
8+
39
// Resolve the address of the function being hooked
410
int fh_resolve_hook_address(struct ftrace_hook *hook) {
511
kallsyms_lookup_name_t kallsyms_lookup_name = _kallsyms_lookup();
@@ -43,7 +49,7 @@ int fh_install_hook(struct ftrace_hook *hook) {
4349

4450
hook->ops.func = (ftrace_func_t)fh_ftrace_thunk;
4551
hook->ops.flags = FTRACE_OPS_FL_SAVE_REGS
46-
| FTRACE_OPS_FL_RECURSION_SAFE
52+
| D_FTRACE_RECURSION_FLAG
4753
| FTRACE_OPS_FL_IPMODIFY;
4854

4955
err = ftrace_set_filter_ip(&hook->ops, hook->address, 0, 0);

0 commit comments

Comments
 (0)