<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/arch/mips/kernel/ftrace.c, branch v3.0.44</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>MIPS: Mask jump target in ftrace_dyn_arch_init_insns().</title>
<updated>2011-05-10T17:15:22+00:00</updated>
<author>
<name>David Daney</name>
<email>ddaney@caviumnetworks.com</email>
</author>
<published>2010-12-28T21:21:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c54794d19e61472156e37263c074225574c80df1'/>
<id>c54794d19e61472156e37263c074225574c80df1</id>
<content type='text'>
The current code is abusing the uasm interface by passing jump target
addresses with high bits set.  Mask the addresses to avoid annoying
messages at boot time.

Signed-off-by: David Daney &lt;ddaney@caviumnetworks.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Patchwork: https://patchwork.linux-mips.org/patch/1922/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The current code is abusing the uasm interface by passing jump target
addresses with high bits set.  Mask the addresses to avoid annoying
messages at boot time.

Signed-off-by: David Daney &lt;ddaney@caviumnetworks.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Patchwork: https://patchwork.linux-mips.org/patch/1922/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS, Tracing: Fix set_graph_function of function graph tracer</title>
<updated>2011-03-14T20:07:24+00:00</updated>
<author>
<name>Wu Zhangjin</name>
<email>wuzhangjin@gmail.com</email>
</author>
<published>2011-01-21T18:01:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=b9f07eb2f25a64098e2ba223c1a2fe2a8f249e01'/>
<id>b9f07eb2f25a64098e2ba223c1a2fe2a8f249e01</id>
<content type='text'>
trace.func should be set to the recorded ip of the mcount calling site
in the __mcount_loc section to filter the function entries configured
through the tracing/set_graph_function interface, but before, this is
set to the self_ra(the return address of mcount), which has made
set_graph_function not work as expected.

This fixes it via calculating the right recorded ip in the __mcount_loc
section and assign it to trace.func.

Reported-by: Zhiping Zhong &lt;xzhong86@163.com&gt;
Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
Cc: Sergei Shtylyov &lt;sshtylyov@mvista.com&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2017/
Signed-off-by: Ralf Baechle &lt;ralf@duck.linux-mips.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
trace.func should be set to the recorded ip of the mcount calling site
in the __mcount_loc section to filter the function entries configured
through the tracing/set_graph_function interface, but before, this is
set to the self_ra(the return address of mcount), which has made
set_graph_function not work as expected.

This fixes it via calculating the right recorded ip in the __mcount_loc
section and assign it to trace.func.

Reported-by: Zhiping Zhong &lt;xzhong86@163.com&gt;
Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
Cc: Sergei Shtylyov &lt;sshtylyov@mvista.com&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2017/
Signed-off-by: Ralf Baechle &lt;ralf@duck.linux-mips.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS, Tracing: Clean up ftrace_make_nop()</title>
<updated>2011-03-14T20:07:24+00:00</updated>
<author>
<name>Wu Zhangjin</name>
<email>wuzhangjin@gmail.com</email>
</author>
<published>2011-01-19T19:28:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7f21a60968221eabad5c53fe760db3d094994011'/>
<id>7f21a60968221eabad5c53fe760db3d094994011</id>
<content type='text'>
This moves the comments out of ftrace_make_nop() and cleans it.  At the
same time, a macro MCOUNT_OFFSET_INSNS is defined for sharing with the
next patch.

Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2008/
Signed-off-by: Ralf Baechle &lt;ralf@duck.linux-mips.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This moves the comments out of ftrace_make_nop() and cleans it.  At the
same time, a macro MCOUNT_OFFSET_INSNS is defined for sharing with the
next patch.

Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2008/
Signed-off-by: Ralf Baechle &lt;ralf@duck.linux-mips.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS, Tracing: Clean up prepare_ftrace_return()</title>
<updated>2011-03-14T20:07:24+00:00</updated>
<author>
<name>Wu Zhangjin</name>
<email>wuzhangjin@gmail.com</email>
</author>
<published>2011-01-19T19:28:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=2816e325969396af5bd1d5f70c7360074ae1d63c'/>
<id>2816e325969396af5bd1d5f70c7360074ae1d63c</id>
<content type='text'>
The old prepare_ftrace_return() for MIPS is confused and have introduced
some problem. This patch cleans up the names of the arguments, variables
and related functions.

For MIPS, the 2nd argument of prepare_ftrace_return() is not really the
'selfpc' described in ftrace-design.txt but instead it is the self
return address. This did break the compatibility of the generic
interface but really reduced one unneeded calculation for to get the
current function name, the parent return address and the self return
address are enough, no need to tranform the self return address to the
self address.

