Sometimes a header may not #include everything that it needs to stand alone, and so @cast will fail to build a module around it: $ stap -ue 'probe begin { println(&@cast(0, "fs_struct", "kernel<linux/fs_struct.h>")->root) }' --vp 04 Running make -C '/lib/modules/2.6.32.9-67.fc12.x86_64/build' M='/tmp/staprfow66/typequery_kmod_1' modules ARCH="x86_64" V=1 [...] include/linux/fs_struct.h:8: error: expected specifier-qualifier-list before ‘rwlock_t’ include/linux/fs_struct.h:16: warning: ‘struct task_struct’ declared inside parameter list include/linux/fs_struct.h:16: warning: its scope is only this definition or declaration, which is probably not what you want [...] semantic error: type definition 'fs_struct' not found: identifier '@cast' at <input>:2:10 source: println(&@cast(0, "fs_struct", "kernel<linux/fs_struct.h>")->root) ^ We could work around this by allowing @cast to specify multiple headers which should be compiled together. Frank suggested listing them like this: @cast(x, "foo", "kernel<foo.h><bar.h>")->...
commit da9e11bd5cd3cbedbf794a0e8a83956bd178ba60