diff options
author | Ingo Molnar <mingo@elte.hu> | 2009-04-24 04:11:18 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-24 04:11:23 -0400 |
commit | 416dfdcdb894432547ead4fcb9fa6a36b396059e (patch) | |
tree | 8033fdda07397a59c5fa98c88927040906ce6c1a /kernel/trace | |
parent | 56449f437add737a1e5e1cb7e00f63ac8ead1938 (diff) | |
parent | 091069740304c979f957ceacec39c461d0192158 (diff) |
Merge commit 'v2.6.30-rc3' into tracing/hw-branch-tracing
Conflicts:
arch/x86/kernel/ptrace.c
Merge reason: fix the conflict above, and also pick up the CONFIG_BROKEN
dependency change from upstream so that we can remove it
here.
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace')
-rw-r--r-- | kernel/trace/Kconfig | 4 | ||||
-rw-r--r-- | kernel/trace/blktrace.c | 17 | ||||
-rw-r--r-- | kernel/trace/trace.c | 57 | ||||
-rw-r--r-- | kernel/trace/trace.h | 2 | ||||
-rw-r--r-- | kernel/trace/trace_branch.c | 8 | ||||
-rw-r--r-- | kernel/trace/trace_events.c | 12 | ||||
-rw-r--r-- | kernel/trace/trace_events_filter.c | 14 | ||||
-rw-r--r-- | kernel/trace/trace_events_stage_2.h | 4 | ||||
-rw-r--r-- | kernel/trace/trace_export.c | 2 | ||||
-rw-r--r-- | kernel/trace/trace_output.c | 2 | ||||
-rw-r--r-- | kernel/trace/trace_power.c | 7 | ||||
-rw-r--r-- | kernel/trace/trace_sched_switch.c | 3 | ||||
-rw-r--r-- | kernel/trace/trace_sched_wakeup.c | 8 | ||||
-rw-r--r-- | kernel/trace/trace_syscalls.c | 2 |
14 files changed, 97 insertions, 45 deletions
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 2246141bda4d..417d1985e299 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig | |||
@@ -312,7 +312,7 @@ config KMEMTRACE | |||
312 | and profile kernel code. | 312 | and profile kernel code. |
313 | 313 | ||
314 | This requires an userspace application to use. See | 314 | This requires an userspace application to use. See |
315 | Documentation/vm/kmemtrace.txt for more information. | 315 | Documentation/trace/kmemtrace.txt for more information. |
316 | 316 | ||
317 | Saying Y will make the kernel somewhat larger and slower. However, | 317 | Saying Y will make the kernel somewhat larger and slower. However, |
318 | if you disable kmemtrace at run-time or boot-time, the performance | 318 | if you disable kmemtrace at run-time or boot-time, the performance |
@@ -403,7 +403,7 @@ config MMIOTRACE | |||
403 | implementation and works via page faults. Tracing is disabled by | 403 | implementation and works via page faults. Tracing is disabled by |
404 | default and can be enabled at run-time. | 404 | default and can be enabled at run-time. |
405 | 405 | ||
406 | See Documentation/tracers/mmiotrace.txt. | 406 | See Documentation/trace/mmiotrace.txt. |
407 | If you are not helping to develop drivers, say N. | 407 | If you are not helping to develop drivers, say N. |
408 | 408 | ||
409 | config MMIOTRACE_TEST | 409 | config MMIOTRACE_TEST |
diff --git a/kernel/trace/blktrace.c b/kernel/trace/blktrace.c index 947c5b3f90c4..921ef5d1f0ba 100644 --- a/kernel/trace/blktrace.c +++ b/kernel/trace/blktrace.c | |||
@@ -327,10 +327,10 @@ static ssize_t blk_msg_write(struct file *filp, const char __user *buffer, | |||
327 | char *msg; | 327 | char *msg; |
328 | struct blk_trace *bt; | 328 | struct blk_trace *bt; |
329 | 329 | ||
330 | if (count > BLK_TN_MAX_MSG) | 330 | if (count >= BLK_TN_MAX_MSG) |
331 | return -EINVAL; | 331 | return -EINVAL; |
332 | 332 | ||
333 | msg = kmalloc(count, GFP_KERNEL); | 333 | msg = kmalloc(count + 1, GFP_KERNEL); |
334 | if (msg == NULL) | 334 | if (msg == NULL) |
335 | return -ENOMEM; | 335 | return -ENOMEM; |
336 | 336 | ||
@@ -339,6 +339,7 @@ static ssize_t blk_msg_write(struct file *filp, const char __user *buffer, | |||
339 | return -EFAULT; | 339 | return -EFAULT; |
340 | } | 340 | } |
341 | 341 | ||
342 | msg[count] = '\0'; | ||
342 | bt = filp->private_data; | 343 | bt = filp->private_data; |
343 | __trace_note_message(bt, "%s", msg); | 344 | __trace_note_message(bt, "%s", msg); |
344 | kfree(msg); | 345 | kfree(msg); |
@@ -642,7 +643,7 @@ static void blk_add_trace_rq(struct request_queue *q, struct request *rq, | |||
642 | if (blk_pc_request(rq)) { | 643 | if (blk_pc_request(rq)) { |
643 | what |= BLK_TC_ACT(BLK_TC_PC); | 644 | what |= BLK_TC_ACT(BLK_TC_PC); |
644 | __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, | 645 | __blk_add_trace(bt, 0, rq->data_len, rw, what, rq->errors, |
645 | sizeof(rq->cmd), rq->cmd); | 646 | rq->cmd_len, rq->cmd); |
646 | } else { | 647 | } else { |
647 | what |= BLK_TC_ACT(BLK_TC_FS); | 648 | what |= BLK_TC_ACT(BLK_TC_FS); |
648 | __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, | 649 | __blk_add_trace(bt, rq->hard_sector, rq->hard_nr_sectors << 9, |
@@ -1376,12 +1377,12 @@ static int blk_trace_str2mask(const char *str) | |||
1376 | { | 1377 | { |
1377 | int i; | 1378 | int i; |
1378 | int mask = 0; | 1379 | int mask = 0; |
1379 | char *s, *token; | 1380 | char *buf, *s, *token; |
1380 | 1381 | ||
1381 | s = kstrdup(str, GFP_KERNEL); | 1382 | buf = kstrdup(str, GFP_KERNEL); |
1382 | if (s == NULL) | 1383 | if (buf == NULL) |
1383 | return -ENOMEM; | 1384 | return -ENOMEM; |
1384 | s = strstrip(s); | 1385 | s = strstrip(buf); |
1385 | 1386 | ||
1386 | while (1) { | 1387 | while (1) { |
1387 | token = strsep(&s, ","); | 1388 | token = strsep(&s, ","); |
@@ -1402,7 +1403,7 @@ static int blk_trace_str2mask(const char *str) | |||
1402 | break; | 1403 | break; |
1403 | } | 1404 | } |
1404 | } | 1405 | } |
1405 | kfree(s); | 1406 | kfree(buf); |
1406 | 1407 | ||
1407 | return mask; | 1408 | return mask; |
1408 | } | 1409 | } |
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index a0174a40c563..1ce5dc6372b8 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -30,6 +30,7 @@ | |||
30 | #include <linux/percpu.h> | 30 | #include <linux/percpu.h> |
31 | #include <linux/splice.h> | 31 | #include <linux/splice.h> |
32 | #include <linux/kdebug.h> | 32 | #include <linux/kdebug.h> |
33 | #include <linux/string.h> | ||
33 | #include <linux/ctype.h> | 34 | #include <linux/ctype.h> |
34 | #include <linux/init.h> | 35 | #include <linux/init.h> |
35 | #include <linux/poll.h> | 36 | #include <linux/poll.h> |
@@ -147,8 +148,7 @@ static int __init set_ftrace_dump_on_oops(char *str) | |||
147 | } | 148 | } |
148 | __setup("ftrace_dump_on_oops", set_ftrace_dump_on_oops); | 149 | __setup("ftrace_dump_on_oops", set_ftrace_dump_on_oops); |
149 | 150 | ||
150 | long | 151 | unsigned long long ns2usecs(cycle_t nsec) |
151 | ns2usecs(cycle_t nsec) | ||
152 | { | 152 | { |
153 | nsec += 500; | 153 | nsec += 500; |
154 | do_div(nsec, 1000); | 154 | do_div(nsec, 1000); |
@@ -1632,7 +1632,11 @@ static void test_cpu_buff_start(struct trace_iterator *iter) | |||
1632 | return; | 1632 | return; |
1633 | 1633 | ||
1634 | cpumask_set_cpu(iter->cpu, iter->started); | 1634 | cpumask_set_cpu(iter->cpu, iter->started); |
1635 | trace_seq_printf(s, "##### CPU %u buffer started ####\n", iter->cpu); | 1635 | |
1636 | /* Don't print started cpu buffer for the first entry of the trace */ | ||
1637 | if (iter->idx > 1) | ||
1638 | trace_seq_printf(s, "##### CPU %u buffer started ####\n", | ||
1639 | iter->cpu); | ||
1636 | } | 1640 | } |
1637 | 1641 | ||
1638 | static enum print_line_t print_trace_fmt(struct trace_iterator *iter) | 1642 | static enum print_line_t print_trace_fmt(struct trace_iterator *iter) |
@@ -1867,6 +1871,11 @@ __tracing_open(struct inode *inode, struct file *file) | |||
1867 | if (current_trace) | 1871 | if (current_trace) |
1868 | *iter->trace = *current_trace; | 1872 | *iter->trace = *current_trace; |
1869 | 1873 | ||
1874 | if (!alloc_cpumask_var(&iter->started, GFP_KERNEL)) | ||
1875 | goto fail; | ||
1876 | |||
1877 | cpumask_clear(iter->started); | ||
1878 | |||
1870 | if (current_trace && current_trace->print_max) | 1879 | if (current_trace && current_trace->print_max) |
1871 | iter->tr = &max_tr; | 1880 | iter->tr = &max_tr; |
1872 | else | 1881 | else |
@@ -1917,6 +1926,7 @@ __tracing_open(struct inode *inode, struct file *file) | |||
1917 | if (iter->buffer_iter[cpu]) | 1926 | if (iter->buffer_iter[cpu]) |
1918 | ring_buffer_read_finish(iter->buffer_iter[cpu]); | 1927 | ring_buffer_read_finish(iter->buffer_iter[cpu]); |
1919 | } | 1928 | } |
1929 | free_cpumask_var(iter->started); | ||
1920 | fail: | 1930 | fail: |
1921 | mutex_unlock(&trace_types_lock); | 1931 | mutex_unlock(&trace_types_lock); |
1922 | kfree(iter->trace); | 1932 | kfree(iter->trace); |
@@ -1960,6 +1970,7 @@ static int tracing_release(struct inode *inode, struct file *file) | |||
1960 | 1970 | ||
1961 | seq_release(inode, file); | 1971 | seq_release(inode, file); |
1962 | mutex_destroy(&iter->mutex); | 1972 | mutex_destroy(&iter->mutex); |
1973 | free_cpumask_var(iter->started); | ||
1963 | kfree(iter->trace); | 1974 | kfree(iter->trace); |
1964 | kfree(iter); | 1975 | kfree(iter); |
1965 | return 0; | 1976 | return 0; |
@@ -2358,9 +2369,9 @@ static const char readme_msg[] = | |||
2358 | "# mkdir /debug\n" | 2369 | "# mkdir /debug\n" |
2359 | "# mount -t debugfs nodev /debug\n\n" | 2370 | "# mount -t debugfs nodev /debug\n\n" |
2360 | "# cat /debug/tracing/available_tracers\n" | 2371 | "# cat /debug/tracing/available_tracers\n" |
2361 | "wakeup preemptirqsoff preemptoff irqsoff ftrace sched_switch none\n\n" | 2372 | "wakeup preemptirqsoff preemptoff irqsoff function sched_switch nop\n\n" |
2362 | "# cat /debug/tracing/current_tracer\n" | 2373 | "# cat /debug/tracing/current_tracer\n" |
2363 | "none\n" | 2374 | "nop\n" |
2364 | "# echo sched_switch > /debug/tracing/current_tracer\n" | 2375 | "# echo sched_switch > /debug/tracing/current_tracer\n" |
2365 | "# cat /debug/tracing/current_tracer\n" | 2376 | "# cat /debug/tracing/current_tracer\n" |
2366 | "sched_switch\n" | 2377 | "sched_switch\n" |
@@ -3266,19 +3277,13 @@ static int tracing_buffers_open(struct inode *inode, struct file *filp) | |||
3266 | 3277 | ||
3267 | info->tr = &global_trace; | 3278 | info->tr = &global_trace; |
3268 | info->cpu = cpu; | 3279 | info->cpu = cpu; |
3269 | info->spare = ring_buffer_alloc_read_page(info->tr->buffer); | 3280 | info->spare = NULL; |
3270 | /* Force reading ring buffer for first read */ | 3281 | /* Force reading ring buffer for first read */ |
3271 | info->read = (unsigned int)-1; | 3282 | info->read = (unsigned int)-1; |
3272 | if (!info->spare) | ||
3273 | goto out; | ||
3274 | 3283 | ||
3275 | filp->private_data = info; | 3284 | filp->private_data = info; |
3276 | 3285 | ||
3277 | return 0; | 3286 | return nonseekable_open(inode, filp); |
3278 | |||
3279 | out: | ||
3280 | kfree(info); | ||
3281 | return -ENOMEM; | ||
3282 | } | 3287 | } |
3283 | 3288 | ||
3284 | static ssize_t | 3289 | static ssize_t |
@@ -3293,6 +3298,11 @@ tracing_buffers_read(struct file *filp, char __user *ubuf, | |||
3293 | if (!count) | 3298 | if (!count) |
3294 | return 0; | 3299 | return 0; |
3295 | 3300 | ||
3301 | if (!info->spare) | ||
3302 | info->spare = ring_buffer_alloc_read_page(info->tr->buffer); | ||
3303 | if (!info->spare) | ||
3304 | return -ENOMEM; | ||
3305 | |||
3296 | /* Do we have previous read data to read? */ | 3306 | /* Do we have previous read data to read? */ |
3297 | if (info->read < PAGE_SIZE) | 3307 | if (info->read < PAGE_SIZE) |
3298 | goto read; | 3308 | goto read; |
@@ -3331,7 +3341,8 @@ static int tracing_buffers_release(struct inode *inode, struct file *file) | |||
3331 | { | 3341 | { |
3332 | struct ftrace_buffer_info *info = file->private_data; | 3342 | struct ftrace_buffer_info *info = file->private_data; |
3333 | 3343 | ||
3334 | ring_buffer_free_read_page(info->tr->buffer, info->spare); | 3344 | if (info->spare) |
3345 | ring_buffer_free_read_page(info->tr->buffer, info->spare); | ||
3335 | kfree(info); | 3346 | kfree(info); |
3336 | 3347 | ||
3337 | return 0; | 3348 | return 0; |
@@ -3417,14 +3428,19 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos, | |||
3417 | int size, i; | 3428 | int size, i; |
3418 | size_t ret; | 3429 | size_t ret; |
3419 | 3430 | ||
3420 | /* | 3431 | if (*ppos & (PAGE_SIZE - 1)) { |
3421 | * We can't seek on a buffer input | 3432 | WARN_ONCE(1, "Ftrace: previous read must page-align\n"); |
3422 | */ | 3433 | return -EINVAL; |
3423 | if (unlikely(*ppos)) | 3434 | } |
3424 | return -ESPIPE; | ||
3425 | 3435 | ||
3436 | if (len & (PAGE_SIZE - 1)) { | ||
3437 | WARN_ONCE(1, "Ftrace: splice_read should page-align\n"); | ||
3438 | if (len < PAGE_SIZE) | ||
3439 | return -EINVAL; | ||
3440 | len &= PAGE_MASK; | ||
3441 | } | ||
3426 | 3442 | ||
3427 | for (i = 0; i < PIPE_BUFFERS && len; i++, len -= size) { | 3443 | for (i = 0; i < PIPE_BUFFERS && len; i++, len -= PAGE_SIZE) { |
3428 | struct page *page; | 3444 | struct page *page; |
3429 | int r; | 3445 | int r; |
3430 | 3446 | ||
@@ -3463,6 +3479,7 @@ tracing_buffers_splice_read(struct file *file, loff_t *ppos, | |||
3463 | spd.partial[i].offset = 0; | 3479 | spd.partial[i].offset = 0; |
3464 | spd.partial[i].private = (unsigned long)ref; | 3480 | spd.partial[i].private = (unsigned long)ref; |
3465 | spd.nr_pages++; | 3481 | spd.nr_pages++; |
3482 | *ppos += PAGE_SIZE; | ||
3466 | } | 3483 | } |
3467 | 3484 | ||
3468 | spd.nr_pages = i; | 3485 | spd.nr_pages = i; |
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h index 9e15802cca9f..7c3f49aad6e2 100644 --- a/kernel/trace/trace.h +++ b/kernel/trace/trace.h | |||
@@ -604,7 +604,7 @@ extern int trace_selftest_startup_hw_branches(struct tracer *trace, | |||
604 | #endif /* CONFIG_FTRACE_STARTUP_TEST */ | 604 | #endif /* CONFIG_FTRACE_STARTUP_TEST */ |
605 | 605 | ||
606 | extern void *head_page(struct trace_array_cpu *data); | 606 | extern void *head_page(struct trace_array_cpu *data); |
607 | extern long ns2usecs(cycle_t nsec); | 607 | extern unsigned long long ns2usecs(cycle_t nsec); |
608 | extern int | 608 | extern int |
609 | trace_vbprintk(unsigned long ip, const char *fmt, va_list args); | 609 | trace_vbprintk(unsigned long ip, const char *fmt, va_list args); |
610 | extern int | 610 | extern int |
diff --git a/kernel/trace/trace_branch.c b/kernel/trace/trace_branch.c index ad8c22efff41..8333715e4066 100644 --- a/kernel/trace/trace_branch.c +++ b/kernel/trace/trace_branch.c | |||
@@ -155,6 +155,13 @@ static enum print_line_t trace_branch_print(struct trace_iterator *iter, | |||
155 | return TRACE_TYPE_HANDLED; | 155 | return TRACE_TYPE_HANDLED; |
156 | } | 156 | } |
157 | 157 | ||
158 | static void branch_print_header(struct seq_file *s) | ||
159 | { | ||
160 | seq_puts(s, "# TASK-PID CPU# TIMESTAMP CORRECT" | ||
161 | " FUNC:FILE:LINE\n"); | ||
162 | seq_puts(s, "# | | | | | " | ||
163 | " |\n"); | ||
164 | } | ||
158 | 165 | ||
159 | static struct trace_event trace_branch_event = { | 166 | static struct trace_event trace_branch_event = { |
160 | .type = TRACE_BRANCH, | 167 | .type = TRACE_BRANCH, |
@@ -169,6 +176,7 @@ static struct tracer branch_trace __read_mostly = | |||
169 | #ifdef CONFIG_FTRACE_SELFTEST | 176 | #ifdef CONFIG_FTRACE_SELFTEST |
170 | .selftest = trace_selftest_startup_branch, | 177 | .selftest = trace_selftest_startup_branch, |
171 | #endif /* CONFIG_FTRACE_SELFTEST */ | 178 | #endif /* CONFIG_FTRACE_SELFTEST */ |
179 | .print_header = branch_print_header, | ||
172 | }; | 180 | }; |
173 | 181 | ||
174 | __init static int init_branch_tracer(void) | 182 | __init static int init_branch_tracer(void) |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index 64ec4d278ffb..576f4fa2af0d 100644 --- a/kernel/trace/trace_events.c +++ b/kernel/trace/trace_events.c | |||
@@ -503,6 +503,7 @@ event_filter_write(struct file *filp, const char __user *ubuf, size_t cnt, | |||
503 | 503 | ||
504 | if (copy_from_user(&buf, ubuf, cnt)) | 504 | if (copy_from_user(&buf, ubuf, cnt)) |
505 | return -EFAULT; | 505 | return -EFAULT; |
506 | buf[cnt] = '\0'; | ||
506 | 507 | ||
507 | pred = kzalloc(sizeof(*pred), GFP_KERNEL); | 508 | pred = kzalloc(sizeof(*pred), GFP_KERNEL); |
508 | if (!pred) | 509 | if (!pred) |
@@ -520,9 +521,10 @@ event_filter_write(struct file *filp, const char __user *ubuf, size_t cnt, | |||
520 | return cnt; | 521 | return cnt; |
521 | } | 522 | } |
522 | 523 | ||
523 | if (filter_add_pred(call, pred)) { | 524 | err = filter_add_pred(call, pred); |
525 | if (err < 0) { | ||
524 | filter_free_pred(pred); | 526 | filter_free_pred(pred); |
525 | return -EINVAL; | 527 | return err; |
526 | } | 528 | } |
527 | 529 | ||
528 | *ppos += cnt; | 530 | *ppos += cnt; |
@@ -569,6 +571,7 @@ subsystem_filter_write(struct file *filp, const char __user *ubuf, size_t cnt, | |||
569 | 571 | ||
570 | if (copy_from_user(&buf, ubuf, cnt)) | 572 | if (copy_from_user(&buf, ubuf, cnt)) |
571 | return -EFAULT; | 573 | return -EFAULT; |
574 | buf[cnt] = '\0'; | ||
572 | 575 | ||
573 | pred = kzalloc(sizeof(*pred), GFP_KERNEL); | 576 | pred = kzalloc(sizeof(*pred), GFP_KERNEL); |
574 | if (!pred) | 577 | if (!pred) |
@@ -586,10 +589,11 @@ subsystem_filter_write(struct file *filp, const char __user *ubuf, size_t cnt, | |||
586 | return cnt; | 589 | return cnt; |
587 | } | 590 | } |
588 | 591 | ||
589 | if (filter_add_subsystem_pred(system, pred)) { | 592 | err = filter_add_subsystem_pred(system, pred); |
593 | if (err < 0) { | ||
590 | filter_free_subsystem_preds(system); | 594 | filter_free_subsystem_preds(system); |
591 | filter_free_pred(pred); | 595 | filter_free_pred(pred); |
592 | return -EINVAL; | 596 | return err; |
593 | } | 597 | } |
594 | 598 | ||
595 | *ppos += cnt; | 599 | *ppos += cnt; |
diff --git a/kernel/trace/trace_events_filter.c b/kernel/trace/trace_events_filter.c index 026be412f356..e03cbf1e38f3 100644 --- a/kernel/trace/trace_events_filter.c +++ b/kernel/trace/trace_events_filter.c | |||
@@ -215,7 +215,7 @@ static int __filter_add_pred(struct ftrace_event_call *call, | |||
215 | } | 215 | } |
216 | } | 216 | } |
217 | 217 | ||
218 | return -ENOMEM; | 218 | return -ENOSPC; |
219 | } | 219 | } |
220 | 220 | ||
221 | static int is_string_field(const char *type) | 221 | static int is_string_field(const char *type) |
@@ -319,7 +319,7 @@ int filter_add_subsystem_pred(struct event_subsystem *system, | |||
319 | } | 319 | } |
320 | 320 | ||
321 | if (i == MAX_FILTER_PRED) | 321 | if (i == MAX_FILTER_PRED) |
322 | return -EINVAL; | 322 | return -ENOSPC; |
323 | 323 | ||
324 | events_for_each(call) { | 324 | events_for_each(call) { |
325 | int err; | 325 | int err; |
@@ -410,16 +410,22 @@ int filter_parse(char **pbuf, struct filter_pred *pred) | |||
410 | } | 410 | } |
411 | } | 411 | } |
412 | 412 | ||
413 | if (!val_str) { | ||
414 | pred->field_name = NULL; | ||
415 | return -EINVAL; | ||
416 | } | ||
417 | |||
413 | pred->field_name = kstrdup(pred->field_name, GFP_KERNEL); | 418 | pred->field_name = kstrdup(pred->field_name, GFP_KERNEL); |
414 | if (!pred->field_name) | 419 | if (!pred->field_name) |
415 | return -ENOMEM; | 420 | return -ENOMEM; |
416 | 421 | ||
417 | pred->val = simple_strtoull(val_str, &tmp, 10); | 422 | pred->val = simple_strtoull(val_str, &tmp, 0); |
418 | if (tmp == val_str) { | 423 | if (tmp == val_str) { |
419 | pred->str_val = kstrdup(val_str, GFP_KERNEL); | 424 | pred->str_val = kstrdup(val_str, GFP_KERNEL); |
420 | if (!pred->str_val) | 425 | if (!pred->str_val) |
421 | return -ENOMEM; | 426 | return -ENOMEM; |
422 | } | 427 | } else if (*tmp != '\0') |
428 | return -EINVAL; | ||
423 | 429 | ||
424 | return 0; | 430 | return 0; |
425 | } | 431 | } |
diff --git a/kernel/trace/trace_events_stage_2.h b/kernel/trace/trace_events_stage_2.h index 30743f7d4110..d363c6672c6c 100644 --- a/kernel/trace/trace_events_stage_2.h +++ b/kernel/trace/trace_events_stage_2.h | |||
@@ -105,10 +105,10 @@ ftrace_raw_output_##call(struct trace_iterator *iter, int flags) \ | |||
105 | return 0; | 105 | return 0; |
106 | 106 | ||
107 | #undef __entry | 107 | #undef __entry |
108 | #define __entry "REC" | 108 | #define __entry REC |
109 | 109 | ||
110 | #undef TP_printk | 110 | #undef TP_printk |
111 | #define TP_printk(fmt, args...) "%s, %s\n", #fmt, #args | 111 | #define TP_printk(fmt, args...) "%s, %s\n", #fmt, __stringify(args) |
112 | 112 | ||
113 | #undef TP_fast_assign | 113 | #undef TP_fast_assign |
114 | #define TP_fast_assign(args...) args | 114 | #define TP_fast_assign(args...) args |
diff --git a/kernel/trace/trace_export.c b/kernel/trace/trace_export.c index 4d9952d3df50..07a22c33ebf3 100644 --- a/kernel/trace/trace_export.c +++ b/kernel/trace/trace_export.c | |||
@@ -40,7 +40,7 @@ | |||
40 | 40 | ||
41 | #undef TRACE_FIELD_ZERO_CHAR | 41 | #undef TRACE_FIELD_ZERO_CHAR |
42 | #define TRACE_FIELD_ZERO_CHAR(item) \ | 42 | #define TRACE_FIELD_ZERO_CHAR(item) \ |
43 | ret = trace_seq_printf(s, "\tfield: char " #item ";\t" \ | 43 | ret = trace_seq_printf(s, "\tfield:char " #item ";\t" \ |
44 | "offset:%u;\tsize:0;\n", \ | 44 | "offset:%u;\tsize:0;\n", \ |
45 | (unsigned int)offsetof(typeof(field), item)); \ | 45 | (unsigned int)offsetof(typeof(field), item)); \ |
46 | if (!ret) \ | 46 | if (!ret) \ |
diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index d72b9a63b247..64b54a59c55b 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c | |||
@@ -423,7 +423,7 @@ int trace_print_lat_context(struct trace_iterator *iter) | |||
423 | 423 | ||
424 | trace_find_cmdline(entry->pid, comm); | 424 | trace_find_cmdline(entry->pid, comm); |
425 | 425 | ||
426 | ret = trace_seq_printf(s, "%16s %5d %3d %d %08x %08lx [%08lx]" | 426 | ret = trace_seq_printf(s, "%16s %5d %3d %d %08x %08lx [%08llx]" |
427 | " %ld.%03ldms (+%ld.%03ldms): ", comm, | 427 | " %ld.%03ldms (+%ld.%03ldms): ", comm, |
428 | entry->pid, iter->cpu, entry->flags, | 428 | entry->pid, iter->cpu, entry->flags, |
429 | entry->preempt_count, iter->idx, | 429 | entry->preempt_count, iter->idx, |
diff --git a/kernel/trace/trace_power.c b/kernel/trace/trace_power.c index bae791ebcc51..118439709fb7 100644 --- a/kernel/trace/trace_power.c +++ b/kernel/trace/trace_power.c | |||
@@ -186,6 +186,12 @@ static enum print_line_t power_print_line(struct trace_iterator *iter) | |||
186 | return TRACE_TYPE_UNHANDLED; | 186 | return TRACE_TYPE_UNHANDLED; |
187 | } | 187 | } |
188 | 188 | ||
189 | static void power_print_header(struct seq_file *s) | ||
190 | { | ||
191 | seq_puts(s, "# TIMESTAMP STATE EVENT\n"); | ||
192 | seq_puts(s, "# | | |\n"); | ||
193 | } | ||
194 | |||
189 | static struct tracer power_tracer __read_mostly = | 195 | static struct tracer power_tracer __read_mostly = |
190 | { | 196 | { |
191 | .name = "power", | 197 | .name = "power", |
@@ -194,6 +200,7 @@ static struct tracer power_tracer __read_mostly = | |||
194 | .stop = stop_power_trace, | 200 | .stop = stop_power_trace, |
195 | .reset = power_trace_reset, | 201 | .reset = power_trace_reset, |
196 | .print_line = power_print_line, | 202 | .print_line = power_print_line, |
203 | .print_header = power_print_header, | ||
197 | }; | 204 | }; |
198 | 205 | ||
199 | static int init_power_trace(void) | 206 | static int init_power_trace(void) |
diff --git a/kernel/trace/trace_sched_switch.c b/kernel/trace/trace_sched_switch.c index de35f200abd3..9117cea6f1ae 100644 --- a/kernel/trace/trace_sched_switch.c +++ b/kernel/trace/trace_sched_switch.c | |||
@@ -62,6 +62,9 @@ probe_sched_wakeup(struct rq *__rq, struct task_struct *wakee, int success) | |||
62 | pc = preempt_count(); | 62 | pc = preempt_count(); |
63 | tracing_record_cmdline(current); | 63 | tracing_record_cmdline(current); |
64 | 64 | ||
65 | if (sched_stopped) | ||
66 | return; | ||
67 | |||
65 | local_irq_save(flags); | 68 | local_irq_save(flags); |
66 | cpu = raw_smp_processor_id(); | 69 | cpu = raw_smp_processor_id(); |
67 | data = ctx_trace->data[cpu]; | 70 | data = ctx_trace->data[cpu]; |
diff --git a/kernel/trace/trace_sched_wakeup.c b/kernel/trace/trace_sched_wakeup.c index 3c5ad6b2ec84..5bc00e8f153e 100644 --- a/kernel/trace/trace_sched_wakeup.c +++ b/kernel/trace/trace_sched_wakeup.c | |||
@@ -154,7 +154,7 @@ probe_wakeup_sched_switch(struct rq *rq, struct task_struct *prev, | |||
154 | if (unlikely(!tracer_enabled || next != wakeup_task)) | 154 | if (unlikely(!tracer_enabled || next != wakeup_task)) |
155 | goto out_unlock; | 155 | goto out_unlock; |
156 | 156 | ||
157 | trace_function(wakeup_trace, CALLER_ADDR1, CALLER_ADDR2, flags, pc); | 157 | trace_function(wakeup_trace, CALLER_ADDR0, CALLER_ADDR1, flags, pc); |
158 | tracing_sched_switch_trace(wakeup_trace, prev, next, flags, pc); | 158 | tracing_sched_switch_trace(wakeup_trace, prev, next, flags, pc); |
159 | 159 | ||
160 | /* | 160 | /* |
@@ -257,6 +257,12 @@ probe_wakeup(struct rq *rq, struct task_struct *p, int success) | |||
257 | data = wakeup_trace->data[wakeup_cpu]; | 257 | data = wakeup_trace->data[wakeup_cpu]; |
258 | data->preempt_timestamp = ftrace_now(cpu); | 258 | data->preempt_timestamp = ftrace_now(cpu); |
259 | tracing_sched_wakeup_trace(wakeup_trace, p, current, flags, pc); | 259 | tracing_sched_wakeup_trace(wakeup_trace, p, current, flags, pc); |
260 | |||
261 | /* | ||
262 | * We must be careful in using CALLER_ADDR2. But since wake_up | ||
263 | * is not called by an assembly function (where as schedule is) | ||
264 | * it should be safe to use it here. | ||
265 | */ | ||
260 | trace_function(wakeup_trace, CALLER_ADDR1, CALLER_ADDR2, flags, pc); | 266 | trace_function(wakeup_trace, CALLER_ADDR1, CALLER_ADDR2, flags, pc); |
261 | 267 | ||
262 | out_locked: | 268 | out_locked: |
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" |