From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: linux-kernel@vger.kernel.org,
Masami Hiramatsu <mhiramat@kernel.org>,
Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Subject: Re: [PATCH] tracing: remove tracing_is_on export
Date: Thu, 25 Jul 2024 16:41:11 +0200 [thread overview]
Message-ID: <2024072526-manned-ludicrous-1ce2@gregkh> (raw)
In-Reply-To: <20240725095307.3067329f@gandalf.local.home>
On Thu, Jul 25, 2024 at 09:53:07AM -0400, Steven Rostedt wrote:
> On Thu, 25 Jul 2024 15:35:00 +0200
> Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>
> > Generally, we don't allow symbols that are not actually being used in
> > the kernel tree? tracing_is_on() is a "code flow" type of thing, where
> > code can operate differently if it is enabled or not.
> >
> > And I would argue that tracing_on() and tracing_off() should also not be
> > allowed to be in a module, why would you want that? Just enable/disable
> > it from userspace when doing your testing, IF you have permission to do
> > so.
>
> tracing_off() is key to development, and one that I would argue very much
> against removing. The other two are more just for "completeness".
>
> It usually is used by adding a bunch of trace_printk(), and then:
>
> if (condition) {
> trace_printk("Condition hit!\n");
> tracing_off();
> }
>
> And then you run your kernel until you noticed that something weird
> happened. Then look at the trace file, and it will have all the events that
> happened up to the anomaly condition, and you don't have to worry about the
> ring buffer overflowing and losing your data.
>
> This workflow is used by many developers.
Is it documented anywhere? I've never heard of it before, and nothing
really describes this in Documentation/ that I can find.
But as you only want these to be exported to developer kernels, why not
say that and put that behind a debugging Kconfig option or something?
That way "vendor kernels" can properly disable this as they don't want
to give this type of functionality to random 3rd-party kernel modules.
thanks,
greg k-h
next prev parent reply other threads:[~2024-07-25 15:19 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-07-25 9:36 [PATCH] tracing: remove tracing_is_on export Greg Kroah-Hartman
2024-07-25 12:31 ` Steven Rostedt
2024-07-25 12:52 ` Greg Kroah-Hartman
2024-07-25 13:26 ` Steven Rostedt
2024-07-25 13:35 ` Greg Kroah-Hartman
2024-07-25 13:53 ` Steven Rostedt
2024-07-25 14:41 ` Greg Kroah-Hartman [this message]
2024-07-25 16:17 ` Steven Rostedt
2024-07-26 8:15 ` Greg Kroah-Hartman
2024-07-26 14:22 ` Steven Rostedt
2024-07-25 14:35 ` Christoph Hellwig
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=2024072526-manned-ludicrous-1ce2@gregkh \
--to=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mathieu.desnoyers@efficios.com \
--cc=mhiramat@kernel.org \
--cc=rostedt@goodmis.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox