<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel/trace/trace_functions.c, branch v3.6</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=v3.6</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v3.6'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2012-07-17T17:15:04Z</updated>
<entry>
<title>tracing/function: Convert func_set_flag() to a switch statement</title>
<updated>2012-07-17T17:15:04Z</updated>
<author>
<name>Anton Vorontsov</name>
<email>anton.vorontsov@linaro.org</email>
</author>
<published>2012-07-10T00:10:46Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=f555f1231a69846d57099760f9c361982600ffa2'/>
<id>urn:sha1:f555f1231a69846d57099760f9c361982600ffa2</id>
<content type='text'>
Since the function accepts just one bit, we can use the switch
construction instead of if/else if/...

Just a cosmetic change, there should be no functional changes.

Suggested-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Anton Vorontsov &lt;anton.vorontsov@linaro.org&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>tracing/function: Introduce persistent trace option</title>
<updated>2012-07-17T17:07:00Z</updated>
<author>
<name>Anton Vorontsov</name>
<email>anton.vorontsov@linaro.org</email>
</author>
<published>2012-07-10T00:10:42Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=21f679404a0c28bd5b1b3aff2a7218bbff4cb43d'/>
<id>urn:sha1:21f679404a0c28bd5b1b3aff2a7218bbff4cb43d</id>
<content type='text'>
This patch introduces 'func_ptrace' option, now available in
/sys/kernel/debug/tracing/options when function tracer
is selected.

The patch also adds some tiny code that calls back to pstore
to record the trace. The callback is no-op when PSTORE=n.

Signed-off-by: Anton Vorontsov &lt;anton.vorontsov@linaro.org&gt;
Acked-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>ftrace: Fix regression of :mod:module function enabling</title>
<updated>2011-07-07T15:30:08Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-07-07T15:09:22Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=43dd61c9a09bd413e837df829e6bfb42159be52a'/>
<id>urn:sha1:43dd61c9a09bd413e837df829e6bfb42159be52a</id>
<content type='text'>
The new code that allows different utilities to pick and choose
what functions they trace broke the :mod: hook that allows users
to trace only functions of a particular module.

The reason is that the :mod: hook bypasses the hash that is setup
to allow individual users to trace their own functions and uses
the global hash directly. But if the global hash has not been
set up, it will cause a bug:

echo '*:mod:radeon' &gt; /sys/kernel/debug/set_ftrace_filter

