From ce5f36a58fd1d92cb945cf2568751d40e8598508 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Thu, 24 Apr 2014 13:26:01 +0200 Subject: [PATCH] uprobes/tracing: Make uprobe_perf_close() visible to uprobe_perf_open() Preparation. Move uprobe_perf_close() up before uprobe_perf_open() to avoid the forward declaration in the next patch and make it readable. Signed-off-by: Oleg Nesterov Acked-by: Steven Rostedt Acked-by: Srikar Dronamraju --- kernel/trace/trace_uprobe.c | 44 ++++++++++++++++++------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/kernel/trace/trace_uprobe.c b/kernel/trace/trace_uprobe.c index c082a7441345..51bd071eaca0 100644 --- a/kernel/trace/trace_uprobe.c +++ b/kernel/trace/trace_uprobe.c @@ -1009,6 +1009,28 @@ uprobe_filter_event(struct trace_uprobe *tu, struct perf_event *event) return __uprobe_perf_filter(&tu->filter, event->hw.tp_target->mm); } +static int uprobe_perf_close(struct trace_uprobe *tu, struct perf_event *event) +{ + bool done; + + write_lock(&tu->filter.rwlock); + if (event->hw.tp_target) { + list_del(&event->hw.tp_list); + done = tu->filter.nr_systemwide || + (event->hw.tp_target->flags & PF_EXITING) || + uprobe_filter_event(tu, event); + } else { + tu->filter.nr_systemwide--; + done = tu->filter.nr_systemwide; + } + write_unlock(&tu->filter.rwlock); + + if (!done) + uprobe_apply(tu->inode, tu->offset, &tu->consumer, false); + + return 0; +} + static int uprobe_perf_open(struct trace_uprobe *tu, struct perf_event *event) { bool done; @@ -1039,28 +1061,6 @@ static int uprobe_perf_open(struct trace_uprobe *tu, struct perf_event *event) return 0; } -static int uprobe_perf_close(struct trace_uprobe *tu, struct perf_event *event) -{ - bool done; - - write_lock(&tu->filter.rwlock); - if (event->hw.tp_target) { - list_del(&event->hw.tp_list); - done = tu->filter.nr_systemwide || - (event->hw.tp_target->flags & PF_EXITING) || - uprobe_filter_event(tu, event); - } else { - tu->filter.nr_systemwide--; - done = tu->filter.nr_systemwide; - } - write_unlock(&tu->filter.rwlock); - - if (!done) - uprobe_apply(tu->inode, tu->offset, &tu->consumer, false); - - return 0; -} - static bool uprobe_perf_filter(struct uprobe_consumer *uc, enum uprobe_filter_ctx ctx, struct mm_struct *mm) {