diff options
Diffstat (limited to 'kernel/trace/trace_kprobe.c')
-rw-r--r-- | kernel/trace/trace_kprobe.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/kernel/trace/trace_kprobe.c b/kernel/trace/trace_kprobe.c index 9a082bba9537..faf7cefd15da 100644 --- a/kernel/trace/trace_kprobe.c +++ b/kernel/trace/trace_kprobe.c | |||
@@ -1338,9 +1338,9 @@ static __kprobes void kprobe_perf_func(struct kprobe *kp, | |||
1338 | struct trace_probe *tp = container_of(kp, struct trace_probe, rp.kp); | 1338 | struct trace_probe *tp = container_of(kp, struct trace_probe, rp.kp); |
1339 | struct ftrace_event_call *call = &tp->call; | 1339 | struct ftrace_event_call *call = &tp->call; |
1340 | struct kprobe_trace_entry_head *entry; | 1340 | struct kprobe_trace_entry_head *entry; |
1341 | struct hlist_head *head; | ||
1341 | u8 *data; | 1342 | u8 *data; |
1342 | int size, __size, i; | 1343 | int size, __size, i; |
1343 | unsigned long irq_flags; | ||
1344 | int rctx; | 1344 | int rctx; |
1345 | 1345 | ||
1346 | __size = sizeof(*entry) + tp->size; | 1346 | __size = sizeof(*entry) + tp->size; |
@@ -1350,8 +1350,7 @@ static __kprobes void kprobe_perf_func(struct kprobe *kp, | |||
1350 | "profile buffer not large enough")) | 1350 | "profile buffer not large enough")) |
1351 | return; | 1351 | return; |
1352 | 1352 | ||
1353 | entry = perf_trace_buf_prepare(size, call->event.type, | 1353 | entry = perf_trace_buf_prepare(size, call->event.type, regs, &rctx); |
1354 | &rctx, &irq_flags); | ||
1355 | if (!entry) | 1354 | if (!entry) |
1356 | return; | 1355 | return; |
1357 | 1356 | ||
@@ -1360,7 +1359,8 @@ static __kprobes void kprobe_perf_func(struct kprobe *kp, | |||
1360 | for (i = 0; i < tp->nr_args; i++) | 1359 | for (i = 0; i < tp->nr_args; i++) |
1361 | call_fetch(&tp->args[i].fetch, regs, data + tp->args[i].offset); | 1360 | call_fetch(&tp->args[i].fetch, regs, data + tp->args[i].offset); |
1362 | 1361 | ||
1363 | perf_trace_buf_submit(entry, size, rctx, entry->ip, 1, irq_flags, regs); | 1362 | head = per_cpu_ptr(call->perf_events, smp_processor_id()); |
1363 | perf_trace_buf_submit(entry, size, rctx, entry->ip, 1, regs, head); | ||
1364 | } | 1364 | } |
1365 | 1365 | ||
1366 | /* Kretprobe profile handler */ | 1366 | /* Kretprobe profile handler */ |
@@ -1370,9 +1370,9 @@ static __kprobes void kretprobe_perf_func(struct kretprobe_instance *ri, | |||
1370 | struct trace_probe *tp = container_of(ri->rp, struct trace_probe, rp); | 1370 | struct trace_probe *tp = container_of(ri->rp, struct trace_probe, rp); |
1371 | struct ftrace_event_call *call = &tp->call; | 1371 | struct ftrace_event_call *call = &tp->call; |
1372 | struct kretprobe_trace_entry_head *entry; | 1372 | struct kretprobe_trace_entry_head *entry; |
1373 | struct hlist_head *head; | ||
1373 | u8 *data; | 1374 | u8 *data; |
1374 | int size, __size, i; | 1375 | int size, __size, i; |
1375 | unsigned long irq_flags; | ||
1376 | int rctx; | 1376 | int rctx; |
1377 | 1377 | ||
1378 | __size = sizeof(*entry) + tp->size; | 1378 | __size = sizeof(*entry) + tp->size; |
@@ -1382,8 +1382,7 @@ static __kprobes void kretprobe_perf_func(struct kretprobe_instance *ri, | |||
1382 | "profile buffer not large enough")) | 1382 | "profile buffer not large enough")) |
1383 | return; | 1383 | return; |
1384 | 1384 | ||
1385 | entry = perf_trace_buf_prepare(size, call->event.type, | 1385 | entry = perf_trace_buf_prepare(size, call->event.type, regs, &rctx); |
1386 | &rctx, &irq_flags); | ||
1387 | if (!entry) | 1386 | if (!entry) |
1388 | return; | 1387 | return; |
1389 | 1388 | ||
@@ -1393,8 +1392,8 @@ static __kprobes void kretprobe_perf_func(struct kretprobe_instance *ri, | |||
1393 | for (i = 0; i < tp->nr_args; i++) | 1392 | for (i = 0; i < tp->nr_args; i++) |
1394 | call_fetch(&tp->args[i].fetch, regs, data + tp->args[i].offset); | 1393 | call_fetch(&tp->args[i].fetch, regs, data + tp->args[i].offset); |
1395 | 1394 | ||
1396 | perf_trace_buf_submit(entry, size, rctx, entry->ret_ip, 1, | 1395 | head = per_cpu_ptr(call->perf_events, smp_processor_id()); |
1397 | irq_flags, regs); | 1396 | perf_trace_buf_submit(entry, size, rctx, entry->ret_ip, 1, regs, head); |
1398 | } | 1397 | } |
1399 | 1398 | ||
1400 | static int probe_perf_enable(struct ftrace_event_call *call) | 1399 | static int probe_perf_enable(struct ftrace_event_call *call) |