diff options
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/trace_event_perf.c | 4 | ||||
-rw-r--r-- | kernel/trace/trace_kprobe.c | 4 | ||||
-rw-r--r-- | kernel/trace/trace_syscalls.c | 4 | ||||
-rw-r--r-- | kernel/trace/trace_uprobe.c | 2 |
4 files changed, 8 insertions, 6 deletions
diff --git a/kernel/trace/trace_event_perf.c b/kernel/trace/trace_event_perf.c index 4b9c114ee9de..6fa484de2ba1 100644 --- a/kernel/trace/trace_event_perf.c +++ b/kernel/trace/trace_event_perf.c | |||
@@ -261,7 +261,7 @@ void perf_trace_del(struct perf_event *p_event, int flags) | |||
261 | } | 261 | } |
262 | 262 | ||
263 | void *perf_trace_buf_prepare(int size, unsigned short type, | 263 | void *perf_trace_buf_prepare(int size, unsigned short type, |
264 | struct pt_regs *regs, int *rctxp) | 264 | struct pt_regs **regs, int *rctxp) |
265 | { | 265 | { |
266 | struct trace_entry *entry; | 266 | struct trace_entry *entry; |
267 | unsigned long flags; | 267 | unsigned long flags; |
@@ -280,6 +280,8 @@ void *perf_trace_buf_prepare(int size, unsigned short type, | |||
280 | if (*rctxp < 0) | 280 | if (*rctxp < 0) |
281 | return NULL; | 281 | return NULL; |
282 | 282 | ||
283 | if (regs) | ||
284 | *regs = this_cpu_ptr(&__perf_regs[*rctxp]); | ||
283 | raw_data = this_cpu_ptr(perf_trace_buf[*rctxp]); | 285 | raw_data = this_cpu_ptr(perf_trace_buf[*rctxp]); |
284 | 286 | ||
285 | /* zero the dead bytes from align to not leak stack to user */ | 287 | /* zero the dead bytes from align to not leak stack to user */ |
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index 5edb518be345..296079ae6583 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c | |||
@@ -1148,7 +1148,7 @@ kprobe_perf_func(struct trace_kprobe *tk, struct pt_regs *regs) | |||
1148 | size = ALIGN(__size + sizeof(u32), sizeof(u64)); | 1148 | size = ALIGN(__size + sizeof(u32), sizeof(u64)); |
1149 | size -= sizeof(u32); | 1149 | size -= sizeof(u32); |
1150 | 1150 | ||
1151 | entry = perf_trace_buf_prepare(size, call->event.type, regs, &rctx); | 1151 | entry = perf_trace_buf_prepare(size, call->event.type, NULL, &rctx); |
1152 | if (!entry) | 1152 | if (!entry) |
1153 | return; | 1153 | return; |
1154 | 1154 | ||
@@ -1179,7 +1179,7 @@ kretprobe_perf_func(struct trace_kprobe *tk, struct kretprobe_instance *ri, | |||
1179 | size = ALIGN(__size + sizeof(u32), sizeof(u64)); | 1179 | size = ALIGN(__size + sizeof(u32), sizeof(u64)); |
1180 | size -= sizeof(u32); | 1180 | size -= sizeof(u32); |
1181 | 1181 | ||
1182 | entry = perf_trace_buf_prepare(size, call->event.type, regs, &rctx); | 1182 | entry = perf_trace_buf_prepare(size, call->event.type, NULL, &rctx); |
1183 | if (!entry) | 1183 | if (!entry) |
1184 | return; | 1184 | return; |
1185 | 1185 | ||
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index c6ee36fcbf90..f97f6e3a676c 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -574,7 +574,7 @@ static void perf_syscall_enter(void *ignore, struct pt_regs *regs, long id) | |||
574 | size -= sizeof(u32); | 574 | size -= sizeof(u32); |
575 | 575 | ||
576 | rec = (struct syscall_trace_enter *)perf_trace_buf_prepare(size, | 576 | rec = (struct syscall_trace_enter *)perf_trace_buf_prepare(size, |
577 | sys_data->enter_event->event.type, regs, &rctx); | 577 | sys_data->enter_event->event.type, NULL, &rctx); |
578 | if (!rec) | 578 | if (!rec) |
579 | return; | 579 | return; |
580 | 580 | ||
@@ -647,7 +647,7 @@ static void perf_syscall_exit(void *ignore, struct pt_regs *regs, long ret) | |||
647 | size -= sizeof(u32); | 647 | size -= sizeof(u32); |
648 | 648 | ||
649 | rec = (struct syscall_trace_exit *)perf_trace_buf_prepare(size, | 649 | rec = (struct syscall_trace_exit *)perf_trace_buf_prepare(size, |
650 | sys_data->exit_event->event.type, regs, &rctx); | 650 | sys_data->exit_event->event.type, NULL, &rctx); |
651 | if (!rec) | 651 | if (!rec) |
652 | return; | 652 | return; |
653 | 653 | ||
diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index 8520acc34b18..b11441321e7a 100644 --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c | |||
@@ -1111,7 +1111,7 @@ static void __uprobe_perf_func(struct trace_uprobe *tu, | |||
1111 | if (hlist_empty(head)) | 1111 | if (hlist_empty(head)) |
1112 | goto out; | 1112 | goto out; |
1113 | 1113 | ||
1114 | entry = perf_trace_buf_prepare(size, call->event.type, regs, &rctx); | 1114 | entry = perf_trace_buf_prepare(size, call->event.type, NULL, &rctx); |
1115 | if (!entry) | 1115 | if (!entry) |
1116 | goto out; | 1116 | goto out; |
1117 | 1117 | ||