Created
July 20, 2016 06:46
-
-
Save fortitudepub/3a3d7d1b57b005b12f00a0aace64deaf to your computer and use it in GitHub Desktop.
skbmem systemtap example
This file contains hidden or 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
function string_ops:string (val) %{ | |
strlcpy (STAP_RETVALUE, (char*)STAP_ARG_val, MAXSTRINGLEN); | |
%} | |
probe kernel.function("__dev_queue_xmit") { | |
if (execname() =~ "keepalived") { | |
printf("__dev_queue_xmit %d %s(%d/%d) %s\n", gettimeofday_us(), execname(), pid(), cpu(), $$vars); | |
i = 0; | |
printf("dump begin, skb->gso %d\n", @cast($skb->head+$skb->end, "skb_shared_info", "")->gso_size); | |
for (; i< 14; i++) { | |
printf("%02x:", $skb->data[i]); | |
} | |
// give a backtrace to see which path the function called... | |
print(sprint_backtrace()); | |
print("dump end\n"); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment