Skip to content
Browse files

tracing: change CPU ring buffer state from tracing_cpumask

commit 71babb2 upstream.

According to Documentation/trace/ftrace.txt:


        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.


Cc: Frederic Weisbecker <>
Cc: Ingo Molnar <>
Cc: Laurent Chavey <>
Cc: Justin Teravest <>
Cc: David Sharp <>
Signed-off-by: Vaibhav Nagarnaik <>
Signed-off-by: Steven Rostedt <>
Signed-off-by: Ben Hutchings <>
  • Loading branch information...
1 parent 7d124dd commit 907e461a4f50ca31c36575b03c14d2c07ba20df0 @vnagarnaik vnagarnaik committed with bwhacks May 3, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 kernel/trace/trace.c
2 kernel/trace/trace.c
@@ -2541,10 +2541,12 @@ tracing_cpumask_write(struct file *filp, const char __user *ubuf,
if (cpumask_test_cpu(cpu, tracing_cpumask) &&
!cpumask_test_cpu(cpu, tracing_cpumask_new)) {
+ ring_buffer_record_disable_cpu(global_trace.buffer, cpu);
if (!cpumask_test_cpu(cpu, tracing_cpumask) &&
cpumask_test_cpu(cpu, tracing_cpumask_new)) {
+ ring_buffer_record_enable_cpu(global_trace.buffer, cpu);

0 comments on commit 907e461

Please sign in to comment.
Something went wrong with that request. Please try again.