Skip to content

Commit

Permalink
perf: Remove __free_event()
Browse files Browse the repository at this point in the history
There is but a single caller, remove the function - we already have
_free_event(), the extra indirection is nonsensical..

Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Vince Weaver <vincent.weaver@maine.edu>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Peter Zijlstra authored and Ingo Molnar committed Jan 29, 2016
1 parent e03e7ee commit a0733e6
Showing 1 changed file with 20 additions and 25 deletions.
45 changes: 20 additions & 25 deletions kernel/events/core.c
Expand Up @@ -3590,7 +3590,7 @@ static void unaccount_event(struct perf_event *event)
* 3) two matching events on the same context.
*
* The former two cases are handled in the allocation path (perf_event_alloc(),
* __free_event()), the latter -- before the first perf_install_in_context().
* _free_event()), the latter -- before the first perf_install_in_context().
*/
static int exclusive_event_init(struct perf_event *event)
{
Expand Down Expand Up @@ -3665,29 +3665,6 @@ static bool exclusive_event_installable(struct perf_event *event,
return true;
}

static void __free_event(struct perf_event *event)
{
if (!event->parent) {
if (event->attr.sample_type & PERF_SAMPLE_CALLCHAIN)
put_callchain_buffers();
}

perf_event_free_bpf_prog(event);

if (event->destroy)
event->destroy(event);

if (event->ctx)
put_ctx(event->ctx);

if (event->pmu) {
exclusive_event_destroy(event);
module_put(event->pmu->module);
}

call_rcu(&event->rcu_head, free_event_rcu);
}

static void _free_event(struct perf_event *event)
{
irq_work_sync(&event->pending);
Expand All @@ -3709,7 +3686,25 @@ static void _free_event(struct perf_event *event)
if (is_cgroup_event(event))
perf_detach_cgroup(event);

__free_event(event);
if (!event->parent) {
if (event->attr.sample_type & PERF_SAMPLE_CALLCHAIN)
put_callchain_buffers();
}

perf_event_free_bpf_prog(event);

if (event->destroy)
event->destroy(event);

if (event->ctx)
put_ctx(event->ctx);

if (event->pmu) {
exclusive_event_destroy(event);
module_put(event->pmu->module);
}

call_rcu(&event->rcu_head, free_event_rcu);
}

/*
Expand Down

0 comments on commit a0733e6

Please sign in to comment.