But set_graph_function of function graph tracer is an exception, it does
need the 2nd argument of prepare_ftrace_return() as 'selfpc', for it
will use 'selfpc' to match user's configuration of function graph
entries, but in reality, it doesn't need the 'selfpc' but the recorded
ip address of the mcount calling site in the __mcount_loc section. So,
the 2nd argument of prepare_ftrace_return() is not important, the real
requirement is the right recorded ip address should be calculated and
assign to trace.func, this will be fixed in the next patches.

Reported-by: Zhiping Zhong &lt;xzhong86@163.com&gt;
Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2007/
Signed-off-by: Ralf Baechle &lt;ralf@duck.linux-mips.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The old prepare_ftrace_return() for MIPS is confused and have introduced
some problem. This patch cleans up the names of the arguments, variables
and related functions.

For MIPS, the 2nd argument of prepare_ftrace_return() is not really the
'selfpc' described in ftrace-design.txt but instead it is the self
return address. This did break the compatibility of the generic
interface but really reduced one unneeded calculation for to get the
current function name, the parent return address and the self return
address are enough, no need to tranform the self return address to the
self address.

But set_graph_function of function graph tracer is an exception, it does
need the 2nd argument of prepare_ftrace_return() as 'selfpc', for it
will use 'selfpc' to match user's configuration of function graph
entries, but in reality, it doesn't need the 'selfpc' but the recorded
ip address of the mcount calling site in the __mcount_loc section. So,
the 2nd argument of prepare_ftrace_return() is not important, the real
requirement is the right recorded ip address should be calculated and
assign to trace.func, this will be fixed in the next patches.

Reported-by: Zhiping Zhong &lt;xzhong86@163.com&gt;
Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2007/
Signed-off-by: Ralf Baechle &lt;ralf@duck.linux-mips.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS, Tracing: Substitute in_kernel_space() for in_module()</title>
<updated>2011-03-14T20:07:24+00:00</updated>
<author>
<name>Wu Zhangjin</name>
<email>wuzhangjin@gmail.com</email>
</author>
<published>2011-01-19T19:28:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d9cdb2f1038143c945fcb1a366aae4fa2998419e'/>
<id>d9cdb2f1038143c945fcb1a366aae4fa2998419e</id>
<content type='text'>
The old in_module() may not work in some situations(e.g. when module &amp;
kernel are in the same address space when CONFIG_MAPPED_KERNEL=y), The
in_kernel_space() is more generic and it is also easy to be implemented
via cloning the existing core_kernel_text(), so, replace the in_module()
with in_kernel_space().

Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2005/
Signed-off-by: Ralf Baechle &lt;ralf@duck.linux-mips.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The old in_module() may not work in some situations(e.g. when module &amp;
kernel are in the same address space when CONFIG_MAPPED_KERNEL=y), The
in_kernel_space() is more generic and it is also easy to be implemented
via cloning the existing core_kernel_text(), so, replace the in_module()
with in_kernel_space().

Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2005/
Signed-off-by: Ralf Baechle &lt;ralf@duck.linux-mips.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS, Tracing: Speed up function graph tracer</title>
<updated>2011-03-14T20:07:24+00:00</updated>
<author>
<name>Wu Zhangjin</name>
<email>wuzhangjin@gmail.com</email>
</author>
<published>2011-01-19T19:28:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9a620a559be65023b5fd5d0eaf37dae884c4f404'/>
<id>9a620a559be65023b5fd5d0eaf37dae884c4f404</id>
<content type='text'>
This simply moves the "ip-=4" statement down to the end of the do { ...
} while (...); loop, which reduces one unneeded subtration and the
subsequent memory loading and comparison.

Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2006/
Signed-off-by: Ralf Baechle &lt;ralf@duck.linux-mips.net&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This simply moves the "ip-=4" statement down to the end of the do { ...
} while (...); loop, which reduces one unneeded subtration and the
subsequent memory loading and comparison.

Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: Steven Rostedt &lt;srostedt@redhat.com&gt;
Cc: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2006/
Signed-off-by: Ralf Baechle &lt;ralf@duck.linux-mips.net&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS: Tracing: Cleanup of address space checking</title>
<updated>2010-07-05T16:17:30+00:00</updated>
<author>
<name>Wu Zhangjin</name>
<email>wuzhangjin@gmail.com</email>
</author>
<published>2010-05-14T11:08:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c9f84873c1231621508cd438bb2991ddba770a69'/>
<id>c9f84873c1231621508cd438bb2991ddba770a69</id>
<content type='text'>
This patch adds an inline function in_module() to check which space the
instruction pointer in, kernel space or module space.

Note:  This will not work when the kernel space and module space are the
same. If they are the same, we need to modify scripts/recordmcount.pl,
ftrace_make_nop/call() and the other related parts to ensure the
enabling/disabling of the calling site to _mcount is right for both
kernel and module.

[Ralf: It also is still incorrect for some 64-bit kernels.]

Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: linux-mips &lt;linux-mips@linux-mips.org&gt;
Cc: David Daney &lt;david.s.daney@gmail.com&gt;
Patchwork: http://patchwork.linux-mips.org/patch/1232/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds an inline function in_module() to check which space the
instruction pointer in, kernel space or module space.

Note:  This will not work when the kernel space and module space are the
same. If they are the same, we need to modify scripts/recordmcount.pl,
ftrace_make_nop/call() and the other related parts to ensure the
enabling/disabling of the calling site to _mcount is right for both
kernel and module.

[Ralf: It also is still incorrect for some 64-bit kernels.]

Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: linux-mips &lt;linux-mips@linux-mips.org&gt;
Cc: David Daney &lt;david.s.daney@gmail.com&gt;
Patchwork: http://patchwork.linux-mips.org/patch/1232/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS: Tracing: Cleanup of function graph tracer</title>
<updated>2010-07-05T16:17:30+00:00</updated>
<author>
<name>Wu Zhangjin</name>
<email>wuzhangjin@gmail.com</email>
</author>
<published>2010-05-14T11:08:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=68ccf7521dc89bfcf01432fd1bf8cb4d7d534e4c'/>
<id>68ccf7521dc89bfcf01432fd1bf8cb4d7d534e4c</id>
<content type='text'>
Cleans up comments and ftrace_get_parent_addr() of function graph tracer.

Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: linux-mips &lt;linux-mips@linux-mips.org&gt;
Cc: David Daney &lt;david.s.daney@gmail.com&gt;
Patchwork: http://patchwork.linux-mips.org/patch/1231/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Cleans up comments and ftrace_get_parent_addr() of function graph tracer.

Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: linux-mips &lt;linux-mips@linux-mips.org&gt;
Cc: David Daney &lt;david.s.daney@gmail.com&gt;
Patchwork: http://patchwork.linux-mips.org/patch/1231/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS: Tracing: Reduce the overhead of dynamic Function Tracer</title>
<updated>2010-07-05T16:17:29+00:00</updated>
<author>
<name>Wu Zhangjin</name>
<email>wuzhangjin@gmail.com</email>
</author>
<published>2010-05-14T11:08:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e424054000878d7eb11e44289242886d6e219d22'/>
<id>e424054000878d7eb11e44289242886d6e219d22</id>
<content type='text'>
With the help of uasm this patch encodes the instructions of the dynamic
function tracer in ftrace_dyn_arch_init() when initializing it.

As a result we can remove the dynamic encoding of instructions in
ftrace_make_nop()/call(), ftrace_enable_ftrace_graph_caller() and remove
the macro jump_insn_encode() and at last this reduce the overhead of
dynamic Function Tracer.  This also is cleaner.

Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: linux-mips &lt;linux-mips@linux-mips.org&gt;
Cc: David Daney &lt;david.s.daney@gmail.com&gt;
Patchwork: http://patchwork.linux-mips.org/patch/1230/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With the help of uasm this patch encodes the instructions of the dynamic
function tracer in ftrace_dyn_arch_init() when initializing it.

As a result we can remove the dynamic encoding of instructions in
ftrace_make_nop()/call(), ftrace_enable_ftrace_graph_caller() and remove
the macro jump_insn_encode() and at last this reduce the overhead of
dynamic Function Tracer.  This also is cleaner.

Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: linux-mips &lt;linux-mips@linux-mips.org&gt;
Cc: David Daney &lt;david.s.daney@gmail.com&gt;
Patchwork: http://patchwork.linux-mips.org/patch/1230/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>MIPS: Tracing: Cleanup of instructions used</title>
<updated>2010-07-05T16:17:29+00:00</updated>
<author>
<name>Wu Zhangjin</name>
<email>wuzhangjin@gmail.com</email>
</author>
<published>2010-05-14T11:08:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=4d6829f92a02d96e1bec2ffe6ee674ef3b49722b'/>
<id>4d6829f92a02d96e1bec2ffe6ee674ef3b49722b</id>
<content type='text'>
This patch adds some cleanups of the instructions:
  o use macros instead of magic numbers
  o use macros instead of variables to reduce some overhead
  o add new macro for the jal instruction

Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: linux-mips &lt;linux-mips@linux-mips.org&gt;
Cc: David Daney &lt;david.s.daney@gmail.com&gt;
Patchwork: http://patchwork.linux-mips.org/patch/1229/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch adds some cleanups of the instructions:
  o use macros instead of magic numbers
  o use macros instead of variables to reduce some overhead
  o add new macro for the jal instruction

Signed-off-by: Wu Zhangjin &lt;wuzhangjin@gmail.com&gt;
Cc: linux-mips &lt;linux-mips@linux-mips.org&gt;
Cc: David Daney &lt;david.s.daney@gmail.com&gt;
Patchwork: http://patchwork.linux-mips.org/patch/1229/
Signed-off-by: Ralf Baechle &lt;ralf@linux-mips.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
