[PATCH] tracing: Allow larger than PAGE_SIZE filter pattern

From: Zi Yan
Date: Fri Feb 20 2015 - 18:48:48 EST


Large applications(e.g. Cassandra) may have hundreds of threads
running. To trace all those threads, larger size(>PAGE_SIZE) of
filter pattern is needed.

Signed-off-by: Zi Yan <zi.yan@xxxxxxxxxxxxxx>
---
kernel/trace/trace_events.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c
index db54dda..8347c48 100644
--- a/kernel/trace/trace_events.c
+++ b/kernel/trace/trace_events.c
@@ -1092,15 +1092,12 @@ event_filter_write(struct file *filp, const char __user *ubuf, size_t cnt,
char *buf;
int err = -ENODEV;

- if (cnt >= PAGE_SIZE)
- return -EINVAL;
-
- buf = (char *)__get_free_page(GFP_TEMPORARY);
+ buf = (char *)alloc_pages_exact(cnt, GFP_TEMPORARY);
if (!buf)
return -ENOMEM;

if (copy_from_user(buf, ubuf, cnt)) {
- free_page((unsigned long) buf);
+ free_pages_exact((unsigned long) buf, cnt);
return -EFAULT;
}
buf[cnt] = '\0';
@@ -1111,7 +1108,7 @@ event_filter_write(struct file *filp, const char __user *ubuf, size_t cnt,
err = apply_event_filter(file, buf);
mutex_unlock(&event_mutex);

- free_page((unsigned long) buf);
+ free_pages_exact((unsigned long) buf, cnt);
if (err < 0)
return err;

--
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/