two different patches have been ported to linux-mips/loongson for kernel
function tracing, they are KFT and ftrace.
both of them can be used to trace kernel functions, but they are based
on different implementations(will be introduced later).
KFT is released as a kernel patch, and maintained by DSLab currently,
the latest versions can be found at ftp://dslab.lzu.edu.cn/pub/kft
ftrace is originally from the real time linux extension(RT_PREEMPT,
rt.wiki.kernel.org), and have been merged to the mainline kernel, but
there is no mips implementation in the official kernel. I have ported it
to mips platform, and trying to push it into the mainline kernel.
* KFT for linux-mips/loongson git tree:
* ftrace for linux-mips/loongson git tree:
both of them have been tested on yeeloong2f notebook, works well when
compiled kernel in 32bit or 64bit.
if you want to use them, try to read the documentations for them:
+ more information about KFT & ftrace:
"Kernel Function Trace (KFT) is a kernel function tracing system, which
uses the "-finstrument-functions" capability of the gcc compiler to add
instrumentation callouts to every function entry and exit. The KFT
system provides for capturing these callouts and generating a trace of
events, with timing details. KFT is excellent at providing a good timing
overview of kernel procedures, allowing you to see where time is spent
in functions and sub-routines in the kernel."
"ftrace is originally came from work on realtime Linux, it is a
self-contained solution, requiring no user-space tools or support, that
is useful for tracking down problems—not only in the kernel, but in its
interactions with user space as well.
The name ftrace comes from "function tracer", which was its original
purpose, but it can do more than that. Various additional tracers have
been added to look at things like context switches, how long interrupts
are disabled, how long it takes for high-priority tasks to run after
they have been woken up, and so on. Its genesis in the realtime tree is
evident in the tracers so far available, but ftrace also includes a
plugin framework that allows new tracers to be added easily."
BTW: a "kgcov for linux-mips/loongson" git tree can also be found here,
kgcov can be used to kernel profiling, which is originally from
DSLab, Lanzhou University, China
www.lemote.com, Jiangsu Province, China