<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace/trace_printk.c, branch v3.7-rc7</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/trace/trace_printk.c?h=v3.7-rc7</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/trace/trace_printk.c?h=v3.7-rc7'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-04-24T01:15:55Z</updated>
<entry>
<title>tracing: Add percpu buffers for trace_printk()</title>
<updated>2012-04-24T01:15:55Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-09-22T18:01:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=07d777fe8c3985bc83428c2866713c2d1b3d4129'/>
<id>urn:sha1:07d777fe8c3985bc83428c2866713c2d1b3d4129</id>
<content type='text'>
Currently, trace_printk() uses a single buffer to write into
to calculate the size and format needed to save the trace. To
do this safely in an SMP environment, a spin_lock() is taken
to only allow one writer at a time to the buffer. But this could
also affect what is being traced, and add synchronization that
would not be there otherwise.

Ideally, using percpu buffers would be useful, but since trace_printk()
is only used in development, having per cpu buffers for something
never used is a waste of space. Thus, the use of the trace_bprintk()
format section is changed to be used for static fmts as well as dynamic ones.
Then at boot up, we can check if the section that holds the trace_printk
formats is non-empty, and if it does contain something, then we
know a trace_printk() has been added to the kernel. At this time
the trace_printk per cpu buffers are allocated. A check is also
done at module load time in case a module is added that contains a
trace_printk().

Once the buffers are allocated, they are never freed. If you use
a trace_printk() then you should know what you are doing.

A buffer is made for each type of context:

  normal
  softirq
  irq
  nmi

The context is checked and the appropriate buffer is used.
This allows for totally lockless usage of trace_printk(),
and they no longer even disable interrupts.

Requested-by: Peter Zijlstra &lt;a.p.zijlstra@chello.nl&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Clean up tb_fmt to not give faulty compile warning</title>
<updated>2011-08-11T00:36:32Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-08-09T01:39:39Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=3a301d7c1c68fd96bbcf82db82d9508918e0dc22'/>
<id>urn:sha1:3a301d7c1c68fd96bbcf82db82d9508918e0dc22</id>
<content type='text'>
gcc incorrectly states that the variable "fmt" is uninitialized when
CC_OPITMIZE_FOR_SIZE is set.

Instead of just blindly setting fmt to NULL, the code is cleaned up
a little to be a bit easier for humans to follow, as well as gcc
to know the variables are initialized.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Fix regression in printk_formats file</title>
<updated>2011-06-09T12:42:15Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-06-09T12:40:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=db5e7ecc4abc91b9f26f0c0d79ef88a51e987d90'/>
<id>urn:sha1:db5e7ecc4abc91b9f26f0c0d79ef88a51e987d90</id>
<content type='text'>
The fix to fix the printk_formats of modules broke the
printk_formats of trace_printks in the kernel.

The update of what to show via the seq_file was only updated
if the passed in fmt was NULL, which happens only on the first
iteration. The result was showing the first format every time
instead of iterating through the available formats.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Print trace_bprintk() formats for modules too</title>
<updated>2011-04-04T16:18:24Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-03-22T03:36:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1813dc3776c22ad4b0294a6df8434b9a02c98109'/>
<id>urn:sha1:1813dc3776c22ad4b0294a6df8434b9a02c98109</id>
<content type='text'>
The file debugfs/tracing/printk_formats maps the addresses
to the formats that are used by trace_bprintk() so that userspace
tools can read the buffer and be able to decode trace_bprintk events
to get the format saved when reading the ring buffer directly.

This is because trace_bprintk() does not store the format into the
buffer, but just the address of the format, which is hidden in
the kernel memory.

But currently it only exports trace_bprintk()s from the kernel core
and not for modules. The modules need their formats exported
as well.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Convert trace_printk() formats for module to const char *</title>
<updated>2011-04-04T16:18:24Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-03-22T02:59:21Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0588fa30db44fd2d4032b36a061c87478a43fbee'/>
<id>urn:sha1:0588fa30db44fd2d4032b36a061c87478a43fbee</id>
<content type='text'>
The trace_printk() formats for modules do not show up in the
debugfs/tracing/printk_formats file. Only the formats that are
for trace_printk()s that are in the kernel core.

To facilitate the change to add trace_printk() formats from modules
into that file as well, we need to convert the structure that
holds the formats from char fmt[], into const char *fmt,
and allocate them separately.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Remove markers</title>
<updated>2009-09-18T19:22:08Z</updated>
<author>
<name>Christoph Hellwig</name>
<email>hch@lst.de</email>
</author>
<published>2009-09-17T17:35:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fc5377668c3d808e1d53c4aee152c836f55c3490'/>
<id>urn:sha1:fc5377668c3d808e1d53c4aee152c836f55c3490</id>
<content type='text'>
Now that the last users of markers have migrated to the event
tracer we can kill off the (now orphan) support code.

Signed-off-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Mathieu Desnoyers &lt;mathieu.desnoyers@polymtl.ca&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;20090917173527.GA1699@lst.de&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: show proper address for trace-printk format</title>
<updated>2009-07-23T14:07:17Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-07-23T03:11:03Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4c739ff043e5787d97c9691d62cabf7a29e75a9d'/>
<id>urn:sha1:4c739ff043e5787d97c9691d62cabf7a29e75a9d</id>
<content type='text'>
Since the trace_printk may use pointers to the format fields
in the buffer, they are exported via debugfs/tracing/printk_formats.
This is used by utilities that read the ring buffer in binary format.
It helps the utilities map the address of the format in the binary
buffer to what the printf format looks like.

Unfortunately, the way the output code works, it exports the address
of the pointer to the format address, and not the format address
itself. This makes the file totally useless in trying to figure
out what format string a binary address belongs to.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing_bprintk: Don't increment @pos in t_start()</title>
<updated>2009-06-24T09:02:50Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2009-06-24T01:52:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=c8961ec6da22ea010bf4470a8e0fb3fdad0f11c4'/>
<id>urn:sha1:c8961ec6da22ea010bf4470a8e0fb3fdad0f11c4</id>
<content type='text'>
It's wrong to increment @pos in t_start(), otherwise we'll lose
some entries when reading printk_formats, if the output is larger
than PAGE_SIZE.

Reported-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Reviewed-by: Liming Wang &lt;liming.wang@windriver.com&gt;
Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;4A4186FA.1020106@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/ftrace: factorize the tracing files creation</title>
<updated>2009-04-07T12:43:07Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2009-03-26T23:25:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5452af664f6fba26b80eb2c8c4ceae2999d5cf56'/>
<id>urn:sha1:5452af664f6fba26b80eb2c8c4ceae2999d5cf56</id>
<content type='text'>
Impact: cleanup

Most of the tracing files creation follow the same pattern:

ret = debugfs_create_file(...)
if (!ret)
	pr_warning("Couldn't create ... entry\n")

Unify it!

Reported-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;1238109938-11840-1-git-send-email-fweisbec@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: remove recording function depth from trace_printk</title>
<updated>2009-03-19T19:58:47Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-03-19T18:03:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=40ce74f19c28077550646c76d96a075bf312e461'/>
<id>urn:sha1:40ce74f19c28077550646c76d96a075bf312e461</id>
<content type='text'>
The function depth in trace_printk was to facilitate the function
graph output. Now that the function graph calculates the depth within
the trace output, we no longer need to record the depth when the
trace_printk is called.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
</entry>
</feed>
