Skip to content

Instantly share code, notes, and snippets.

@fortitudepub
Created February 6, 2017 03:18
Show Gist options
  • Save fortitudepub/2965b9cf86020290a00049bd0e36317d to your computer and use it in GitHub Desktop.
Save fortitudepub/2965b9cf86020290a00049bd0e36317d to your computer and use it in GitHub Desktop.
system tap @cast example
function string_ops:string (val) %{
strlcpy (STAP_RETVALUE, (char*)STAP_ARG_val, MAXSTRINGLEN);
%}
probe kernel.function("udp_gro_receive") {
if (cpu() == 0) {
printf("udp_gro_receive %d %s(%d/%d) %s %d, %d, %d\n", gettimeofday_us(), execname(), pid(), cpu(), $$vars, $skb->ip_summed, @cast($skb->cb, "struct napi_gro_cb")->csum_cnt, @cast($skb->cb, "struct napi_gro_cb")->csum_valid);
print_backtrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment