Created
July 17, 2018 23:37
-
-
Save jhgorse/dda4abd9b4a1b09124b3a58f07c85efb to your computer and use it in GitHub Desktop.
Traces afs_linux_write_begin() into the kernel grab_cache_page_write_begin()
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Traces afs_linux_write_begin() into the kernel grab_cache_page_write_begin() | |
global traceme | |
function printf_indent(str, parm_str) { | |
printf ("%s -> %s P %s\n", thread_indent(1), str, parm_str); | |
} | |
function printf_deindent(str, ret_str) { | |
printf ("%s <- %s R %s\n", thread_indent(-1), str, ret_str); | |
} | |
probe module("openafs").function("afs_linux_write_begin").call { | |
traceme[tid()] = 1; | |
printf_indent(ppfunc(), $$parms); | |
} | |
probe module("openafs").function("afs_linux_write_begin").return { | |
if (traceme[tid()]) { | |
printf_deindent(ppfunc(), $return$); | |
delete traceme[tid()]; | |
} | |
} | |
probe kernel.function("grab_cache_page_write_begin").call { | |
if (traceme[tid()]) { | |
printf_indent(ppfunc(), $$parms); | |
} | |
} | |
probe kernel.function("grab_cache_page_write_begin").return { | |
if (traceme[tid()]) { | |
printf_deindent(ppfunc(), $return$); | |
} | |
} | |
probe kernel.function("pagecache_get_page").call { | |
if (traceme[tid()]) { | |
printf_indent(ppfunc(), $$parms); | |
} | |
} | |
probe kernel.function("pagecache_get_page").return { | |
if (traceme[tid()]) { | |
printf_deindent(ppfunc(), $return$); | |
} | |
} | |
probe kernel.function("find_get_entry").call { | |
if (traceme[tid()]) { | |
printf_indent(ppfunc(), $$parms); | |
} | |
} | |
probe kernel.function("find_get_entry").return { | |
if (traceme[tid()]) { | |
printf_deindent(ppfunc(), $return$); | |
} | |
} | |
probe kernel.function("*radix_tree*").call { | |
if (traceme[tid()]) { | |
printf_indent(ppfunc(), $$parms); | |
} | |
} | |
probe kernel.function("*radix_tree*").return { | |
if (traceme[tid()]) { | |
if ($$return$) | |
printf_deindent(ppfunc(), $$return$); | |
else | |
printf_deindent(ppfunc(), "void"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment