This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [patch] Bug #5001 - ctime() vs _stp_ctime() duplication
Hi,
On Wed, 2008-05-21 at 14:01 +0200, Mark Wielaard wrote:
> I am not sure how I should fix this. Is the idea that the arguments are
> now always referred to by number?
So, the patch makes it work also "dwarfless". If this doesn't show any
regressions on a full make installcheck I'll commit and push it. But I
don't really understand why the previous version worked. The only thing
I changed in my original patch is how the arguments were used, now how
they were fetched. If anybody has an explanation that would be
appreciated.
Thanks,
Mark
diff --git a/tapset/syscalls2.stp b/tapset/syscalls2.stp
index 31e1830..81d5f97 100644
--- a/tapset/syscalls2.stp
+++ b/tapset/syscalls2.stp
@@ -2897,12 +2897,12 @@ probe syscall.ustat.return =
# long sys_utime(char __user * filename, struct utimbuf __user * times)
probe syscall.utime = kernel.function("sys_utime") ? {
name = "utime"
- filename_uaddr = $filename
- filename = user_string($filename)
- buf_uaddr = $times
+ filename_uaddr = pointer_arg(1)
+ filename = user_string_quoted(filename_uaddr)
+ buf_uaddr = pointer_arg(2)
actime = _struct_utimbuf_actime(buf_uaddr)
modtime = _struct_utimbuf_modtime(buf_uaddr)
- argstr = sprintf("%s, [%s, %s]", user_string_quoted($filename),
+ argstr = sprintf("%s, [%s, %s]", filename,
ctime(actime), ctime(modtime))
}
probe syscall.utime.return = kernel.function("sys_utime").return ? {
@@ -2913,12 +2913,12 @@ probe syscall.utime.return = kernel.function("sys_utime").return ? {
# long compat_sys_utime(char __user *filename, struct compat_utimbuf __user *t)
probe syscall.compat_utime = kernel.function("compat_sys_utime") ? {
name = "utime"
- filename_uaddr = $filename
- filename = user_string($filename)
- buf_uaddr = $t
+ filename_uaddr = pointer_arg(1)
+ filename = user_string_quoted(filename_uaddr)
+ buf_uaddr = pointer_arg(2)
actime = _struct_compat_utimbuf_actime(buf_uaddr)
modtime = _struct_compat_utimbuf_modtime(buf_uaddr)
- argstr = sprintf("%s, [%s, %s]", user_string_quoted($filename),
+ argstr = sprintf("%s, [%s, %s]", filename,
ctime(actime), ctime(modtime))
}
probe syscall.compat_utime.return = kernel.function("compat_sys_utime").return ? {