<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace/trace.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-05-15T17:43:22Z</updated>
<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.shady.money/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.shady.money/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 splice return too large</title>
<updated>2009-04-10T10:44:46Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2009-04-02T07:17:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=93cfb3c9fd83d877a8f1ffad9ff862b617b32828'/>
<id>urn:sha1:93cfb3c9fd83d877a8f1ffad9ff862b617b32828</id>
<content type='text'>
I got these from strace:

 splice(0x3, 0, 0x5, 0, 0x1000, 0x1) = 12288
 splice(0x3, 0, 0x5, 0, 0x1000, 0x1) = 12288
 splice(0x3, 0, 0x5, 0, 0x1000, 0x1) = 12288
 splice(0x3, 0, 0x5, 0, 0x1000, 0x1) = 16384
 splice(0x3, 0, 0x5, 0, 0x1000, 0x1) = 8192
 splice(0x3, 0, 0x5, 0, 0x1000, 0x1) = 8192
 splice(0x3, 0, 0x5, 0, 0x1000, 0x1) = 8192

I wanted to splice_read 4096 bytes, but it returns 8192 or larger.

It is because the return value of tracing_buffers_splice_read()
does not include "zero out any left over data" bytes.

But tracing_buffers_read() includes these bytes, we make them
consistent.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
LKML-Reference: &lt;49D46674.9030804@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: update file-&gt;f_pos when splice(2) it</title>
<updated>2009-04-10T10:44:44Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2009-04-02T07:17:04Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=c7625a555f55d7ae49236cde551786c88f5a5ce1'/>
<id>urn:sha1:c7625a555f55d7ae49236cde551786c88f5a5ce1</id>
<content type='text'>
Impact: Cleanup

These two lines:

	if (unlikely(*ppos))
		return -ESPIPE;

in tracing_buffers_splice_read() are not needed, VFS layer
has disabled seek(2).

We remove these two lines, and then we can update file-&gt;f_pos.

And tracing_buffers_read() updates file-&gt;f_pos, this fix
make tracing_buffers_splice_read() updates file-&gt;f_pos too.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
LKML-Reference: &lt;49D46670.4010503@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: allocate page when needed</title>
<updated>2009-04-10T10:44:43Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2009-04-02T07:16:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=ddd538f3e6a1a4bec2f6942f83a753263e6577b4'/>
<id>urn:sha1:ddd538f3e6a1a4bec2f6942f83a753263e6577b4</id>
<content type='text'>
Impact: Cleanup

Sometimes, we open trace_pipe_raw, but we don't read(2) it,
we just splice(2) it, thus, the page is not used.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
LKML-Reference: &lt;49D4666B.4010608@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing: disable seeking for trace_pipe_raw</title>
<updated>2009-04-10T10:44:42Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2009-04-02T07:16:56Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=d1e7e02f30be672c6f6ee40908be83877a0d49d1'/>
<id>urn:sha1:d1e7e02f30be672c6f6ee40908be83877a0d49d1</id>
<content type='text'>
Impact: disable pread()

We set tracing_buffers_fops.llseek to no_llseek,
but we can still perform pread() to read this file.

That is not expected.

This fix uses nonseekable_open() to disable it.

tracing_buffers_fops.llseek is still set to no_llseek,
it mark this file is a "non-seekable device" and is used by
sys_splice(). See also do_splice() or manual of splice(2):

ERRORS
       EINVAL Target file system doesn't support  splicing;
              neither  of the descriptors refers to a pipe;
              or offset given for non-seekable device.

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
Cc: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
LKML-Reference: &lt;49D46668.8030806@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>Update /debug/tracing/README</title>
<updated>2009-04-07T12:02:36Z</updated>
<author>
<name>Nikanth Karthikesan</name>
<email>knikanth@suse.de</email>
</author>
<published>2009-03-23T06:28:31Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=bc2b6871c17b3aff79fb14e1a1c06c5f5a187f76'/>
<id>urn:sha1:bc2b6871c17b3aff79fb14e1a1c06c5f5a187f76</id>
<content type='text'>
Some of the tracers have been renamed, which was not updated in the in-kernel
run-time README file. Update it.

Signed-off-by: Nikanth Karthikesan &lt;knikanth@suse.de&gt;
LKML-Reference: &lt;200903231158.32151.knikanth@suse.de&gt;
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/ftrace: alloc the started cpumask for the trace file</title>
<updated>2009-04-07T12:02:03Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2009-04-01T20:53:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b0dfa978c7a1699fb3506fbfcba0b6a5c4bd17ae'/>
<id>urn:sha1:b0dfa978c7a1699fb3506fbfcba0b6a5c4bd17ae</id>
<content type='text'>
Impact: fix a crash while cat trace file

Currently we are using a cpumask to remind each cpu where a
trace occured. It lets us notice the user that a cpu just had
its first trace.

But on latest -tip we have the following crash once we cat the trace
file:

