diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-04-10 06:46:28 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-10 06:46:51 -0400 |
commit | 1cad1252ed279ea59f3f8d3d3a5817eeb2f7a4d3 (patch) | |
tree | ec5af7a70f58ad27ad21fc27815ca164ccf92c36 /kernel/trace | |
parent | dcef788eb9659b61a2110284fcce3ca6e63480d2 (diff) | |
parent | 93cfb3c9fd83d877a8f1ffad9ff862b617b32828 (diff) |
Merge branch 'tracing/urgent' into tracing/core
Merge reason: pick up both v2.6.30-rc1 [which includes tracing/urgent fixes]
and pick up the current lineup of tracing/urgent fixes as well
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/blktrace.c | 10 | ||||
-rw-r--r-- | kernel/trace/trace.c | 36 | ||||
-rw-r--r-- | kernel/trace/trace_syscalls.c | 2 |
3 files changed, 27 insertions, 21 deletions
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index b32ff446c3fb..921ef5d1f0ba 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c | |||
@@ -1377,12 +1377,12 @@ static int blk_trace_str2mask(const char *str) | |||
1377 | { | 1377 | { |
1378 | int i; | 1378 | int i; |
1379 | int mask = 0; | 1379 | int mask = 0; |
1380 | char *s, *token; | 1380 | char *buf, *s, *token; |
1381 | 1381 | ||
1382 | s = kstrdup(str, GFP_KERNEL); | 1382 | buf = kstrdup(str, GFP_KERNEL); |
1383 | if (s == NULL) | 1383 | if (buf == NULL) |
1384 | return -ENOMEM; | 1384 | return -ENOMEM; |
1385 | s = strstrip(s); | 1385 | s = strstrip(buf); |
1386 | 1386 | ||
1387 | while (1) { | 1387 | while (1) { |
1388 | token = strsep(&s, ","); | 1388 | token = strsep(&s, ","); |
@@ -1403,7 +1403,7 @@ static int blk_trace_str2mask(const char *str) | |||
1403 | break; | 1403 | break; |
1404 | } | 1404 | } |
1405 | } | 1405 | } |
1406 | kfree(s); | 1406 | kfree(buf); |
1407 | 1407 | ||
1408 | return mask; | 1408 | return mask; |
1409 | } | 1409 | } |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 0615751a3ed7..4865459f609f 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -3268,19 +3268,13 @@ static int tracing_buffers_open(struct inode *inode, struct file *filp) | |||
3268 | 3268 | ||
3269 | info->tr = &global_trace; | 3269 | info->tr = &global_trace; |
3270 | info->cpu = cpu; | 3270 | info->cpu = cpu; |
3271 | info->spare = ring_buffer_alloc_read_page(info->tr->buffer); | 3271 | info->spare = NULL; |
3272 | /* Force reading ring buffer for first read */ | 3272 | /* Force reading ring buffer for first read */ |
3273 | info->read = (unsigned int)-1; | 3273 | info->read = (unsigned int)-1; |
3274 | if (!info->spare) | ||
3275 | goto out; | ||
3276 | 3274 | ||
3277 | filp->private_data = info; | 3275 | filp->private_data = info; |
3278 | 3276 | ||
3279 | return 0; | 3277 | return nonseekable_open(inode, filp); |
3280 | |||
3281 | out: | ||
3282 | kfree(info); | ||
3283 | return -ENOMEM; | ||
3284 | } | 3278 | } |
3285 | 3279 | ||
3286 | static ssize_t | 3280 | static ssize_t |
@@ -3295,6 +3289,11 @@ tracing_buffers_read(struct file *filp, char __user *ubuf, | |||
3295 | if (!count) | 3289 | if (!count) |
3296 | return 0; | 3290 | return 0; |
3297 | 3291 | ||
3292 | if (!info->spare) | ||
3293 | info->spare = ring_buffer_alloc_read_page(info->tr->buffer); | ||
3294 | if (!info->spare) | ||
3295 | return -ENOMEM; | ||
3296 | |||
3298 | /* Do we have previous read data to read? */ | 3297 | /* Do we have previous read data to read? */ |
3299 | if (info->read < PAGE_SIZE) | 3298 | if (info->read < PAGE_SIZE) |
3300 | goto read; | 3299 | goto read; |
@@ -3333,7 +3332,8 @@ static int tracing_buffers_release(struct inode *inode, struct file *file) | |||
3333 | { | 3332 | { |
3334 | struct ftrace_buffer_info *info = file->private_data; | 3333 | struct ftrace_buffer_info *info = file->private_data; |
3335 | 3334 | ||
3336 | ring_buffer_free_read_page(info->tr->buffer, info->spare); | 3335 | if (info->spare) |
3336 | ring_buffer_free_read_page(info->tr->buffer, info->spare); | ||
3337 | kfree(info); | 3337 | kfree(info); |
3338 | 3338 | ||
3339 | return 0; | 3339 | return 0; |
@@ -3419,14 +3419,19 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos, | |||
3419 | int size, i; | 3419 | int size, i; |
3420 | size_t ret; | 3420 | size_t ret; |
3421 | 3421 | ||
3422 | /* | 3422 | if (*ppos & (PAGE_SIZE - 1)) { |
3423 | * We can't seek on a buffer input | 3423 | WARN_ONCE(1, "Ftrace: previous read must page-align\n"); |
3424 | */ | 3424 | return -EINVAL; |
3425 | if (unlikely(*ppos)) | 3425 | } |
3426 | return -ESPIPE; | ||
3427 | 3426 | ||
3427 | if (len & (PAGE_SIZE - 1)) { | ||
3428 | WARN_ONCE(1, "Ftrace: splice_read should page-align\n"); | ||
3429 | if (len < PAGE_SIZE) | ||
3430 | return -EINVAL; | ||
3431 | len &= PAGE_MASK; | ||
3432 | } | ||
3428 | 3433 | ||
3429 | for (i = 0; i < PIPE_BUFFERS && len; i++, len -= size) { | 3434 | for (i = 0; i < PIPE_BUFFERS && len; i++, len -= PAGE_SIZE) { |
3430 | struct page *page; | 3435 | struct page *page; |
3431 | int r; | 3436 | int r; |
3432 | 3437 | ||
@@ -3465,6 +3470,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos, | |||
3465 | spd.partial[i].offset = 0; | 3470 | spd.partial[i].offset = 0; |
3466 | spd.partial[i].private = (unsigned long)ref; | 3471 | spd.partial[i].private = (unsigned long)ref; |
3467 | spd.nr_pages++; | 3472 | spd.nr_pages++; |
3473 | *ppos += PAGE_SIZE; | ||
3468 | } | 3474 | } |
3469 | 3475 | ||
3470 | spd.nr_pages = i; | 3476 | spd.nr_pages = i; |
diff --git a/kernel/trace/trace_syscalls.c b/kernel/trace/trace_syscalls.c index a2a3af29c943..5e579645ac86 100644 --- a/kernel/trace/trace_syscalls.c +++ b/kernel/trace/trace_syscalls.c | |||
@@ -1,5 +1,5 @@ | |||
1 | #include <trace/syscall.h> | ||
1 | #include <linux/kernel.h> | 2 | #include <linux/kernel.h> |
2 | #include <linux/ftrace.h> | ||
3 | #include <asm/syscall.h> | 3 | #include <asm/syscall.h> |
4 | 4 | ||
5 | #include "trace_output.h" | 5 | #include "trace_output.h" |