<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace/trace_stat.c, branch v2.6.30</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v2.6.30</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v2.6.30'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2009-03-25T17:32:34Z</updated>
<entry>
<title>trace_stat: keep original order</title>
<updated>2009-03-25T17:32:34Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2009-03-25T08:58:39Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=220ba351dfa57eca4bec5ce0098a276446a47958'/>
<id>urn:sha1:220ba351dfa57eca4bec5ce0098a276446a47958</id>
<content type='text'>
Impact: make trace_stat files show items with the original order

trace_stat tracer reverse the items, it makes the output
looks a little ugly.

Example, when we read trace_stat/workqueues, we get cpu#7's stat.
at first, and then cpu#6... cpu#0.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Acked-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;49C9F23F.5040307@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>trace_stat: don't call seq_printf() in seq_operation-&gt;start()</title>
<updated>2009-03-25T17:32:34Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2009-03-25T08:27:17Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e6f489013b985b58d096a3091ece0ed579367232'/>
<id>urn:sha1:e6f489013b985b58d096a3091ece0ed579367232</id>
<content type='text'>
Impact: Fix incorrect way using seq_file's API

Use SEQ_START_TOKEN instead of calling -&gt;stat_headers()
int seq_operation-&gt;start().

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Acked-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
LKML-Reference: &lt;49C9EAE5.5070202@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: fix memory leak in trace_stat</title>
<updated>2009-03-24T13:07:35Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-03-21T06:44:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=098335215a4921a8a54193829eaed602dca24df5'/>
<id>urn:sha1:098335215a4921a8a54193829eaed602dca24df5</id>
<content type='text'>
If the function profiler does not have any items recorded and one were
to cat the function stat file, the kernel would take a BUG with a NULL
pointer dereference.

Looking further into this, I found that returning NULL from stat_start
did not stop the stat logic, and would later call stat_next. This breaks
from the way seq_file works, so I looked into fixing the stat code.

This is where I noticed that the last next_entry is never freed.
It is allocated, and if the stat_next returns NULL, the code breaks out
of the loop, unlocks the mutex and exits. We never link the next_entry
nor do we free it. Thus it is a real memory leak.

This patch rearranges the code a bit to not only fix the memory leak,
but also to act more like seq_file where nothing is printed if there
is nothing to print. That is, stat_start returns NULL.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
</entry>
<entry>
<title>tracing: fix typing mistake in hint message and comments</title>
<updated>2009-02-17T17:38:24Z</updated>
<author>
<name>Wenji Huang</name>
<email>wenji.huang@oracle.com</email>
</author>
<published>2009-02-17T06:10:02Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=73d8b8bc4f24a97a406d09c8268ac019f4ac661e'/>
<id>urn:sha1:73d8b8bc4f24a97a406d09c8268ac019f4ac661e</id>
<content type='text'>
Impact: cleanup

Fix incorrect hint message in code and typos in comments.

Signed-off-by: Wenji Huang &lt;wenji.huang@oracle.com&gt;
Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
</content>
</entry>
<entry>
<title>tracing: trace_stat.c cleanup</title>
<updated>2009-01-15T10:31:21Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2009-01-15T10:31:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=55922173f1f63903b6de03711ab8ff980cbe58d2'/>
<id>urn:sha1:55922173f1f63903b6de03711ab8ff980cbe58d2</id>
<content type='text'>
Impact: cleanup

- whitespace / code alignment cleanups
- avoid unnecessary forward prototype by reordering functions

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/ftrace: add missing unlock in register_stat_tracer()</title>
<updated>2009-01-15T10:28:32Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2009-01-15T01:30:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=42fab4b2cdc02cf28e2474ccfd75bc9225076590'/>
<id>urn:sha1:42fab4b2cdc02cf28e2474ccfd75bc9225076590</id>
<content type='text'>
We should unlock all_stat_sessions_mutex before returning failure.

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/ftrace: separate events tracing and stats tracing engine</title>
<updated>2009-01-14T11:11:37Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2009-01-10T19:34:13Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=002bb86d8d42f18937aef396c3ecd65c7e02e21a'/>
<id>urn:sha1:002bb86d8d42f18937aef396c3ecd65c7e02e21a</id>
<content type='text'>
Impact: tracing's Api change

Currently, the stat tracing depends on the events tracing.
When you switch to a new tracer, the stats files of the previous tracer
will disappear. But it's more scalable to separate those two engines.
This way, we can keep the stat files of one or several tracers when we
want, without bothering of multiple tracer stat files or tracer switching.

To build/destroys its stats files, a tracer just have to call
register_stat_tracer/unregister_stat_tracer everytimes it wants to.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/ftrace: handle more than one stat file per tracer</title>
<updated>2009-01-11T03:00:44Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2009-01-08T18:03:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=034939b65ad5ff64b9709210b3469a95153c51a3'/>
<id>urn:sha1:034939b65ad5ff64b9709210b3469a95153c51a3</id>
<content type='text'>
Impact: new API for tracers

Make the stat tracing API reentrant. And also provide the new directory
/debugfs/tracing/trace_stat which will contain all the stat files for the
current active tracer.

Now a tracer will, if desired, want to provide a zero terminated array of
tracer_stat structures.
Each one contains the callbacks necessary for one stat file.
It have to provide at least a name for its stat file, an iterator with
stat_start/start_next callback and an output callback for one stat entry.

Also adapt the branch tracer to this new API.
We create two files "all" and "annotated" inside the /debugfs/tracing/trace_stat
directory, making the both stats simultaneously available instead of needing
to change an option to switch from one stat file to another.

The output of these stats haven't changed.

Changes in v2:

_ Apply the previous memory leak fix (rebase against tip/master)

Changes in v3:

_ Merge the patch that adapted the branch tracer to this Api in this patch to
  not break the kernel build.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>trace: clean up funny line breaks in stat_seq_show</title>
<updated>2009-01-07T09:45:39Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-01-07T03:02:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=e8a9cbf6ae620d9e5ba9cb42001c033287a284a3'/>
<id>urn:sha1:e8a9cbf6ae620d9e5ba9cb42001c033287a284a3</id>
<content type='text'>
Impact: clean up

Andrew Morton pointed out that the entry assignment in stat_seq_show
did not need to be done in the declaration, causing funny line breaks.

This patch makes it a bit more pleasing on the eyes.

Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/ftrace: fix a memory leak in stat tracing</title>
<updated>2009-01-07T09:45:14Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2009-01-06T20:33:30Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ff288b274a9b383046fdbda4be3067daba4d5fe8'/>
<id>urn:sha1:ff288b274a9b383046fdbda4be3067daba4d5fe8</id>
<content type='text'>
Impact: fix memory leak

This patch fixes a memory leak inside reset_stat_list(). The freeing
loop iterated only once.

Also turn the stat_list into a simple struct list_head, which
simplify the code and avoid an unused static pointer.

Reported-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;srostedt@redhat.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