produces:

 [drm:drm_mode_getfb] *ERROR* invalid framebuffer id
 [drm:radeon_crtc_page_flip] *ERROR* failed to reserve new rbo buffer before flip
 BUG: unable to handle kernel paging request at ffffffff8160ec90
 IP: [&lt;ffffffff810d9136&gt;] add_hash_entry+0x66/0xd0
 PGD 1a05067 PUD 1a09063 PMD 80000000016001e1
 Oops: 0003 [#1] SMP Jul  7 04:02:28 phyllis kernel: [55303.858604] CPU 1
 Modules linked in: cryptd aes_x86_64 aes_generic binfmt_misc rfcomm bnep ip6table_filter hid radeon r8169 ahci libahci mii ttm drm_kms_helper drm video i2c_algo_bit intel_agp intel_gtt

 Pid: 10344, comm: bash Tainted: G        WC  3.0.0-rc5 #1 Dell Inc. Inspiron N5010/0YXXJJ
 RIP: 0010:[&lt;ffffffff810d9136&gt;]  [&lt;ffffffff810d9136&gt;] add_hash_entry+0x66/0xd0
 RSP: 0018:ffff88003a96bda8  EFLAGS: 00010246
 RAX: ffff8801301735c0 RBX: ffffffff8160ec80 RCX: 0000000000306ee0
 RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff880137c92940
 RBP: ffff88003a96bdb8 R08: ffff880137c95680 R09: 0000000000000000
 R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff81c9df78
 R13: ffff8801153d1000 R14: 0000000000000000 R15: 0000000000000000
 FS: 00007f329c18a700(0000) GS:ffff880137c80000(0000) knlGS:0000000000000000
 CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
 CR2: ffffffff8160ec90 CR3: 000000003002b000 CR4: 00000000000006e0
 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
 Process bash (pid: 10344, threadinfo ffff88003a96a000, task ffff88012fcfc470)
 Stack:
  0000000000000fd0 00000000000000fc ffff88003a96be38 ffffffff810d92f5
  ffff88011c4c4e00 ffff880000000000 000000000b69f4d0 ffffffff8160ec80
  ffff8800300e6f06 0000000081130295 0000000000000282 ffff8800300e6f00
 Call Trace:
  [&lt;ffffffff810d92f5&gt;] match_records+0x155/0x1b0
  [&lt;ffffffff810d940c&gt;] ftrace_mod_callback+0xbc/0x100
  [&lt;ffffffff810dafdf&gt;] ftrace_regex_write+0x16f/0x210
  [&lt;ffffffff810db09f&gt;] ftrace_filter_write+0xf/0x20
  [&lt;ffffffff81166e48&gt;] vfs_write+0xc8/0x190
  [&lt;ffffffff81167001&gt;] sys_write+0x51/0x90
  [&lt;ffffffff815c7e02&gt;] system_call_fastpath+0x16/0x1b
 Code: 48 8b 33 31 d2 48 85 f6 75 33 49 89 d4 4c 03 63 08 49 8b 14 24 48 85 d2 48 89 10 74 04 48 89 42 08 49 89 04 24 4c 89 60 08 31 d2
 RIP [&lt;ffffffff810d9136&gt;] add_hash_entry+0x66/0xd0
  RSP &lt;ffff88003a96bda8&gt;
 CR2: ffffffff8160ec90
 ---[ end trace a5d031828efdd88e ]---

Reported-by: Brian Marete &lt;marete@toshnix.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>ftrace: Implement separate user function filtering</title>
<updated>2011-05-18T19:29:50Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2011-05-04T13:27:52Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b848914ce39589d89ee0078a6d1ef452b464729e'/>
<id>urn:sha1:b848914ce39589d89ee0078a6d1ef452b464729e</id>
<content type='text'>
ftrace_ops that are registered to trace functions can now be
agnostic to each other in respect to what functions they trace.
Each ops has their own hash of the functions they want to trace
and a hash to what they do not want to trace. A empty hash for
the functions they want to trace denotes all functions should
be traced that are not in the notrace hash.

Cc: Paul E. McKenney &lt;paulmck@linux.vnet.ibm.com&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: Remove ftrace_preempt_disable/enable</title>
<updated>2010-06-03T23:32:38Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2010-06-03T13:36:50Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=5168ae50a66e3ff7184c2b16d661bd6d70367e50'/>
<id>urn:sha1:5168ae50a66e3ff7184c2b16d661bd6d70367e50</id>
<content type='text'>
The ftrace_preempt_disable/enable functions were to address a
recursive race caused by the function tracer. The function tracer
traces all functions which makes it easily susceptible to recursion.
One area was preempt_enable(). This would call the scheduler and
the schedulre would call the function tracer and loop.
(So was it thought).

The ftrace_preempt_disable/enable was made to protect against recursion
inside the scheduler by storing the NEED_RESCHED flag. If it was
set before the ftrace_preempt_disable() it would not call schedule
on ftrace_preempt_enable(), thinking that if it was set before then
it would have already scheduled unless it was already in the scheduler.

This worked fine except in the case of SMP, where another task would set
the NEED_RESCHED flag for a task on another CPU, and then kick off an
IPI to trigger it. This could cause the NEED_RESCHED to be saved at
ftrace_preempt_disable() but the IPI to arrive in the the preempt
disabled section. The ftrace_preempt_enable() would not call the scheduler
because the flag was already set before entring the section.

This bug would cause a missed preemption check and cause lower latencies.

Investigating further, I found that the recusion caused by the function
tracer was not due to schedule(), but due to preempt_schedule(). Now
that preempt_schedule is completely annotated with notrace, the recusion
no longer is an issue.

Reported-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>tracing: switch function prints from %pf to %ps</title>
<updated>2009-09-17T19:53:40Z</updated>
<author>
<name>Steven Rostedt</name>
<email>srostedt@redhat.com</email>
</author>
<published>2009-09-17T04:05:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=b375a11a239e9e1cac40c7f3ff28b343d9f7ac51'/>
<id>urn:sha1:b375a11a239e9e1cac40c7f3ff28b343d9f7ac51</id>
<content type='text'>
For direct function pointers (like what mcount provides) PowerPC64
requires the use of %ps, otherwise nothing is printed.

This patch converts all prints of functions retrieved through mcount
to use the %ps format from the %pf.

Signed-off-by: Steven Rostedt &lt;rostedt@goodmis.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'linus' into tracing/core</title>
<updated>2009-07-18T10:20:01Z</updated>
<author>
<name>Ingo Molnar</name>
<email>mingo@elte.hu</email>
</author>
<published>2009-07-18T10:19:57Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=45bceffc3013bda7d2ebc7802e9b153b674e2d44'/>
<id>urn:sha1:45bceffc3013bda7d2ebc7802e9b153b674e2d44</id>
<content type='text'>
Merge reason: tracing/core was on an older, pre-rc1 base.

Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
<entry>
<title>tracing/function: Cleanup for function tracer</title>
<updated>2009-07-17T05:45:51Z</updated>
<author>
<name>Xiao Guangrong</name>
<email>xiaoguangrong@cn.fujitsu.com</email>
</author>
<published>2009-07-16T06:21:08Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=6f2f3cf00ee32f75ba007a46bab88a54d68a5deb'/>
<id>urn:sha1:6f2f3cf00ee32f75ba007a46bab88a54d68a5deb</id>
<content type='text'>
We can directly use %pf input format instead of kallsyms_lookup()
and %s input format

Signed-off-by: Xiao Guangrong &lt;xiaoguangrong@cn.fujitsu.com&gt;
Reviewed-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</content>
</entry>
<entry>
<title>tracing/function: Fix the return value of ftrace_trace_onoff_callback()</title>
<updated>2009-07-17T03:34:32Z</updated>
<author>
<name>Xiao Guangrong</name>
<email>xiaoguangrong@cn.fujitsu.com</email>
</author>
<published>2009-07-15T04:29:06Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=04aef32d39cc4ef80087c0ce8ed113c6d64f1a6b'/>
<id>urn:sha1:04aef32d39cc4ef80087c0ce8ed113c6d64f1a6b</id>
<content type='text'>
ftrace_trace_onoff_callback() will return an error even if we do the
right operation, for example:

 # echo _spin_*:traceon:10 &gt; set_ftrace_filter
 -bash: echo: write error: Invalid argument
 # cat set_ftrace_filter
 #### all functions enabled ####
 _spin_trylock_bh:traceon:count=10
 _spin_unlock_irq:traceon:count=10
 _spin_unlock_bh:traceon:count=10
 _spin_lock_irq:traceon:count=10
 _spin_unlock:traceon:count=10
 _spin_trylock:traceon:count=10
 _spin_unlock_irqrestore:traceon:count=10
 _spin_lock_irqsave:traceon:count=10
 _spin_lock_bh:traceon:count=10
 _spin_lock:traceon:count=10

We want to set _spin_*:traceon:10 to set_ftrace_filter, it complains
with "Invalid argument", but the operation is successful.

This is because ftrace_process_regex() returns the number of functions that
matched the pattern. If the number is not 0, this value is returned
by ftrace_regex_write() whereas we want to return the number of bytes
virtually written.
Also the file offset pointer is not updated in this case.

If the number of matched functions is lower than the number of bytes written
by the user, this results to a reprocessing of the string given by the user with
a lower size, leading to a malformed ftrace regex and then a -EINVAL returned.

So, this patch fixes it by returning 0 if no error occured.
The fix also applies on 2.6.30

Signed-off-by: Xiao Guangrong &lt;xiaoguangrong@cn.fujitsu.com&gt;
Reviewed-by: Li Zefan &lt;lizf@cn.fujitsu.com&gt;
Cc: stable@kernel.org
Signed-off-by: Frederic Weisbecker &lt;fweisbec@gmail.com&gt;
</content>
</entry>
<entry>
<title>ftrace: Remove duplicate newline</title>
<updated>2009-06-25T08:28:36Z</updated>
<author>
<name>Li Zefan</name>
<email>lizf@cn.fujitsu.com</email>
</author>
<published>2009-06-25T06:05:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=00e54d087afb3867b0b461aef6c1ff433d0df564'/>
<id>urn:sha1:00e54d087afb3867b0b461aef6c1ff433d0df564</id>
<content type='text'>
Before:
  # echo 'sys_open:traceon:' &gt; set_ftrace_filter
  # echo 'sys_close:traceoff:5' &gt; set_ftrace_filter
  # cat set_ftrace_filter
  #### all functions enabled ####
  sys_open:traceon:unlimited

  sys_close:traceoff:count=0

After:
  # cat set_ftrace_filter
  #### all functions enabled ####
  sys_open:traceon:unlimited
  sys_close:traceoff:count=0

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;4A4313A7.7030105@cn.fujitsu.com&gt;
Signed-off-by: Ingo Molnar &lt;mingo@elte.hu&gt;
</content>
</entry>
</feed>
