Debugging Linux Kernel Using SystemTap Part3 - call and return

To probe a function at the entrance ( call the handler ) add the .call at the end of the probe , and to probe the function at the exit add the .return at the end of the probe.

Syntax:

probe kernel.function("function_name").call {
...
}

probe kernel.function("function_name").return {
...
}

Example:

probe kernel.function("do_sys_open").call{
    printf("File %s\n", user_string($filename))
}

probe kernel.function("do_sys_open").return{
    printf("Return %d\n", $return)
}

O/P:


Comments

Popular posts from this blog

bb.utils.contains yocto

make config vs oldconfig vs defconfig vs menuconfig vs savedefconfig

PR, PN and PV Variable in Yocto