From: Steven Rostedt <rostedt@goodmis.org>
To: Ingo Molnar <mingo@elte.hu>
Cc: "Pekka Paalanen" <pq@iki.fi>,
"Frédéric Weisbecker" <fweisbec@gmail.com>,
"Pekka J Enberg" <penberg@cs.helsinki.fi>,
linux-kernel@vger.kernel.org,
"Markus Metzger" <markus.t.metzger@gmail.com>
Subject: Re: ftrace behaviour (was: [PATCH] ftrace: introduce tracing_reset_online_cpus() helper)
Date: Fri, 19 Dec 2008 18:27:23 -0500 (EST) [thread overview]
Message-ID: <alpine.DEB.1.10.0812191810110.26234@gandalf.stny.rr.com> (raw)
In-Reply-To: <20081219225717.GK13409@elte.hu>
On Fri, 19 Dec 2008, Ingo Molnar wrote:
>
> * Pekka Paalanen <pq@iki.fi> wrote:
>
> > > I'm actually against the idea of reseting a trace everytime we enable it.
> > > That is:
> > >
> > > echo 1 > /debug/tracing/tracing_enabled
> > >
> > > This should not reset the tracer. I actually do tracing where I disable
> > > and enable it around areas I am interested in. I want all tracing, not
> > > just the last one.
> >
> > But doesn't this go against the fact, that you need to write 0 there to
> > be able to change the ring buffer size?
>
> hm, that ftrace behavior is silly. Steve, i think i mentioned this a long
> time ago and i thought it got fixed? Changing the ring buffer size is a
> slow op, it should include an implicit reset and should be plug-and-play
> with no dependencies of having to stop the trace or something.
I think you are referencing a different issue, where we passed in a NULL
buffer pointer and expected it to be resized. I still think that should
not return a success, but that's a different issue altogether.
Before the ring buffer, the only safe way to resize the buffer was to
switch the tracer to none (aka nop). Now, the only thing you need to do
is disable tracing. This is probably a good thing since it forces the user
to stop tracing, otherwise the tracing will stop during the resize anyway,
and the user will wonder why they lost data.
Resizing is a dangerous operation to do while tracing. Right now ftrace
enforces the the protection of writes to the ring buffer during resize
(the ftrace infrastructure does, the plugins do not need to worry about
it).
Now that we have other ways to disable writing to the ring buffer, we can
move that down to the ring buffer layer. When the ring buffer was
originaly written, there was no such method to stop writing. What would
need to be done now, is the ring buffers would disable writing to all CPU
buffers, do a synchronize sched, since writing requires preemption
disabled. Then we would need to grab all the reader spin locks for each
cpu buffer (that will be ugly :-( ), and then we could safely change the
size of the buffers.
I could easily write this up. I'll see if I can get to it after I release
the -rt trees. But like I said, there will be time when tracing will be
stopped, and it would be a good idea to make the user stop it so they do
not get confused about why they are missing trace output after they did a
resize.
-- Steve
next prev parent reply other threads:[~2008-12-19 23:27 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-19 10:08 [PATCH] ftrace: introduce tracing_reset_online_cpus() helper Pekka J Enberg
2008-12-19 10:47 ` Frédéric Weisbecker
2008-12-19 17:20 ` Steven Rostedt
2008-12-19 22:05 ` Ingo Molnar
2008-12-19 22:44 ` ftrace behaviour (was: [PATCH] ftrace: introduce tracing_reset_online_cpus() helper) Pekka Paalanen
2008-12-19 22:57 ` Ingo Molnar
2008-12-19 23:27 ` Steven Rostedt [this message]
2008-12-19 23:34 ` Ingo Molnar
2008-12-20 0:29 ` Steven Rostedt
2008-12-20 1:38 ` Pekka Paalanen
2008-12-20 1:46 ` Steven Rostedt
2008-12-20 2:32 ` Pekka Paalanen
2008-12-20 2:56 ` Steven Rostedt
2008-12-23 17:29 ` Steven Rostedt
2008-12-20 0:03 ` Steven Rostedt
2008-12-20 2:17 ` Pekka Paalanen
2008-12-20 2:47 ` Steven Rostedt
2008-12-31 13:53 ` Pekka Paalanen
2008-12-31 18:33 ` Steven Rostedt
2008-12-31 18:57 ` Pekka Paalanen
2008-12-31 19:06 ` Steven Rostedt
2008-12-31 22:08 ` Pekka Paalanen
2008-12-20 14:15 ` Frédéric Weisbecker
2008-12-20 13:15 ` [PATCH] ftrace: introduce tracing_reset_online_cpus() helper Frédéric Weisbecker
2008-12-19 15:30 ` Ingo Molnar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=alpine.DEB.1.10.0812191810110.26234@gandalf.stny.rr.com \
--to=rostedt@goodmis.org \
--cc=fweisbec@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markus.t.metzger@gmail.com \
--cc=mingo@elte.hu \
--cc=penberg@cs.helsinki.fi \
--cc=pq@iki.fi \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.