diff options
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/perf_event.c | 60 |
1 files changed, 30 insertions, 30 deletions
diff --git a/kernel/perf_event.c b/kernel/perf_event.c index 095101d685bc..07b7a435bf03 100644 --- a/kernel/perf_event.c +++ b/kernel/perf_event.c | |||
@@ -4313,36 +4313,6 @@ static const struct pmu perf_ops_task_clock = { | |||
4313 | .read = task_clock_perf_event_read, | 4313 | .read = task_clock_perf_event_read, |
4314 | }; | 4314 | }; |
4315 | 4315 | ||
4316 | #ifdef CONFIG_EVENT_TRACING | ||
4317 | |||
4318 | void perf_tp_event(int event_id, u64 addr, u64 count, void *record, | ||
4319 | int entry_size, struct pt_regs *regs) | ||
4320 | { | ||
4321 | struct perf_sample_data data; | ||
4322 | struct perf_raw_record raw = { | ||
4323 | .size = entry_size, | ||
4324 | .data = record, | ||
4325 | }; | ||
4326 | |||
4327 | perf_sample_data_init(&data, addr); | ||
4328 | data.raw = &raw; | ||
4329 | |||
4330 | /* Trace events already protected against recursion */ | ||
4331 | do_perf_sw_event(PERF_TYPE_TRACEPOINT, event_id, count, 1, | ||
4332 | &data, regs); | ||
4333 | } | ||
4334 | EXPORT_SYMBOL_GPL(perf_tp_event); | ||
4335 | |||
4336 | static int perf_tp_event_match(struct perf_event *event, | ||
4337 | struct perf_sample_data *data) | ||
4338 | { | ||
4339 | void *record = data->raw->data; | ||
4340 | |||
4341 | if (likely(!event->filter) || filter_match_preds(event->filter, record)) | ||
4342 | return 1; | ||
4343 | return 0; | ||
4344 | } | ||
4345 | |||
4346 | static void swevent_hlist_release_rcu(struct rcu_head *rcu_head) | 4316 | static void swevent_hlist_release_rcu(struct rcu_head *rcu_head) |
4347 | { | 4317 | { |
4348 | struct swevent_hlist *hlist; | 4318 | struct swevent_hlist *hlist; |
@@ -4442,6 +4412,36 @@ static int swevent_hlist_get(struct perf_event *event) | |||
4442 | return err; | 4412 | return err; |
4443 | } | 4413 | } |
4444 | 4414 | ||
4415 | #ifdef CONFIG_EVENT_TRACING | ||
4416 | |||
4417 | void perf_tp_event(int event_id, u64 addr, u64 count, void *record, | ||
4418 | int entry_size, struct pt_regs *regs) | ||
4419 | { | ||
4420 | struct perf_sample_data data; | ||
4421 | struct perf_raw_record raw = { | ||
4422 | .size = entry_size, | ||
4423 | .data = record, | ||
4424 | }; | ||
4425 | |||
4426 | perf_sample_data_init(&data, addr); | ||
4427 | data.raw = &raw; | ||
4428 | |||
4429 | /* Trace events already protected against recursion */ | ||
4430 | do_perf_sw_event(PERF_TYPE_TRACEPOINT, event_id, count, 1, | ||
4431 | &data, regs); | ||
4432 | } | ||
4433 | EXPORT_SYMBOL_GPL(perf_tp_event); | ||
4434 | |||
4435 | static int perf_tp_event_match(struct perf_event *event, | ||
4436 | struct perf_sample_data *data) | ||
4437 | { | ||
4438 | void *record = data->raw->data; | ||
4439 | |||
4440 | if (likely(!event->filter) || filter_match_preds(event->filter, record)) | ||
4441 | return 1; | ||
4442 | return 0; | ||
4443 | } | ||
4444 | |||
4445 | static void tp_perf_event_destroy(struct perf_event *event) | 4445 | static void tp_perf_event_destroy(struct perf_event *event) |
4446 | { | 4446 | { |
4447 | perf_trace_disable(event->attr.config); | 4447 | perf_trace_disable(event->attr.config); |