Skip to content

Instantly share code, notes, and snippets.

@wenjianhn
Last active August 29, 2015 14:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wenjianhn/b080029540db4ccb24db to your computer and use it in GitHub Desktop.
Save wenjianhn/b080029540db4ccb24db to your computer and use it in GitHub Desktop.
trace ceph osd socket
#! /usr/bin/env stap
probe syscall.accept {
if (execname() != "ceph-osd") next;
printf("pid: %d tid: %d. accept(%s)\n", pid(), tid(), argstr)
}
probe syscall.accept.return {
if (execname() != "ceph-osd") next;
printf("pid: %d tid: %d. accept returns fd: %s\n", pid(), tid(), retstr)
}
probe syscall.setsockopt
{
if (execname() != "ceph-osd") next;
printf("pid: %d tid: %d. setsockopt(fd: %d, level: %s, optname: %s, optlen: %u)\n",
pid(), tid(), fd, level_str, optname_str, optlen)
}
probe syscall.close {
if (execname() != "ceph-osd") next;
printf("pid: %d tid: %d. close(%s)\n", pid(), tid(), argstr)
}
probe syscall.shutdown {
if (execname() != "ceph-osd") next;
printf("pid: %d tid: %d. shutdown(%s)\n", pid(), tid(), argstr)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment