Skip to content

Commit

Permalink
Merge tag 'trace-fixes-v3.15-rc1' of git://git.kernel.org/pub/scm/lin…
Browse files Browse the repository at this point in the history
…ux/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
  • Loading branch information
Linus Torvalds committed Apr 18, 2014
2 parents 87a54ca + 6ea6215 commit 7d77879
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
16 changes: 10 additions & 6 deletions kernel/trace/trace_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,16 @@ int ftrace_create_function_files(struct trace_array *tr,
{
int ret;

/* The top level array uses the "global_ops". */
if (!(tr->flags & TRACE_ARRAY_FL_GLOBAL)) {
ret = allocate_ftrace_ops(tr);
if (ret)
return ret;
}
/*
* The top level array uses the "global_ops", and the files are
* created on boot up.
*/
if (tr->flags & TRACE_ARRAY_FL_GLOBAL)
return 0;

ret = allocate_ftrace_ops(tr);
if (ret)
return ret;

ftrace_create_filter_files(tr->ops, parent);

Expand Down
6 changes: 6 additions & 0 deletions kernel/trace/trace_uprobe.c
Original file line number Diff line number Diff line change
Expand Up @@ -732,9 +732,15 @@ static int uprobe_buffer_enable(void)

static void uprobe_buffer_disable(void)
{
int cpu;

BUG_ON(!mutex_is_locked(&event_mutex));

if (--uprobe_buffer_refcnt == 0) {
for_each_possible_cpu(cpu)
free_page((unsigned long)per_cpu_ptr(uprobe_cpu_buffer,
cpu)->buf);

free_percpu(uprobe_cpu_buffer);
uprobe_cpu_buffer = NULL;
}
Expand Down

0 comments on commit 7d77879

Please sign in to comment.