IP: [&lt;c0270c4a&gt;] print_trace_fmt+0x45/0xe7
*pde = 00000000
Oops: 0000 [#1] PREEMPT SMP
last sysfs file: /sys/class/net/eth0/carrier
Pid: 3897, comm: cat Not tainted (2.6.29-tip-02825-g0f22972-dirty #81)
EIP: 0060:[&lt;c0270c4a&gt;] EFLAGS: 00010297 CPU: 0
EIP is at print_trace_fmt+0x45/0xe7
EAX: 00000000 EBX: 00000000 ECX: c12d9e98 EDX: ccdb7010
ESI: d31f4000 EDI: 00322401 EBP: d31f3f10 ESP: d31f3efc
DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
Process cat (pid: 3897, ti=d31f2000 task=d3b3cf20 task.ti=d31f2000)
Stack:
d31f4080 ccdb7010 d31f4000 d691fe70 ccdb7010 d31f3f24 c0270e5c d31f4000
d691fe70 d31f4000 d31f3f34 c02718e8 c12d9e98 d691fe70 d31f3f70 c02bfc33
00001000 09130000 d3b46e00 d691fe98 00000000 00000079 00000001 00000000
Call Trace:
[&lt;c0270e5c&gt;] ? print_trace_line+0x170/0x17c
[&lt;c02718e8&gt;] ? s_show+0xa7/0xbd
[&lt;c02bfc33&gt;] ? seq_read+0x24a/0x327
[&lt;c02bf9e9&gt;] ? seq_read+0x0/0x327
[&lt;c02ab18b&gt;] ? vfs_read+0x86/0xe1
[&lt;c02ab289&gt;] ? sys_read+0x40/0x65
[&lt;c0202d8f&gt;] ? sysenter_do_call+0x12/0x3c
Code: 00 00 00 89 45 ec f7 c7 00 20 00 00 89 55 f0 74 4e f6 86 98 10 00 00 02 74 45 8b 86 8c 10 00 00 8b 9e a8 10 00 00 e8 52 f3 ff ff &lt;0f&gt; a3 03 19 c0 85 c0 75 2b 8b 86 8c 10 00 00 8b 9e a8 10 00 00
EIP: [&lt;c0270c4a&gt;] print_trace_fmt+0x45/0xe7 SS:ESP 0068:d31f3efc
CR2: 0000000000000000
---[ end trace aa9cf38e5ebed9dd ]---

This is because we alloc the iter-&gt;started cpumask on tracing_pipe_open but
not on tracing_open.

It hadn't been noticed until now because we need to have ring buffer overruns
to activate the starting of cpu buffer detection.

Also, we need a check to not print the messagge for the first trace on the file.

Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;1238619188-6109-1-git-send-email-fweisbec@gmail.com&gt;
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/ftrace: fix missing include string.h</title>
<updated>2009-04-07T12:00:18Z</updated>
<author>
<name>Frederic Weisbecker</name>
<email>fweisbec@gmail.com</email>
</author>
<published>2009-03-27T13:22:10Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5f0c6c03c5fee91c02c696bc9bf4c0d41392abe7'/>
<id>urn:sha1:5f0c6c03c5fee91c02c696bc9bf4c0d41392abe7</id>
<content type='text'>
Building a kernel with tracing can raise the following warning on
tip/master:

kernel/trace/trace.c:1249: error: implicit declaration of function 'vbin_printf'

We are missing an include to string.h

Reported-by: Ingo Molnar &lt;mingo@elte.hu&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
LKML-Reference: &lt;1238160130-7437-1-git-send-email-fweisbec@gmail.com&gt;
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 incorrect return type of ns2usecs()</title>
<updated>2009-04-07T11:59:23Z</updated>
<author>
<name>Lai Jiangshan</name>
<email>laijs@cn.fujitsu.com</email>
</author>
<published>2009-03-30T05:48:00Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=cf8e3474654f20433aab9aa35826d43b5f245008'/>
<id>urn:sha1:cf8e3474654f20433aab9aa35826d43b5f245008</id>
<content type='text'>
Impact: fix time output bug in 32bits system

ns2usecs() returns 'long', it's incorrect.

(In i386)
...
          &lt;idle&gt;-0     [000]   521.442100: _spin_lock &lt;-tick_do_update_jiffies64
          &lt;idle&gt;-0     [000]   521.442101: do_timer &lt;-tick_do_update_jiffies64
          &lt;idle&gt;-0     [000]   521.442102: update_wall_time &lt;-do_timer
          &lt;idle&gt;-0     [000]   521.442102: update_xtime_cache &lt;-update_wall_time
....
(It always print the time less than 2200 seconds besides ...)
Because 'long' is 32bits in i386. ( (1&lt;&lt;31) useconds is about 2200 seconds)

...
          &lt;idle&gt;-0     [001] 4154502640.134759: rcu_bh_qsctr_inc &lt;-__do_softirq
          &lt;idle&gt;-0     [001] 4154502640.134760: _local_bh_enable &lt;-__do_softirq
          &lt;idle&gt;-0     [001] 4154502640.134761: idle_cpu &lt;-irq_exit
...
(very large value)
Because 'long' is a signed type and it is 32bits in i386.

Changes in v2:
return 'unsigned long long' instead of 'cycle_t'

Signed-off-by: Lai Jiangshan &lt;laijs@cn.fujitsu.com&gt;
LKML-Reference: &lt;49D05D10.4030009@cn.fujitsu.com&gt;
Reported-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Acked-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
