This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: Analysis of broken systemtap example scripts
Hi -
> [....]
> probe syscall.openat.return {
> filename = @entry(user_string_quoted(pointer_arg(2)))
> printf("%s %s (%x) %s\n", proc(), pp(), @entry(pointer_arg(2)), filename)
> }
> However, running the same script on a newer fedora kernel:
> [wcohen@cervelo io]$ stap open_args.stp -T 1
> 1335 (libvirtd) kprobe.function("__x64_sys_openat")? (7f331f4b66e0) "/sys/devices/system/node/node0/meminfo"
> [...]
Yes, this is expected, because @entry() expressions are evaluated at
synthetic probes at function. The syscall.* probes for 4.17+ work by
first processing the incoming pt_regs pointer from a parameter. The
@entry() part misses this step, so cannot work.
So, both @entry($var) and $var in syscall.*.return are not generally
available any more. We'll improve @entry() to generalize to this sort
of situation, but in the mean time, user and samples will have to fend
for themselves with explicit globals etc.
- FChE