diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-04-13 18:02:16 -0400 |
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-04-13 18:02:22 -0400 |
| commit | b5c851a88a369854c04e511cefb84ea2d0cfa209 (patch) | |
| tree | 55084d3d51708f90f27d0a70db5ab63916942f14 /kernel/trace | |
| parent | eb02ce017dd83985041a7e54c6449f92d53b026f (diff) | |
| parent | 80a04d3f2f94fb68b5df05e3ac6697130bc3467a (diff) | |
Merge branch 'linus' into tracing/core
Merge reason: merge latest tracing fixes to avoid conflicts in
kernel/trace/trace_events_filter.c with upcoming change
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/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 |
4 files changed, 22 insertions, 12 deletions
diff --git a/kernel/trace/Kconfig b/kernel/trace/Kconfig index 644606e899fa..57981d338d1f 100644 --- a/kernel/trace/Kconfig +++ b/kernel/trace/Kconfig | |||
| @@ -317,7 +317,7 @@ config KMEMTRACE | |||
| 317 | and profile kernel code. | 317 | and profile kernel code. |
| 318 | 318 | ||
| 319 | This requires an userspace application to use. See | 319 | This requires an userspace application to use. See |
| 320 | Documentation/vm/kmemtrace.txt for more information. | 320 | Documentation/trace/kmemtrace.txt for more information. |
| 321 | 321 | ||
| 322 | Saying Y will make the kernel somewhat larger and slower. However, | 322 | Saying Y will make the kernel somewhat larger and slower. However, |
| 323 | if you disable kmemtrace at run-time or boot-time, the performance | 323 | if you disable kmemtrace at run-time or boot-time, the performance |
| @@ -422,7 +422,7 @@ config MMIOTRACE | |||
| 422 | implementation and works via page faults. Tracing is disabled by | 422 | implementation and works via page faults. Tracing is disabled by |
| 423 | default and can be enabled at run-time. | 423 | default and can be enabled at run-time. |
| 424 | 424 | ||
| 425 | See Documentation/tracers/mmiotrace.txt. | 425 | See Documentation/trace/mmiotrace.txt. |
| 426 | If you are not helping to develop drivers, say N. | 426 | If you are not helping to develop drivers, say N. |
| 427 | 427 | ||
| 428 | config MMIOTRACE_TEST | 428 | config MMIOTRACE_TEST |
diff --git a/kernel/trace/trace_events.c b/kernel/trace/trace_events.c index be9299a53e2a..789e14eb09a5 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 470ad9487ecc..9f8ecca34a59 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 1c94b87c7180..02fb710193ed 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 |
