No script-level local variables available in F20's kernel.function("do_execve"). This changed between 3.13.9-200.fc20 and 3.15.10-201.fc20: # uname -r; rpm -q systemtap 3.13.9-200.fc20.x86_64 systemtap-2.7-1.mcermak.e454243.fc20.x86_64 # stap -L 'kernel.function("do_execve")' kernel.function("do_execve@fs/exec.c:1575") $filename:char const* $__argv:char const* const* $__envp:char const* const* # # stap -e 'probe kernel.function("do_execve"){log(user_string($__argv[0]))}' -c /bin/true /bin/true # # uname -r; rpm -q systemtap 3.15.10-201.fc20.x86_64 systemtap-2.7-1.mcermak.e454243.fc20.x86_64 # stap -L 'kernel.function("do_execve")' kernel.function("do_execve@fs/exec.c:1547") # # stap -e 'probe kernel.function("do_execve"){log(user_string($__argv[0]))}' -c /bin/true semantic error: failed to retrieve location attribute for '__argv' [man error::dwarf]: identifier '$__argv' at <input>:1:52 dieoffset: 0x186983f from unknown debug file for kernel function: do_execve at fs/exec.c:1553 inlined by SYSC_execve at fs/exec.c:1607 inlined by SyS_execve at fs/exec.c:1602 source: probe kernel.function("do_execve"){log(user_string($__argv[0]))} ^ Pass 2: analysis failed. [man error::pass2] # The function declaration didn't change significantly: ===== # grep -A 8 '^int do_execve' /usr/src/debug/kernel-3.13.fc20/linux-3.13.9-200.fc20.x86_64/fs/exec.c int do_execve(const char *filename, const char __user *const __user *__argv, const char __user *const __user *__envp) { struct user_arg_ptr argv = { .ptr.native = __argv }; struct user_arg_ptr envp = { .ptr.native = __envp }; return do_execve_common(filename, argv, envp); } # grep -A 8 '^int do_execve' /usr/src/debug/kernel-3.15.fc20/linux-3.15.10-201.fc20.x86_64/fs/exec.c int do_execve(struct filename *filename, const char __user *const __user *__argv, const char __user *const __user *__envp) { struct user_arg_ptr argv = { .ptr.native = __argv }; struct user_arg_ptr envp = { .ptr.native = __envp }; return do_execve_common(filename, argv, envp); } # ===== This breaks systemtap.base/pointer_array.exp testcase on newer f20 kernels.
Chances are this is related to https://bugzilla.redhat.com/show_bug.cgi?id=1126580
If you use a script like: probe f = kernel.function("do_execve"){} probe f.call, f.inline { println($$parms) } in pass-2 output you'll see: kernel.function("do_execve@fs/exec.c:1547").call /* pc=_stext+0x1edf38 */ /* <- kernel.function("do_execve@fs/exec.c:1547").call */ println(sprintf("filename=%#x __argv=%#x __envp=%#x", _dwarf_tvar_get_filename_0(), _dwarf_tvar_get___argv_1(), _dwarf_tvar_get___envp_2())) kernel.function("do_execve@fs/exec.c:1547").inline /* pc=_stext+0x1ee16f */ /* <- kernel.function("do_execve@fs/exec.c:1547").inline */ println(sprintf("__envp=? __argv=? filename=?")) So there's a full .call function which has all the parameters available, and an .inline instance which has none of them. (In reply to Frank Ch. Eigler from comment #1) > Chances are this is related to > https://bugzilla.redhat.com/show_bug.cgi?id=1126580 The producer string does indeed include -fno-var-tracking-assignments.
Very similar issue affecting at_var.exp. Old kernel: ===== # rpm -q systemtap; uname -r systemtap-2.7-1.mcermak.e454243.fc20.x86_64 3.13.9-200.fc20.x86_64 # cat systemtap.base/at_var.c #include <sys/time.h> struct foo { int bar; }; static struct foo foo; void sub(const char *file) { struct timeval times[2]; times[0].tv_sec = 1; times[0].tv_usec = 2; times[1].tv_sec = 3; times[1].tv_usec = 4; utimes (file, times); foo.bar -= 2; /* 40 */ } int main (int argc, char **argv) { foo.bar = 41 + argc; /* 42 */ sub(argv[0]); return 0; } # gcc -g systemtap.base/at_var.c # stap -e 'probe kernel.function("SYSC_utimes") {println($utimes$$, $utimes[1]$$, @var("utimes")$$, @var("utimes")[1]$$)}' -c ./a.out {.tv_sec=1, .tv_usec=2}{.tv_sec=3, .tv_usec=4}{.tv_sec=1, .tv_usec=2}{.tv_sec=3, .tv_usec=4} # ===== new kernel: ===== # rpm -q systemtap; uname -r systemtap-2.7-1.mcermak.e454243.fc20.x86_64 3.15.10-201.fc20.x86_64 # gcc -g systemtap.base/at_var.c # stap -e 'probe kernel.function("SYSC_utimes") {println($utimes$$, $utimes[1]$$, @var("utimes")$$, @var("utimes")[1]$$)}' -c ./a.out {.tv_sec=?, .tv_usec=?}{.tv_sec=?, .tv_usec=?}{.tv_sec=?, .tv_usec=?}{.tv_sec=?, .tv_usec=?} # =====
There is no systemtap bug here; the kernel compilation simply is slightly (mis)configured to lack full debuginfo.