aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/perf_event.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/perf_event.c')
-rw-r--r--kernel/perf_event.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c
index a4fa381db3c2..17ac47f4bce6 100644
--- a/kernel/perf_event.c
+++ b/kernel/perf_event.c
@@ -4468,8 +4468,9 @@ static int swevent_hlist_get(struct perf_event *event)
4468#ifdef CONFIG_EVENT_TRACING 4468#ifdef CONFIG_EVENT_TRACING
4469 4469
4470void perf_tp_event(int event_id, u64 addr, u64 count, void *record, 4470void perf_tp_event(int event_id, u64 addr, u64 count, void *record,
4471 int entry_size, struct pt_regs *regs) 4471 int entry_size, struct pt_regs *regs, void *event)
4472{ 4472{
4473 const int type = PERF_TYPE_TRACEPOINT;
4473 struct perf_sample_data data; 4474 struct perf_sample_data data;
4474 struct perf_raw_record raw = { 4475 struct perf_raw_record raw = {
4475 .size = entry_size, 4476 .size = entry_size,
@@ -4479,9 +4480,13 @@ void perf_tp_event(int event_id, u64 addr, u64 count, void *record,
4479 perf_sample_data_init(&data, addr); 4480 perf_sample_data_init(&data, addr);
4480 data.raw = &raw; 4481 data.raw = &raw;
4481 4482
4482 /* Trace events already protected against recursion */ 4483 if (!event) {
4483 do_perf_sw_event(PERF_TYPE_TRACEPOINT, event_id, count, 1, 4484 do_perf_sw_event(type, event_id, count, 1, &data, regs);
4484 &data, regs); 4485 return;
4486 }
4487
4488 if (perf_swevent_match(event, type, event_id, &data, regs))
4489 perf_swevent_add(event, count, 1, &data, regs);
4485} 4490}
4486EXPORT_SYMBOL_GPL(perf_tp_event); 4491EXPORT_SYMBOL_GPL(perf_tp_event);
4487 4492
@@ -4514,7 +4519,7 @@ static const struct pmu *tp_perf_event_init(struct perf_event *event)
4514 !capable(CAP_SYS_ADMIN)) 4519 !capable(CAP_SYS_ADMIN))
4515 return ERR_PTR(-EPERM); 4520 return ERR_PTR(-EPERM);
4516 4521
4517 if (perf_trace_enable(event->attr.config)) 4522 if (perf_trace_enable(event->attr.config, event))
4518 return NULL; 4523 return NULL;
4519 4524
4520 event->destroy = tp_perf_event_destroy; 4525 event->destroy = tp_perf_event_destroy;