2de67fcaf4
What is in a struct... [acme@filo pahole]$ pahole net/ipv6/tcp_ipv6.o delayed_work /* <2bc9> /home/acme/git/linux-2.6/include/linux/workqueue.h:37 */ struct delayed_work { struct work_struct work; /* 0 16 */ struct timer_list timer; /* 16 24 */ }; /* size: 40, cachelines: 1 */ /* last cacheline: 40 bytes */ [acme@filo pahole]$ Oh, but what if we want to unfold all the structs? lo pahole]$ pahole --expand_types /home/acme/git/OUTPUT/qemu/linux-2.6/net/ipv6/tcp_ipv6.o delayed_work /* <2bc9> /home/acme/git/linux-2.6/include/linux/workqueue.h:37 */ struct delayed_work { struct work_struct { atomic_long_t data; /* 0 4 */ struct list_head { struct list_head * next; /* 0 4 */ struct list_head * prev; /* 4 4 */ } entry; /* 4 8 */ work_func_t func; /* 12 4 */ } work; /* 0 16 */ struct timer_list { struct list_head { struct list_head * next; /* 0 4 */ struct list_head * prev; /* 4 4 */ } entry; /* 0 8 */ long unsigned int expires; /* 8 4 */ void (*function)(long unsigned int); /* 12 4 */ long unsigned int data; /* 16 4 */ struct tvec_t_base_s * base; /* 20 4 */ } timer; /* 16 24 */ }; /* size: 40, cachelines: 1 */ /* last cacheline: 40 bytes */ [acme@filo pahole]$ Quick hack, as we already had all the needed infrastructure due to anonymous struct printing inside structs/unions, now for the curious, if you have the kernel-debuginfo package installed in your FC6 machine: [acme@filo pahole]$ pahole --expand_types /usr/lib/debug/lib/modules/2.6.19-1.2895.fc6/kernel/net/ipv6/ipv6.ko.debug tcp6_sock Try struct task_struct too 8-) Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> |
||
---|---|---|
cmake/modules | ||
lib | ||
rpm/SPECS | ||
CMakeLists.txt | ||
codiff.c | ||
ctracer.c | ||
dtagnames.c | ||
dwarves.c | ||
dwarves.h | ||
list.h | ||
MANIFEST | ||
pahole.c | ||
pdwtags.c | ||
pfunct.c | ||
prefcnt.c | ||
README | ||
README.ctracer |
Build instructions: 1. install cmake 2. mkdir build 3. cd build 4. cmake .. 5. make Known to work scenarios: Mandriva Cooker: cmake 2.4.5-1mdv2007.1 libelfutils1-devel 0.123-1mdv2007.1 Debian Unstable: cmake 2.4.5-1 libdw-dev 0.123-2