diff options
author | Ingo Molnar <mingo@elte.hu> | 2010-03-11 07:39:33 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2010-03-11 07:39:33 -0500 |
commit | 915a0b575fdb2376135ed9334b3ccb1eb51db622 (patch) | |
tree | 12070fc07897e0cd9170aeb351a96923d44d7813 /kernel/trace/trace.c | |
parent | e02c4fd3142dfb9412531bbfabd510a2a7c6ea46 (diff) | |
parent | 0e95017355dcf43031da6d0e360a748717e56df1 (diff) |
Merge branch 'tip/tracing/core' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-2.6-trace into tracing/urgent
Diffstat (limited to 'kernel/trace/trace.c')
-rw-r--r-- | kernel/trace/trace.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 5edf410bc540..6af8d7bc953b 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -374,6 +374,21 @@ static int __init set_buf_size(char *str) | |||
374 | } | 374 | } |
375 | __setup("trace_buf_size=", set_buf_size); | 375 | __setup("trace_buf_size=", set_buf_size); |
376 | 376 | ||
377 | static int __init set_tracing_thresh(char *str) | ||
378 | { | ||
379 | unsigned long threshhold; | ||
380 | int ret; | ||
381 | |||
382 | if (!str) | ||
383 | return 0; | ||
384 | ret = strict_strtoul(str, 0, &threshhold); | ||
385 | if (ret < 0) | ||
386 | return 0; | ||
387 | tracing_thresh = threshhold * 1000; | ||
388 | return 1; | ||
389 | } | ||
390 | __setup("tracing_thresh=", set_tracing_thresh); | ||
391 | |||
377 | unsigned long nsecs_to_usecs(unsigned long nsecs) | 392 | unsigned long nsecs_to_usecs(unsigned long nsecs) |
378 | { | 393 | { |
379 | return nsecs / 1000; | 394 | return nsecs / 1000; |
@@ -579,9 +594,10 @@ static ssize_t trace_seq_to_buffer(struct trace_seq *s, void *buf, size_t cnt) | |||
579 | static arch_spinlock_t ftrace_max_lock = | 594 | static arch_spinlock_t ftrace_max_lock = |
580 | (arch_spinlock_t)__ARCH_SPIN_LOCK_UNLOCKED; | 595 | (arch_spinlock_t)__ARCH_SPIN_LOCK_UNLOCKED; |
581 | 596 | ||
597 | unsigned long __read_mostly tracing_thresh; | ||
598 | |||
582 | #ifdef CONFIG_TRACER_MAX_TRACE | 599 | #ifdef CONFIG_TRACER_MAX_TRACE |
583 | unsigned long __read_mostly tracing_max_latency; | 600 | unsigned long __read_mostly tracing_max_latency; |
584 | unsigned long __read_mostly tracing_thresh; | ||
585 | 601 | ||
586 | /* | 602 | /* |
587 | * Copy the new maximum trace into the separate maximum-trace | 603 | * Copy the new maximum trace into the separate maximum-trace |
@@ -592,7 +608,7 @@ static void | |||
592 | __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu) | 608 | __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu) |
593 | { | 609 | { |
594 | struct trace_array_cpu *data = tr->data[cpu]; | 610 | struct trace_array_cpu *data = tr->data[cpu]; |
595 | struct trace_array_cpu *max_data = tr->data[cpu]; | 611 | struct trace_array_cpu *max_data; |
596 | 612 | ||
597 | max_tr.cpu = cpu; | 613 | max_tr.cpu = cpu; |
598 | max_tr.time_start = data->preempt_timestamp; | 614 | max_tr.time_start = data->preempt_timestamp; |
@@ -602,7 +618,7 @@ __update_max_tr(struct trace_array *tr, struct task_struct *tsk, int cpu) | |||
602 | max_data->critical_start = data->critical_start; | 618 | max_data->critical_start = data->critical_start; |
603 | max_data->critical_end = data->critical_end; | 619 | max_data->critical_end = data->critical_end; |
604 | 620 | ||
605 | memcpy(data->comm, tsk->comm, TASK_COMM_LEN); | 621 | memcpy(max_data->comm, tsk->comm, TASK_COMM_LEN); |
606 | max_data->pid = tsk->pid; | 622 | max_data->pid = tsk->pid; |
607 | max_data->uid = task_uid(tsk); | 623 | max_data->uid = task_uid(tsk); |
608 | max_data->nice = tsk->static_prio - 20 - MAX_RT_PRIO; | 624 | max_data->nice = tsk->static_prio - 20 - MAX_RT_PRIO; |
@@ -4249,10 +4265,10 @@ static __init int tracer_init_debugfs(void) | |||
4249 | #ifdef CONFIG_TRACER_MAX_TRACE | 4265 | #ifdef CONFIG_TRACER_MAX_TRACE |
4250 | trace_create_file("tracing_max_latency", 0644, d_tracer, | 4266 | trace_create_file("tracing_max_latency", 0644, d_tracer, |
4251 | &tracing_max_latency, &tracing_max_lat_fops); | 4267 | &tracing_max_latency, &tracing_max_lat_fops); |
4268 | #endif | ||
4252 | 4269 | ||
4253 | trace_create_file("tracing_thresh", 0644, d_tracer, | 4270 | trace_create_file("tracing_thresh", 0644, d_tracer, |
4254 | &tracing_thresh, &tracing_max_lat_fops); | 4271 | &tracing_thresh, &tracing_max_lat_fops); |
4255 | #endif | ||
4256 | 4272 | ||
4257 | trace_create_file("README", 0444, d_tracer, | 4273 | trace_create_file("README", 0444, d_tracer, |
4258 | NULL, &tracing_readme_fops); | 4274 | NULL, &tracing_readme_fops); |