File tree Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Expand file tree Collapse file tree 3 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ config UML
35
35
select HAVE_RUST
36
36
select ARCH_HAS_UBSAN
37
37
select HAVE_ARCH_TRACEHOOK
38
+ select HAVE_SYSCALL_TRACEPOINTS
38
39
select THREAD_INFO_IN_TASK
39
40
40
41
config MMU
Original file line number Diff line number Diff line change @@ -43,6 +43,8 @@ struct thread_info {
43
43
#define TIF_NOTIFY_RESUME 8
44
44
#define TIF_SECCOMP 9 /* secure computing */
45
45
#define TIF_SINGLESTEP 10 /* single stepping userspace */
46
+ #define TIF_SYSCALL_TRACEPOINT 11 /* syscall tracepoint instrumentation */
47
+
46
48
47
49
#define _TIF_SYSCALL_TRACE (1 << TIF_SYSCALL_TRACE)
48
50
#define _TIF_SIGPENDING (1 << TIF_SIGPENDING)
Original file line number Diff line number Diff line change 9
9
#include <linux/uaccess.h>
10
10
#include <asm/ptrace-abi.h>
11
11
12
+ #define CREATE_TRACE_POINTS
13
+ #include <trace/events/syscalls.h>
14
+
12
15
void user_enable_single_step (struct task_struct * child )
13
16
{
14
17
set_tsk_thread_flag (child , TIF_SINGLESTEP );
@@ -126,6 +129,9 @@ int syscall_trace_enter(struct pt_regs *regs)
126
129
UPT_SYSCALL_ARG3 (& regs -> regs ),
127
130
UPT_SYSCALL_ARG4 (& regs -> regs ));
128
131
132
+ if (test_thread_flag (TIF_SYSCALL_TRACEPOINT ))
133
+ trace_sys_enter (regs , UPT_SYSCALL_NR (& regs -> regs ));
134
+
129
135
if (!test_thread_flag (TIF_SYSCALL_TRACE ))
130
136
return 0 ;
131
137
@@ -142,6 +148,9 @@ void syscall_trace_leave(struct pt_regs *regs)
142
148
if (test_thread_flag (TIF_SINGLESTEP ))
143
149
send_sigtrap (& regs -> regs , 0 );
144
150
151
+ if (test_thread_flag (TIF_SYSCALL_TRACEPOINT ))
152
+ trace_sys_exit (regs , PT_REGS_SYSCALL_RET (regs ));
153
+
145
154
if (!test_thread_flag (TIF_SYSCALL_TRACE ))
146
155
return ;
147
156
You can’t perform that action at this time.
0 commit comments