Skip to content

Commit 71babb2

Browse files
vnagarnaikrostedt
authored andcommitted
tracing: change CPU ring buffer state from tracing_cpumask
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>
1 parent 0a3d7ce commit 71babb2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

kernel/trace/trace.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2669,10 +2669,12 @@ tracing_cpumask_write(struct file *filp, const char __user *ubuf,
26692669
if (cpumask_test_cpu(cpu, tracing_cpumask) &&
26702670
!cpumask_test_cpu(cpu, tracing_cpumask_new)) {
26712671
atomic_inc(&global_trace.data[cpu]->disabled);
2672+
ring_buffer_record_disable_cpu(global_trace.buffer, cpu);
26722673
}
26732674
if (!cpumask_test_cpu(cpu, tracing_cpumask) &&
26742675
cpumask_test_cpu(cpu, tracing_cpumask_new)) {
26752676
atomic_dec(&global_trace.data[cpu]->disabled);
2677+
ring_buffer_record_enable_cpu(global_trace.buffer, cpu);
26762678
}
26772679
}
26782680
arch_spin_unlock(&ftrace_max_lock);

0 commit comments

Comments
 (0)