<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/kernel/trace/trace_kdb.c, branch linux-3.18.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-3.18.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2019-04-27T07:30:19Z</updated>
<entry>
<title>tracing: kdb: Fix ftdump to not sleep</title>
<updated>2019-04-27T07:30:19Z</updated>
<author>
<name>Douglas Anderson</name>
</author>
<published>2019-03-08T19:32:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=33da87e946befcbd68fb948aa874130f06fdfcd2'/>
<id>urn:sha1:33da87e946befcbd68fb948aa874130f06fdfcd2</id>
<content type='text'>
[ Upstream commit 31b265b3baaf55f209229888b7ffea523ddab366 ]

As reported back in 2016-11 [1], the "ftdump" kdb command triggers a
BUG for "sleeping function called from invalid context".

kdb's "ftdump" command wants to call ring_buffer_read_prepare() in
atomic context.  A very simple solution for this is to add allocation
flags to ring_buffer_read_prepare() so kdb can call it without
triggering the allocation error.  This patch does that.

Note that in the original email thread about this, it was suggested
that perhaps the solution for kdb was to either preallocate the buffer
ahead of time or create our own iterator.  I'm hoping that this
alternative of adding allocation flags to ring_buffer_read_prepare()
can be considered since it means I don't need to duplicate more of the
core trace code into "trace_kdb.c" (for either creating my own
iterator or re-preparing a ring allocator whose memory was already
allocated).

NOTE: another option for kdb is to actually figure out how to make it
reuse the existing ftrace_dump() function and totally eliminate the
duplication.  This sounds very appealing and actually works (the "sr
z" command can be seen to properly dump the ftrace buffer).  The
downside here is that ftrace_dump() fully consumes the trace buffer.
Unless that is changed I'd rather not use it because it means "ftdump
| grep xyz" won't be very useful to search the ftrace buffer since it
will throw away the whole trace on the first grep.  A future patch to
dump only the last few lines of the buffer will also be hard to
implement.

[1] https://lkml.kernel.org/r/20161117191605.GA21459@google.com

Link: http://lkml.kernel.org/r/20190308193205.213659-1-dianders@chromium.org

Reported-by: Brian Norris &lt;briannorris@chromium.org&gt;
Signed-off-by: Douglas Anderson &lt;dianders@chromium.org&gt;
Signed-off-by: Steven Rostedt (VMware) &lt;rostedt@goodmis.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>tracing: Consolidate max_tr into main trace_array structure</title>
<updated>2013-03-15T04:35:40Z</updated>
<author>
<name>Steven Rostedt (Red Hat)</name>
</author>
<published>2013-03-05T14:24:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=12883efb670c28dff57dcd7f4f995a1ffe153b2d'/>
<id>urn:sha1:12883efb670c28dff57dcd7f4f995a1ffe153b2d</id>
<content type='text'>
Currently, the way the latency tracers and snapshot feature works
is to have a separate trace_array called "max_tr" that holds the
snapshot buffer. For latency tracers, this snapshot buffer is used
to swap the running buffer with this buffer to save the current max
latency.

The only items needed for the max_tr is really just a copy of the buffer
itself, the per_cpu data pointers, the time_start timestamp that states
when the max latency was triggered, and the cpu that the max latency
was triggered on. All other fields in trace_array are unused by the
max_tr, making the max_tr mostly bloat.

This change removes the max_tr completely, and adds a new structure
called trace_buffer, that holds the buffer pointer, the per_cpu data
pointers, the time_start timestamp, and the cpu where the latency occurred.

The trace_array, now has two trace_buffers, one for the normal trace and
one for the max trace or snapshot. By doing this, not only do we remove
the bloat from the max_trace but the instances of traces can now use
their own snapshot feature and not have just the top level global_trace have
the snapshot feature and latency tracers for itself.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Replace the static global per_cpu arrays with allocated per_cpu</title>
<updated>2013-03-15T04:34:43Z</updated>
<author>
<name>Steven Rostedt</name>
</author>
<published>2012-08-06T20:24:11Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a7603ff4b5f7e26e67af82a4c3d05eeeb8d7b160'/>
<id>urn:sha1:a7603ff4b5f7e26e67af82a4c3d05eeeb8d7b160</id>
<content type='text'>
The global and max-tr currently use static per_cpu arrays for the CPU data
descriptors. But in order to get new allocated trace_arrays, they need to
be allocated per_cpu arrays. Instead of using the static arrays, switch
the global and max-tr to use allocated data.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Use RING_BUFFER_ALL_CPUS for TRACE_PIPE_ALL_CPU</title>
<updated>2013-03-15T04:34:41Z</updated>
<author>
<name>Steven Rostedt</name>
</author>
<published>2013-01-23T20:22:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ae3b5093ad6004b52e2825f3db1ad8200a2724d8'/>
<id>urn:sha1:ae3b5093ad6004b52e2825f3db1ad8200a2724d8</id>
<content type='text'>
Both RING_BUFFER_ALL_CPUS and TRACE_PIPE_ALL_CPU are defined as
-1 and used to say that all the ring buffers are to be modified
or read (instead of just a single cpu, which would be &gt;= 0).

There's no reason to keep TRACE_PIPE_ALL_CPU as it is also started
to be used for more than what it was created for, and now that
the ring buffer code added a generic RING_BUFFER_ALL_CPUS define,
we can clean up the trace code to use that instead and remove
the TRACE_PIPE_ALL_CPU macro.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>kdb,ftdump: Remove reference to internal kdb include</title>
<updated>2010-10-22T20:34:11Z</updated>
<author>
<name>Jason Wessel</name>
</author>
<published>2010-10-11T15:20:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e3bda3ac33d3bf3e5a4049e2cabe82d3caaffc26'/>
<id>urn:sha1:e3bda3ac33d3bf3e5a4049e2cabe82d3caaffc26</id>
<content type='text'>
Now that include/linux/kdb.h properly exports all the functions
required to dynamically add a kdb shell command, the reference to the
private kdb header can be removed.

Signed-off-by: Jason Wessel &lt;jason.wessel@windriver.com&gt;
</content>
</entry>
<entry>
<title>ftrace,kdb: Allow dumping a specific cpu's buffer with ftdump</title>
<updated>2010-08-05T14:22:23Z</updated>
<author>
<name>Jason Wessel</name>
</author>
<published>2010-08-05T14:22:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=19063c776fe745fab11216422cf56489ee83b452'/>
<id>urn:sha1:19063c776fe745fab11216422cf56489ee83b452</id>
<content type='text'>
In systems with more than one processor it is desirable to look at the
per cpu trace buffers.

Signed-off-by: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
CC: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</content>
</entry>
<entry>
<title>ftrace,kdb: Extend kdb to be able to dump the ftrace buffer</title>
<updated>2010-08-05T14:22:23Z</updated>
<author>
<name>Jason Wessel</name>
</author>
<published>2010-08-05T14:22:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=955b61e597984745fb7d34c75708f6503b6aaeab'/>
<id>urn:sha1:955b61e597984745fb7d34c75708f6503b6aaeab</id>
<content type='text'>
Add in a helper function to allow the kdb shell to dump the ftrace
buffer.

Modify trace.c to expose the capability to iterate over the ftrace
buffer in a read only capacity.

Signed-off-by: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
CC: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</content>
</entry>
</feed>
