Skip to content

Commit 7d77879

Browse files
committed
Merge tag 'trace-fixes-v3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace
Pull tracing fixes from Steven Rostedt: "This contains two fixes. The first is to remove a duplication of creating debugfs files that already exist and causes an error report to be printed due to the failure of the second creation. The second is a memory leak fix that was introduced in 3.14" * tag 'trace-fixes-v3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace: tracing/uprobes: Fix uprobe_cpu_buffer memory leak tracing: Do not try to recreated toplevel set_ftrace_* files
2 parents 87a54ca + 6ea6215 commit 7d77879

2 files changed

Lines changed: 16 additions & 6 deletions

File tree

‎kernel/trace/trace_functions.c‎

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,16 @@ int ftrace_create_function_files(struct trace_array *tr,
5858
{
5959
int ret;
6060

61-
/* The top level array uses the "global_ops". */
62-
if (!(tr->flags & TRACE_ARRAY_FL_GLOBAL)) {
63-
ret = allocate_ftrace_ops(tr);
64-
if (ret)
65-
return ret;
66-
}
61+
/*
62+
* The top level array uses the "global_ops", and the files are
63+
* created on boot up.
64+
*/
65+
if (tr->flags & TRACE_ARRAY_FL_GLOBAL)
66+
return 0;
67+
68+
ret = allocate_ftrace_ops(tr);
69+
if (ret)
70+
return ret;
6771

6872
ftrace_create_filter_files(tr->ops, parent);
6973

‎kernel/trace/trace_uprobe.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -732,9 +732,15 @@ static int uprobe_buffer_enable(void)
732732

733733
static void uprobe_buffer_disable(void)
734734
{
735+
int cpu;
736+
735737
BUG_ON(!mutex_is_locked(&event_mutex));
736738

737739
if (--uprobe_buffer_refcnt == 0) {
740+
for_each_possible_cpu(cpu)
741+
free_page((unsigned long)per_cpu_ptr(uprobe_cpu_buffer,
742+
cpu)->buf);
743+
738744
free_percpu(uprobe_cpu_buffer);
739745
uprobe_cpu_buffer = NULL;
740746
}

0 commit comments

Comments
 (0)