<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace, branch v2.6.30.1</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel/trace?h=v2.6.30.1</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel/trace?h=v2.6.30.1'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2009-07-02T23:50:22Z</updated>
<entry>
<title>tracing/urgent: fix unbalanced ftrace_start_up</title>
<updated>2009-07-02T23:50:22Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2009-06-20T03:45:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=562021a44981b9ca932e004a503576865d627811'/>
<id>urn:sha1:562021a44981b9ca932e004a503576865d627811</id>
<content type='text'>
commit c85a17e22695969aa24a7ffa40cf26d6e6fcfd50 upstream.

Perfcounter reports the following stats for a wide system
profiling:

 #
 # (2364 samples)
 #
 # Overhead  Symbol
 # ........  ......
 #
    15.40%  [k] mwait_idle_with_hints
     8.29%  [k] read_hpet
     5.75%  [k] ftrace_caller
     3.60%  [k] ftrace_call
     [...]

This snapshot has been taken while neither the function tracer nor
the function graph tracer was running.
With dynamic ftrace, such results show a wrong ftrace behaviour
because all calls to ftrace_caller or ftrace_graph_caller (the patched
calls to mcount) are supposed to be patched into nop if none of those
tracers are running.

The problem occurs after the first run of the function tracer. Once we
launch it a second time, the callsites will never be nopped back,
unless you set custom filters.
For example it happens during the self tests at boot time.
The function tracer selftest runs, and then the dynamic tracing is
tested too. After that, the callsites are left un-nopped.

This is because the reset callback of the function tracer tries to
unregister two ftrace callbacks in once: the common function tracer
and the function tracer with stack backtrace, regardless of which
one is currently in use.
It then creates an unbalance on ftrace_start_up value which is expected
to be zero when the last ftrace callback is unregistered. When it
reaches zero, the FTRACE_DISABLE_CALLS is set on the next ftrace
command, triggering the patching into nop. But since it becomes
unbalanced, ie becomes lower than zero, if the kernel functions
are patched again (as in every further function tracer runs), they
won't ever be nopped back.

Note that ftrace_call and ftrace_graph_call are still patched back
to ftrace_stub in the off case, but not the callers of ftrace_call
and ftrace_graph_caller. It means that the tracing is well deactivated
but we waste a useless call into every kernel function.

This patch just unregisters the right ftrace_ops for the function
tracer on its reset callback and ignores the other one which is
not registered, fixing the unbalance. The problem also happens
is .30

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
<entry>
<title>tracing: Append prompt in /debug/tracing/README file</title>
<updated>2009-05-15T17:43:22Z</updated>
<author>
<name>GeunSik Lim</name>
<email>leemgs1@gmail.com</email>
</author>
<published>2009-05-14T08:23:38Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=88fc86c283d9c3854e67e4155808027bc2519eb6'/>
<id>urn:sha1:88fc86c283d9c3854e67e4155808027bc2519eb6</id>
<content type='text'>
append prompt in /debug/tracing/README file.

This is trivial issue. Fix typo Mini Howto file(README) for ftrace.

[ Impact: cleanup ]

Signed-off-by: GeunSik Lim &lt;geunsik.lim@samsung.com&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: williams &lt;williams@redhat.com&gt;
LKML-Reference: &lt;1242289418.31161.45.camel@centos51&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: fix ref count in splice pages</title>
<updated>2009-04-29T06:02:44Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-04-29T04:16:21Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7267fa6819467669f5cc2ba81a615dcc88158b4b'/>
<id>urn:sha1:7267fa6819467669f5cc2ba81a615dcc88158b4b</id>
<content type='text'>
The pages allocated for the splice binary buffer did not initialize
the ref count correctly. This caused pages not to be freed and causes
a drastic memory leak.

Thanks to logdev I was able to trace the tracer to find where the leak
was.

[ Impact: stop memory leak when using splice ]

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: Fix branch tracer header</title>
<updated>2009-04-14T00:30:36Z</updated>
<author>
<name>Zhaolei</name>
<email>zhaolei@cn.fujitsu.com</email>
</author>
<published>2009-04-13T08:02:34Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=557055bebe9212dfa6b9f5df811dfd0dac77ec55'/>
<id>urn:sha1:557055bebe9212dfa6b9f5df811dfd0dac77ec55</id>
<content type='text'>
Before patch:

  # tracer: branch
  #
  #           TASK-PID    CPU#    TIMESTAMP  FUNCTION
  #              | |       |          |         |
             &lt;...&gt;-2981  [000] 24008.872738: [  ok  ] trace_irq_handler_exit:irq_event_types.h:41
             &lt;...&gt;-2981  [000] 24008.872742: [  ok  ] note_interrupt:spurious.c:229
  ...

After patch:

  # tracer: branch
  #
  #           TASK-PID    CPU#    TIMESTAMP  CORRECT  FUNC:FILE:LINE
  #              | |       |          |         |       |
             &lt;...&gt;-2985  [000] 26329.142970: [  ok  ] slab_free:slub.c:1776
             &lt;...&gt;-2985  [000] 26329.142972: [  ok  ] trace_kmem_cache_free:kmem_event_types.h:191
  ...

