summaryrefslogtreecommitdiffstats
path: root/tapset/aux_syscalls.stp
diff options
context:
space:
mode:
authorhunt <hunt>2007-07-03 21:43:20 +0000
committerhunt <hunt>2007-07-03 21:43:20 +0000
commit84cd02024b221fc66501d210a2790040ee4b14ff (patch)
tree48f7d3b8fad4a216ee35091f359427f2b062449f /tapset/aux_syscalls.stp
parent26bf6c22289654a8a132e324f6c4f1e032b5b85e (diff)
downloadsystemtap-steved-84cd02024b221fc66501d210a2790040ee4b14ff.tar.gz
systemtap-steved-84cd02024b221fc66501d210a2790040ee4b14ff.tar.xz
systemtap-steved-84cd02024b221fc66501d210a2790040ee4b14ff.zip
2007-07-03 Martin Hunt <hunt@redhat.com>
* syscalls.stp: Add sys_futimesat, compat_sys_futimesat. * syscalls2.stp (utimes): Use _struct_timeval2_u. * aux_syscalls.stp (_struct_timeval2_u): New function. (_struct_compat_timeval2_u): New function.
Diffstat (limited to 'tapset/aux_syscalls.stp')
-rw-r--r--tapset/aux_syscalls.stp34
1 files changed, 33 insertions, 1 deletions
diff --git a/tapset/aux_syscalls.stp b/tapset/aux_syscalls.stp
index d80139a4..708432c6 100644
--- a/tapset/aux_syscalls.stp
+++ b/tapset/aux_syscalls.stp
@@ -2,6 +2,22 @@
# Given a userspace pointer to a timeval,
# copy and decode it and return a string.
#
+function _struct_timeval2_u:string(uaddr:long)
+%{ /* pure */
+ struct timeval tv[2];
+ char *ptr = (char *)(unsigned long)THIS->uaddr;
+
+ if (ptr == NULL)
+ strlcpy (THIS->__retvalue, "NULL", MAXSTRINGLEN);
+ else {
+ if(_stp_copy_from_user((char*)&tv,ptr,2*sizeof(struct timeval)) == 0)
+ snprintf(THIS->__retvalue, MAXSTRINGLEN, "[%ld.%06ld][%ld.%.06ld]",
+ tv[0].tv_sec, tv[0].tv_usec, tv[1].tv_sec, tv[1].tv_usec);
+ else
+ strlcpy (THIS->__retvalue, "UNKNOWN", MAXSTRINGLEN);
+ }
+%}
+
function _struct_timeval_u:string(uaddr:long)
%{ /* pure */
struct timeval tv;
@@ -32,6 +48,22 @@ function _struct_compat_timeval_u:string(uaddr:long)
}
%}
+function _struct_compat_timeval2_u:string(uaddr:long)
+%{ /* pure */
+ struct timeval tv[2];
+ char *ptr = (char *)(unsigned long)THIS->uaddr;
+
+ if (ptr == NULL)
+ strlcpy (THIS->__retvalue, "NULL", MAXSTRINGLEN);
+ else {
+ if(_stp_copy_from_user((char*)&tv,ptr,2*sizeof(struct compat_timeval)) == 0)
+ snprintf(THIS->__retvalue, MAXSTRINGLEN, "[%ld.%06ld][%ld.%.06ld]",
+ tv[0].tv_sec, tv[0].tv_usec, tv[1].tv_sec, tv[1].tv_usec);
+ else
+ strlcpy (THIS->__retvalue, "UNKNOWN", MAXSTRINGLEN);
+ }
+%}
+
function _struct_timeval:string(addr:long)
%{ /* pure */
struct timeval *tv = (struct timeval *)(unsigned long)THIS->addr;
@@ -820,7 +852,7 @@ function _get_wc_str(wc) {
if(wc==3) return "CLOCK_THREAD_CPUTIME_ID"
if(wc==4) return "CLOCK_REALTIME_HR"
if(wc==5) return "CLOCK_MONOTONIC_HR"
- return ""
+ return "CLOCK_UNKNOWN"
}
function _flock_cmd_str(c) {