When running the following sample command shown in systemtap's web site: # stap -vv -c df -e 'probe syscall.* { if (target()==pid()) log(name." ".argstr) }' I get to the following error: [...] probe sys_vmsplice@fs/splice.c:1475 kernel pc=0xc0000000000ddb74 probe sys_wait4@kernel/exit.c:1732 kernel pc=0xc0000000000514b0 probe sys_waitid@kernel/exit.c:1698 kernel pc=0xc0000000000514f0 probe sys_write@fs/read_write.c:376 kernel pc=0xc0000000000b5990 probe sys_writev@fs/read_write.c:686 kernel pc=0xc0000000000b53f8 probe compat_sys_writev@fs/compat.c:1165 kernel pc=0xc0000000000f14e0 semantic error: unable to find local 'arg' near pc 0xc0000000000efb84 (alternatives: cmd notused notused2): identifier '$arg' at /usr/local/share/systemtap/tapset/syscalls2.stp:66:56 Pass 2: analyzed script: 339 probe(s), 1007 function(s), 14 embed(s), 1 global(s) in 67440usr/680sys/70669real ms. Pass 2: analysis failed. Try again with more '-v' (verbose) options. This is on a PlayStation 3 running Fedora 8, systemtap's sources from the git repository (as of yesterday) and this kernel: Linux ps3k.gso.ac.upc.edu 2.6.24-rc3 #2 SMP Fri Nov 30 09:51:06 CET 2007 ppc64 ppc64 ppc64 GNU/Linux It was built by me and it does NOT have CONFIG_NFSD set in it. If I set this option in the kernel's configuration, the above command works correctly.
You must not have CONFIG_COMPAT set either, since the definition of syscall.nfsservctl looks like: probe syscall.nfsservctl = kernel.function("sys_nfsservctl") ?, kernel.function("compat_sys_nfsservctl") ? { name = "nfsservctl" cmd = $cmd argp_uaddr = $arg resp_uaddr = $res argstr = sprintf("%s, %p, %p", _nfsctl_cmd_str($cmd), $arg, $res) } I'm unsure how we could solve this, since we don't have access to the CONFIG_* defines at the probe level. We could grab the value of either CONFIG_NFSD or CONFIG_COMPAT in an embedded C function, but that doesn't help much.
Got another report about this. The problem comes from this part in fs/compat.c: #if defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE) [...] asmlinkage long compat_sys_nfsservctl(int cmd, struct compat_nfsctl_arg __user *arg, union compat_nfsctl_res __user *res) { [...] } #else /* !NFSD */ long asmlinkage compat_sys_nfsservctl(int cmd, void *notused, void *notused2) { return sys_ni_syscall(); } #endif So compat_sys_nfsservctl() has differently named arguments depending on whether or not NFSD is configured in. I also don't know a nice solution for this. But it breaks simple things like: stap -e 'probe syscall.* {printf("%s(%s)\n", probefunc(), argstr)}' -c 'echo' semantic error: unable to find local 'arg' near pc 0xffffffff802cce2f (alternatives: cmd notused notused2): identifier '$arg' at /usr/local/share/systemtap/tapset/syscalls2.stp:66:56 source: argstr = sprintf("%s, %p, %p", _nfsctl_cmd_str($cmd), $arg, $res)
(In reply to comment #1) ... > I'm unsure how we could solve this, since we don't have access to the CONFIG_* > defines at the probe level. We could grab the value of either CONFIG_NFSD or > CONFIG_COMPAT in an embedded C function, but that doesn't help much. We have access to the CONFIG_* since Frank's commit: 561079c PR10702: preprocessor conditional for kernel CONFIG_foo So it was really easy to fix this. Commit: b452838 PR5434: Fix syscall.nfsservctl.