All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] trace: change CPU ring buffer state from tracing_cpumask
@ 2011-07-21  1:04 Vaibhav Nagarnaik
  2011-08-31  1:07 ` Vaibhav Nagarnaik
  0 siblings, 1 reply; 3+ messages in thread
From: Vaibhav Nagarnaik @ 2011-07-21  1:04 UTC (permalink / raw)
  To: Steven Rostedt, Frederic Weisbecker, Ingo Molnar
  Cc: Michael Rubin, David Sharp, linux-kernel, Vaibhav Nagarnaik

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.

Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
---
 kernel/trace/trace.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index e8aa324..d8ed798 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -2433,10 +2433,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)) {
 			atomic_inc(&global_trace.data[cpu]->disabled);
+			ring_buffer_record_disable_cpu(global_trace.buffer, cpu);
 		}
 		if (!cpumask_test_cpu(cpu, tracing_cpumask) &&
 				cpumask_test_cpu(cpu, tracing_cpumask_new)) {
 			atomic_dec(&global_trace.data[cpu]->disabled);
+			ring_buffer_record_enable_cpu(global_trace.buffer, cpu);
 		}
 	}
 	arch_spin_unlock(&ftrace_max_lock);
-- 
1.7.3.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] trace: change CPU ring buffer state from tracing_cpumask
  2011-07-21  1:04 [PATCH] trace: change CPU ring buffer state from tracing_cpumask Vaibhav Nagarnaik
@ 2011-08-31  1:07 ` Vaibhav Nagarnaik
  2011-08-31  2:03   ` Steven Rostedt
  0 siblings, 1 reply; 3+ messages in thread
From: Vaibhav Nagarnaik @ 2011-08-31  1:07 UTC (permalink / raw)
  To: Steven Rostedt, Frederic Weisbecker, Ingo Molnar
  Cc: Michael Rubin, David Sharp, linux-kernel, Vaibhav Nagarnaik

On Wed, Jul 20, 2011 at 6:04 PM, Vaibhav Nagarnaik
<vnagarnaik@google.com> wrote:
> 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.
>
> Signed-off-by: Vaibhav Nagarnaik <vnagarnaik@google.com>
> ---
>  kernel/trace/trace.c |    2 ++
>  1 files changed, 2 insertions(+), 0 deletions(-)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index e8aa324..d8ed798 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -2433,10 +2433,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)) {
>                        atomic_inc(&global_trace.data[cpu]->disabled);
> +                       ring_buffer_record_disable_cpu(global_trace.buffer, cpu);
>                }
>                if (!cpumask_test_cpu(cpu, tracing_cpumask) &&
>                                cpumask_test_cpu(cpu, tracing_cpumask_new)) {
>                        atomic_dec(&global_trace.data[cpu]->disabled);
> +                       ring_buffer_record_enable_cpu(global_trace.buffer, cpu);
>                }
>        }
>        arch_spin_unlock(&ftrace_max_lock);

Hi Steve

What do you think about this patch?

Vaibhav Nagarnaik

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] trace: change CPU ring buffer state from tracing_cpumask
  2011-08-31  1:07 ` Vaibhav Nagarnaik
@ 2011-08-31  2:03   ` Steven Rostedt
  0 siblings, 0 replies; 3+ messages in thread
From: Steven Rostedt @ 2011-08-31  2:03 UTC (permalink / raw)
  To: Vaibhav Nagarnaik
  Cc: Frederic Weisbecker, Ingo Molnar, Michael Rubin, David Sharp,
	linux-kernel

On Tue, 2011-08-30 at 18:07 -0700, Vaibhav Nagarnaik wrote:
> >        arch_spin_unlock(&ftrace_max_lock);
> 
> Hi Steve
> 
> What do you think about this patch?

I'm fine with it. I'll see if I can add it to my 3.2 queue. I'm still
looking at some of your other patches you sent.

I'm still in the process of getting back into the swing of things as I
just came back from vacation :)

-- Steve



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-31  2:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-07-21  1:04 [PATCH] trace: change CPU ring buffer state from tracing_cpumask Vaibhav Nagarnaik
2011-08-31  1:07 ` Vaibhav Nagarnaik
2011-08-31  2:03   ` Steven Rostedt

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.