diff options
Diffstat (limited to 'kernel/trace/kmemtrace.c')
-rw-r--r-- | kernel/trace/kmemtrace.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/trace/kmemtrace.c b/kernel/trace/kmemtrace.c index 5011f4d91e37..86cdf671d7e2 100644 --- a/kernel/trace/kmemtrace.c +++ b/kernel/trace/kmemtrace.c | |||
@@ -12,7 +12,7 @@ | |||
12 | #include <linux/dcache.h> | 12 | #include <linux/dcache.h> |
13 | #include <linux/fs.h> | 13 | #include <linux/fs.h> |
14 | 14 | ||
15 | #include <trace/kmemtrace.h> | 15 | #include <linux/kmemtrace.h> |
16 | 16 | ||
17 | #include "trace_output.h" | 17 | #include "trace_output.h" |
18 | #include "trace.h" | 18 | #include "trace.h" |
@@ -42,6 +42,7 @@ static inline void kmemtrace_alloc(enum kmemtrace_type_id type_id, | |||
42 | gfp_t gfp_flags, | 42 | gfp_t gfp_flags, |
43 | int node) | 43 | int node) |
44 | { | 44 | { |
45 | struct ftrace_event_call *call = &event_kmem_alloc; | ||
45 | struct trace_array *tr = kmemtrace_array; | 46 | struct trace_array *tr = kmemtrace_array; |
46 | struct kmemtrace_alloc_entry *entry; | 47 | struct kmemtrace_alloc_entry *entry; |
47 | struct ring_buffer_event *event; | 48 | struct ring_buffer_event *event; |
@@ -62,7 +63,8 @@ static inline void kmemtrace_alloc(enum kmemtrace_type_id type_id, | |||
62 | entry->gfp_flags = gfp_flags; | 63 | entry->gfp_flags = gfp_flags; |
63 | entry->node = node; | 64 | entry->node = node; |
64 | 65 | ||
65 | ring_buffer_unlock_commit(tr->buffer, event); | 66 | if (!filter_check_discard(call, entry, tr->buffer, event)) |
67 | ring_buffer_unlock_commit(tr->buffer, event); | ||
66 | 68 | ||
67 | trace_wake_up(); | 69 | trace_wake_up(); |
68 | } | 70 | } |
@@ -71,6 +73,7 @@ static inline void kmemtrace_free(enum kmemtrace_type_id type_id, | |||
71 | unsigned long call_site, | 73 | unsigned long call_site, |
72 | const void *ptr) | 74 | const void *ptr) |
73 | { | 75 | { |
76 | struct ftrace_event_call *call = &event_kmem_free; | ||
74 | struct trace_array *tr = kmemtrace_array; | 77 | struct trace_array *tr = kmemtrace_array; |
75 | struct kmemtrace_free_entry *entry; | 78 | struct kmemtrace_free_entry *entry; |
76 | struct ring_buffer_event *event; | 79 | struct ring_buffer_event *event; |
@@ -86,7 +89,8 @@ static inline void kmemtrace_free(enum kmemtrace_type_id type_id, | |||
86 | entry->call_site = call_site; | 89 | entry->call_site = call_site; |
87 | entry->ptr = ptr; | 90 | entry->ptr = ptr; |
88 | 91 | ||
89 | ring_buffer_unlock_commit(tr->buffer, event); | 92 | if (!filter_check_discard(call, entry, tr->buffer, event)) |
93 | ring_buffer_unlock_commit(tr->buffer, event); | ||
90 | 94 | ||
91 | trace_wake_up(); | 95 | trace_wake_up(); |
92 | } | 96 | } |