Commit 7d77879bfd5ab0bcd9eb33180224b27fda61a7cd
Exists in
master
and in
13 other branches
Merge tag 'trace-fixes-v3.15-rc1' of git://git.kernel.org/pub/scm/linux/kernel/g…
…it/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
Showing 2 changed files Side-by-side Diff
kernel/trace/trace_functions.c
... | ... | @@ -58,12 +58,16 @@ |
58 | 58 | { |
59 | 59 | int ret; |
60 | 60 | |
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; | |
67 | 71 | |
68 | 72 | ftrace_create_filter_files(tr->ops, parent); |
69 | 73 |
kernel/trace/trace_uprobe.c
... | ... | @@ -732,9 +732,15 @@ |
732 | 732 | |
733 | 733 | static void uprobe_buffer_disable(void) |
734 | 734 | { |
735 | + int cpu; | |
736 | + | |
735 | 737 | BUG_ON(!mutex_is_locked(&event_mutex)); |
736 | 738 | |
737 | 739 | 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 | + | |
738 | 744 | free_percpu(uprobe_cpu_buffer); |
739 | 745 | uprobe_cpu_buffer = NULL; |
740 | 746 | } |