Debugging Linux Kernel Using SystemTap Part-4 - Wildcards

Syntax to probe for all function entries and exits of a single file:

probe kernel.function("*@filename").call {
....
}

probe kernel.function("*@filename").return {
...
}

Example: Let's probe all the functions of kernel/signal.c

probe kernel.function("*@kernel/signal.c").call {
    printf("%s\n", ppfunc());
}

probe kernel.function("*@kernel/signal.c").return {
    printf("%s\n", ppfunc());
}

ppfunc() prints the function name which is probed.

Partial O/P:



Wildcards in filename:

We can also put wildcards in the file name:
E.g.: probe kernel.function("*@kernel/sys*.c") { printf("%s\n", ppfunc()) } will probe for all  the functions present in kernel/sys.c, kernel/sysctl.c, kernel/sysctl_binary.c

Wildcard in Function Names:

probe kernel.function("*open*) { printf("%s\n", ppfunc()) } will probe for all the open functions.

Comments

Post a Comment

Popular posts from this blog

bb.utils.contains yocto

Difference between RDEPENDS and DEPENDS in Yocto

PR, PN and PV Variable in Yocto