Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save alessandrocarminati/5e989219c8e18a65eb97d0fe69b383c1 to your computer and use it in GitHub Desktop.
Save alessandrocarminati/5e989219c8e18a65eb97d0fe69b383c1 to your computer and use it in GitHub Desktop.
example to extract private kernel structure definition using BTF
$ pahole vmlinux | sed -n '/^struct check_mount/{:start /};/!{N;b start}; p }'
struct check_mount {
struct vfsmount * mnt; /* 0 8 */
unsigned int mounted; /* 8 4 */
/* size: 16, cachelines: 1, members: 2 */
/* padding: 4 */
/* last cacheline: 16 bytes */
};
$ # defined in fs/dcache.c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment