aboutsummaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
authorVaibhav Nagarnaik <vnagarnaik@google.com>2012-05-03 21:59:52 -0400
committerLuis Henriques <luis.henriques@canonical.com>2012-07-23 05:50:27 -0400
commitebec9b35dd4dffbc418416aa2005bb7beffda341 (patch)
treebd7baa5d44845177333a3cd73410762d2bad8416 /kernel
parent418f02c459afdad16e165a486c681590b4a32c82 (diff)
tracing: change CPU ring buffer state from tracing_cpumask
BugLink: http://bugs.launchpad.net/bugs/1025406 commit 71babb2705e2203a64c27ede13ae3508a0d2c16c upstream. According to Documentation/trace/ftrace.txt: tracing_cpumask: This is a mask that lets the user only trace on specified CPUS. The format is a hex string representing the CPUS. The tracing_cpumask currently doesn't affect the tracing state of per-CPU ring buffers. This patch enables/disables CPU recording as its corresponding bit in tracing_cpumask is set/unset. Link: http://lkml.kernel.org/r/1336096792-25373-3-git-send-email-vnagarnaik@google.com Cc: Frederic Weisbecker <fweisbec@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Laurent Chavey <chavey@google.com> Cc: Justin Teravest <teravest@google.com> Cc: David Sharp <dhsharp@google.com> Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Herton Ronaldo Krzesinski <herton.krzesinski@canonical.com>
Diffstat (limited to 'kernel')
-rw-r--r--kernel/trace/trace.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 0731e81a5bb..672a749dbba 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2432,10 +2432,12 @@ tracing_cpumask_write(struct file *filp, const char __user *ubuf,
2432 if (cpumask_test_cpu(cpu, tracing_cpumask) && 2432 if (cpumask_test_cpu(cpu, tracing_cpumask) &&
2433 !cpumask_test_cpu(cpu, tracing_cpumask_new)) { 2433 !cpumask_test_cpu(cpu, tracing_cpumask_new)) {
2434 atomic_inc(&global_trace.data[cpu]->disabled); 2434 atomic_inc(&global_trace.data[cpu]->disabled);
2435 ring_buffer_record_disable_cpu(global_trace.buffer, cpu);
2435 } 2436 }
2436 if (!cpumask_test_cpu(cpu, tracing_cpumask) && 2437 if (!cpumask_test_cpu(cpu, tracing_cpumask) &&
2437 cpumask_test_cpu(cpu, tracing_cpumask_new)) { 2438 cpumask_test_cpu(cpu, tracing_cpumask_new)) {
2438 atomic_dec(&global_trace.data[cpu]->disabled); 2439 atomic_dec(&global_trace.data[cpu]->disabled);
2440 ring_buffer_record_enable_cpu(global_trace.buffer, cpu);
2439 } 2441 }
2440 } 2442 }
2441 arch_spin_unlock(&ftrace_max_lock); 2443 arch_spin_unlock(&ftrace_max_lock);