Re: [PATCH 1/2] tracing: Fix cpu buffers unavailable due to 'record_disabled' messed

From: Steven Rostedt
Date: Fri Aug 04 2023 - 12:51:14 EST


On Sat, 5 Aug 2023 00:41:13 +0800
kernel test robot <lkp@xxxxxxxxx> wrote:

> 5276 if (cpumask_test_cpu(cpu, tr->tracing_cpumask) &&
> 5277 !cpumask_test_cpu(cpu, tracing_cpumask_new)) {
> 5278 atomic_inc(&per_cpu_ptr(tr->array_buffer.data, cpu)->disabled);
> 5279 ring_buffer_record_disable_cpu(tr->array_buffer.buffer, cpu);
> > 5280 ring_buffer_record_disable_cpu(tr->max_buffer.buffer, cpu);

The access to max_buffer requires a:

#ifdef CONFIG_TRACER_MAX_TRACE

Around them.

-- Steve

> 5281 }
> 5282 if (!cpumask_test_cpu(cpu, tr->tracing_cpumask) &&
> 5283 cpumask_test_cpu(cpu, tracing_cpumask_new)) {
> 5284 atomic_dec(&per_cpu_ptr(tr->array_buffer.data, cpu)->disabled);
> 5285 ring_buffer_record_enable_cpu(tr->array_buffer.buffer, cpu);
> 5286 ring_buffer_record_enable_cpu(tr->max_buffer.buffer, cpu);
> 5287 }
> 5288 }
> 5289 arch_spin_unlock(&tr->max_lock);