Signed-off-by: Zhao Lei &lt;zhaolei@cn.fujitsu.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Tom Zanussi &lt;tzanussi@gmail.com&gt;
LKML-Reference: &lt;49E2F19A.3040006@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: Fix power tracer header</title>
<updated>2009-04-13T21:39:57Z</updated>
<author>
<name>Zhaolei</name>
<email>zhaolei@cn.fujitsu.com</email>
</author>
<published>2009-04-13T07:23:53Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a3d03ecaf9fe722bf96e4ef4a2f5e42ef652ddeb'/>
<id>urn:sha1:a3d03ecaf9fe722bf96e4ef4a2f5e42ef652ddeb</id>
<content type='text'>
Before patch:
  # tracer: power
  #
  #           TASK-PID    CPU#    TIMESTAMP  FUNCTION
  #              | |       |          |         |
  [  676.875865889] CSTATE: Going to C1 on cpu 0 for 0.005911463
  [  676.882938805] CSTATE: Going to C1 on cpu 0 for 0.104796532
  ...

After patch:
  # tracer: power
  #
  #   TIMESTAMP      STATE  EVENT
  #       |            |      |
  [  676.875865889] CSTATE: Going to C1 on cpu 0 for 0.005911463
  [  676.882938805] CSTATE: Going to C1 on cpu 0 for 0.104796532
  ...

v2: Use seq_puts instead of seq_printf

Signed-off-by: Zhao Lei &lt;zhaolei@cn.fujitsu.com&gt;
Cc: Arjan van de Ven &lt;arjan@linux.intel.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Tom Zanussi &lt;tzanussi@gmail.com&gt;
LKML-Reference: &lt;49E2E889.5000903@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/filters: return proper error code when writing filter file</title>
<updated>2009-04-12T09:59:29Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2009-04-11T07:55:28Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=44e9c8b7adc52079f0535f9de0c2c2477831389b'/>
<id>urn:sha1:44e9c8b7adc52079f0535f9de0c2c2477831389b</id>
<content type='text'>
- propagate return value of filter_add_pred() to the user

- return -ENOSPC but not -ENOMEM or -EINVAL when the filter array
  is full

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Acked-by: Tom Zanussi &lt;tzanussi@gmail.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
LKML-Reference: &lt;49E04CF0.3010105@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/filters: allow user input integer to be oct or hex</title>
<updated>2009-04-12T09:59:28Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2009-04-11T07:52:51Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a3e0ab050774117d4a6173087c8bf3888662a83f'/>
<id>urn:sha1:a3e0ab050774117d4a6173087c8bf3888662a83f</id>
<content type='text'>
Before patch:

 # echo 'parent_pid == 0x10' &gt; events/sched/sched_process_fork/filter
 # cat sched/sched_process_fork/filter
 parent_pid == 0

After patch:

 # cat sched/sched_process_fork/filter
 parent_pid == 16

Also check the input more strictly.

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Acked-by: Tom Zanussi &lt;tzanussi@gmail.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
LKML-Reference: &lt;49E04C53.4010600@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/filters: fix NULL pointer dereference</title>
<updated>2009-04-12T09:59:28Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2009-04-11T07:52:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bcabd91c271e50eebc0cb9220ac92700332b452e'/>
<id>urn:sha1:bcabd91c271e50eebc0cb9220ac92700332b452e</id>
<content type='text'>
Try this, and you'll see NULL pointer dereference bug:

  # echo -n 'parent_comm ==' &gt; sched/sched_process_fork/filter

Because we passed NULL ptr to simple_strtoull().

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Acked-by: Tom Zanussi &lt;tzanussi@gmail.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
LKML-Reference: &lt;49E04C43.1050504@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/filters: NIL-terminate user input filter</title>
<updated>2009-04-12T09:59:27Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2009-04-11T07:52:18Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8433a40eb7f2c4883ad57f9900f63e4d59240eb7'/>
<id>urn:sha1:8433a40eb7f2c4883ad57f9900f63e4d59240eb7</id>
<content type='text'>
Make sure messages from user space are NIL-terminated strings,
otherwise we could dump random memory while reading filter file.

Try this:
 # echo 'parent_comm ==' &gt; events/sched/sched_process_fork/filter
 # cat events/sched/sched_process_fork/filter
 parent_comm == �

Signed-off-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Acked-by: Tom Zanussi &lt;tzanussi@gmail.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
LKML-Reference: &lt;49E04C32.6060508@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>ftrace: Output REC-&gt;var instead of __entry-&gt;var for trace format</title>
<updated>2009-04-10T13:48:53Z</updated>
<author>
<name>Zhaolei</name>
<email>zhaolei@cn.fujitsu.com</email>
</author>
<published>2009-04-08T09:00:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0462b5664b2bda5a18fef7efb5bb32ce36590c1a'/>
<id>urn:sha1:0462b5664b2bda5a18fef7efb5bb32ce36590c1a</id>
<content type='text'>
print fmt: "irq=%d return=%s", __entry-&gt;irq, __entry-&gt;ret ? \"handled\" : \"unhandled\"

"__entry" should be convert to "REC" by __stringify() macro.

Signed-off-by: Zhao Lei &lt;zhaolei@cn.fujitsu.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
LKML-Reference: &lt;49DC679D.2090901@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
