Hi, I am trying SystemTap - a tool for dynamic tracing on Gentoo and I have some troubles to make it working. I followed the guide on
https://sourceware.org/systemtap/wiki/SystemTapWithSelfBuiltKernel and built the kernel with required options: zgrep -E 'CONFIG_DEBUG_INFO|CONFIG_KPROBES|CONFIG_RELAY|CONFIG_DEBUG_FS|CONFIG_MODULES|CONFIG_MODULE_UNLOAD|CONFIG_UPROBES|CONFIG_DEBUG_INFO' /proc/config.gz CONFIG_RELAY=y CONFIG_KPROBES=y CONFIG_UPROBES=y CONFIG_MODULES_USE_ELF_RELA=y CONFIG_MODULES=y CONFIG_MODULE_UNLOAD=y CONFIG_DEBUG_INFO=y # CONFIG_DEBUG_INFO_REDUCED is not set # CONFIG_DEBUG_INFO_SPLIT is not set CONFIG_DEBUG_INFO_DWARF4=y CONFIG_DEBUG_FS=y # CONFIG_KPROBES_SANITY_TEST is not set But even the simplest check fails on: stap -r /usr/src/linux -v -e 'probe vfs.read {printf("read performed\n"); exit()}' Pass 1: parsed user script and 122 library script(s) using 214692virt/125980res/5604shr/122476data kb, in 450usr/20sys/464real ms. Pass 2: analyzed script: 1 probe(s), 1 function(s), 3 embed(s), 0 global(s) using 347656virt/260520res/6984shr/255440data kb, in 1210usr/250sys/1462real ms. Pass 3: translated to C into "/tmp/stap2nY7sY/stap_9aad5fb97c53bb7c4bc51dce0ccbb236_1259_src.c" using 347656virt/260772res/7236shr/255440data kb, in 0usr/0sys/4real ms. In file included from /usr/share/systemtap/runtime/linux/task_finder.c:17:0, from /usr/share/systemtap/runtime/linux/runtime.h:206, from /usr/share/systemtap/runtime/runtime.h:24, from /tmp/stap2nY7sY/stap_9aad5fb97c53bb7c4bc51dce0ccbb236_1259_src.c:24: /usr/share/systemtap/runtime/linux/task_finder2.c: In function '__stp_call_mmap_callbacks_with_addr': /usr/share/systemtap/runtime/linux/task_finder2.c:695:24: error: 'struct file' has no member named 'f_dentry' dentry = vma->vm_file->f_dentry; ^ /usr/share/systemtap/runtime/linux/task_finder2.c: In function '__stp_call_mmap_callbacks_for_task': /usr/share/systemtap/runtime/linux/task_finder2.c:1198:42: error: 'struct file' has no member named 'f_dentry' vma_cache_p->dentry = vma->vm_file->f_dentry; ^ scripts/Makefile.build:258: recipe for target '/tmp/stap2nY7sY/stap_9aad5fb97c53bb7c4bc51dce0ccbb236_1259_src.o' failed make[1]: *** [/tmp/stap2nY7sY/stap_9aad5fb97c53bb7c4bc51dce0ccbb236_1259_src.o] Error 1 Makefile:1390: recipe for target '_module_/tmp/stap2nY7sY' failed make: *** [_module_/tmp/stap2nY7sY] Error 2 WARNING: kbuild exited with status: 2 Pass 4: compiled C into "stap_9aad5fb97c53bb7c4bc51dce0ccbb236_1259.ko" in 3230usr/260sys/4290real ms. Pass 4: compilation failed. [man error::pass4] I am wondering now - is there anything wrong with my aproach? Does anyone succesfully use SystemTap on Gentoo? And if so, could you help me to make this running? Lukas

