tracing: Warn if a tracepoint is not set via debugfs
authorSteven Rostedt <rostedt@goodmis.org>
Thu, 13 Feb 2014 20:45:07 +0000 (15:45 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Fri, 7 Mar 2014 15:06:07 +0000 (10:06 -0500)
commitb196e2b9e262be01737dc2bbf9e3c7c87340fa4d
tree0916b9230d0ffe669629e1cbc03a458653cb61b1
parent3fd40d1ee6a317523172ab95b6f7ea41ba8fcee3
tracing: Warn if a tracepoint is not set via debugfs

Tracepoints were made to allow enabling a tracepoint in a module before that
module was loaded. When a tracepoint is enabled and it does not exist, the
name is stored and will be enabled when the tracepoint is created.

The problem with this approach is that when a tracepoint is enabled when
it expects to be there, it gives no warning that it does not exist.

To add salt to the wound, if a module is added and sets the FORCED flag, which
can happen if it isn't signed properly, the tracepoint code will not enabled
the tracepoints, but they will be created in the debugfs system! When a user
goes to enable the tracepoint, the tracepoint code will not see it existing
and will think it is to be enabled later AND WILL NOT GIVE A WARNING.

The tracing will look like it succeeded but will actually be doing nothing.
This will cause lots of confusion and headaches for developers trying to
figure out why they are not seeing their tracepoints.

Link: http://lkml.kernel.org/r/20140213154507.4040fb06@gandalf.local.home
Reported-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Reported-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/tracepoint.c