Steven Rostedt (Red Hat)
3dba3f672d
tracing: Fix trace_printk() to print when not using bprintk()
...
commit 3debb0a9dd upstream.
The trace_printk() code will allocate extra buffers if the compile detects
that a trace_printk() is used. To do this, the format of the trace_printk()
is saved to the __trace_printk_fmt section, and if that section is bigger
than zero, the buffers are allocated (along with a message that this has
happened).
If trace_printk() uses a format that is not a constant, and thus something
not guaranteed to be around when the print happens, the compiler optimizes
the fmt out, as it is not used, and the __trace_printk_fmt section is not
filled. This means the kernel will not allocate the special buffers needed
for the trace_printk() and the trace_printk() will not write anything to the
tracing buffer.
Adding a "__used" to the variable in the __trace_printk_fmt section will
keep it around, even though it is set to NULL. This will keep the string
from being printed in the debugfs/tracing/printk_formats section as it is
not needed.
Reported-by: Vlastimil Babka <vbabka@suse.cz >
Fixes: 07d777fe8c "tracing: Add percpu buffers for trace_printk()"
Signed-off-by: Steven Rostedt <rostedt@goodmis.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2016-04-12 09:09:00 -07:00
..
2016-03-03 15:07:26 -08:00
2015-12-10 19:13:26 +01:00
2015-11-13 21:53:18 -08:00
2015-12-08 12:42:44 -05:00
2016-01-31 11:29:01 -08:00
2016-01-05 16:00:03 -08:00
2015-12-10 13:49:24 +01:00
2016-04-12 09:08:32 -07:00
2015-12-07 14:14:03 -05:00
2015-11-10 15:00:03 -08:00
2015-11-10 14:48:36 -08:00
2015-11-11 20:11:28 -08:00
2015-12-23 22:52:08 -05:00
2015-12-04 14:01:17 +01:00
2016-03-09 15:34:52 -08:00
2015-11-03 17:22:17 -08:00
2015-11-04 08:23:51 -05:00
2015-11-05 14:51:32 -08:00
2016-03-16 08:43:01 -07:00
2015-12-09 10:35:16 -08:00
2015-11-11 09:37:34 -07:00
2015-11-07 10:40:47 -07:00
2016-03-09 15:34:56 -08:00
2015-11-25 12:14:09 -05:00
2015-11-11 02:19:33 -05:00
2016-04-12 09:08:54 -07:00
2015-12-03 10:18:21 -05:00
2015-11-05 19:34:48 -08:00
2015-11-06 17:50:42 -08:00
2016-02-25 12:01:16 -08:00
2015-11-20 16:17:32 -08:00
2016-02-17 12:30:57 -08:00
2015-11-10 12:06:23 +01:00
2015-12-02 23:50:33 +01:00
2016-03-03 15:07:28 -08:00
2016-03-09 15:34:49 -08:00
2015-11-02 13:14:44 -08:00
2016-04-12 09:08:39 -07:00
2016-02-25 12:01:14 -08:00
2015-11-06 17:50:42 -08:00
2015-11-18 16:27:46 -05:00
2015-11-04 21:50:37 -08:00
2016-03-03 15:07:09 -08:00
2015-12-11 11:05:57 -08:00
2015-11-10 09:33:06 -08:00
2015-10-31 16:12:10 -07:00
2016-01-06 00:43:52 -05:00
2016-04-12 09:08:58 -07:00
2016-01-07 12:17:39 -05:00
2015-11-04 18:10:13 -08:00
2015-11-20 16:17:32 -08:00
2015-11-05 09:51:50 -08:00
2015-11-09 15:11:24 -08:00
2016-02-17 12:30:57 -08:00
2015-11-06 17:50:42 -08:00
2015-11-05 19:34:48 -08:00
2016-03-03 15:07:16 -08:00
2015-11-05 14:51:32 -08:00
2016-02-25 12:01:22 -08:00
2015-11-04 11:30:57 -08:00
2015-12-02 23:37:16 -05:00
2015-10-30 10:13:26 +01:00
2015-11-23 09:44:58 +01:00
2015-11-09 15:11:24 -08:00
2016-04-12 09:09:00 -07:00
2015-12-12 10:15:34 -08:00
2015-11-28 19:33:29 -08:00
2015-11-19 14:25:32 +01:00
2016-03-09 15:34:52 -08:00
2015-12-07 09:14:19 -07:00
2015-11-23 09:44:58 +01:00
2015-11-17 15:25:43 -05:00
2015-11-10 12:06:16 +01:00
2015-11-05 19:34:48 -08:00
2015-11-05 23:10:54 -08:00
2015-11-06 17:50:42 -08:00
2015-11-06 17:50:42 -08:00
2015-12-18 14:25:40 -08:00
2015-11-06 17:50:42 -08:00
2015-11-06 11:04:07 -08:00
2016-03-09 15:34:56 -08:00
2015-11-06 17:50:42 -08:00
2015-11-06 11:29:53 -08:00
2015-12-01 15:45:05 -05:00
2015-11-03 11:29:57 -05:00
2015-12-06 22:32:32 -05:00
2015-11-06 19:33:12 +01:00
2016-03-03 15:07:28 -08:00
2015-11-23 21:57:44 -05:00
2015-11-05 19:34:48 -08:00
2015-11-10 17:27:12 -06:00
2015-11-16 09:03:21 +05:30
2015-12-09 09:23:28 -06:00
2015-11-12 11:50:33 -08:00
2015-11-10 17:27:12 -06:00
2015-11-05 19:34:48 -08:00
2015-11-06 17:50:42 -08:00
2015-11-06 17:50:42 -08:00
2015-11-06 17:50:42 -08:00
2016-04-12 09:08:37 -07:00
2015-11-23 09:21:03 +01:00
2015-11-07 01:29:22 +01:00
2015-11-23 09:44:58 +01:00
2015-11-03 11:08:22 -05:00
2016-02-25 12:01:16 -08:00
2015-11-10 13:06:16 +01:00
2016-02-25 12:01:23 -08:00
2015-11-06 17:50:42 -08:00
2015-12-04 14:38:26 -05:00
2015-11-02 14:23:38 -05:00
2016-02-25 12:01:21 -08:00
2016-01-31 11:28:59 -08:00
2015-11-19 16:22:43 +01:00
2016-03-03 15:07:23 -08:00
2015-11-20 16:17:32 -08:00
2016-03-03 15:07:05 -08:00
2015-11-22 11:58:44 -08:00
2015-12-12 10:15:34 -08:00
2015-11-25 15:49:13 +00:00
2015-11-13 21:53:18 -08:00
2015-11-05 14:36:09 -05:00
2016-04-12 09:08:35 -07:00
2016-03-09 15:34:52 -08:00
2015-11-05 19:34:48 -08:00
2016-03-16 08:42:58 -07:00
2016-04-12 09:08:49 -07:00
2015-11-25 15:49:13 +00:00
2015-11-05 19:34:48 -08:00
2016-03-03 15:07:08 -08:00
2015-11-23 09:44:58 +01:00
2016-01-31 11:28:58 -08:00
2015-12-04 08:38:42 -07:00
2015-11-05 11:07:36 +10:00
2015-11-05 19:34:48 -08:00
2015-11-01 17:09:15 -08:00
2015-12-29 17:45:49 -08:00
2015-12-13 14:30:59 -08:00
2015-11-03 20:46:26 +01:00
2016-03-09 15:34:52 -08:00
2015-11-13 20:34:33 -05:00
2015-11-06 17:50:42 -08:00
2015-11-06 17:50:42 -08:00
2015-11-06 17:50:42 -08:00