[patch] Bug #5001 - ctime() vs _stp_ctime() duplication

Mark Wielaard mwielaard@redhat.com
Tue May 20 20:57:00 GMT 2008


Hi,

There were two ctime like functions in the tapset, one tapset function
called ctime() and another (complete) embedded C function _stp_ctime.
They both had slightly different formats. This patch makes the two
syscall probes (utime and compat_utime) that used the _stp_ctime one use
the ctime one. This also changes the helper functions in
aux_syscalls.stp to just return the utimebuf struct field values instead
of doing the time string conversion itself (they used embedded C static
char[] buffers to do it, which isn't safe if a probe runs on different
processors at the same time).

Most functions in aux_syscalls.stp are actually of the same kind, they
inspect a struct in user space. It would be nice if there was a tapset
language structure for this.

Two tests were changed to expect the new (fuller) time string format.
This is a user visible change but it is unlikely anybody depended on the
old format. And it is good to have one and the same time string format
for everything now.

tapset/ChangeLog
2008-05-20  Mark Wielaard  <mwielaard@redhat.com>

    PR 5001
    * aux_syscalls.stp (_stp_ctime): Removed.
    (_struct_utimbuf_u): Removed.
    (_struct_compat_utimbuf_u): Removed.
    (_struct_utimbuf_actime): New function.
    (_struct_utimbuf_modtime): New function.
    (_struct_compat_utimbuf_actime): New function.
    (_struct_compat_utimbuf_modtime): New function.
    * syscalls2.stp (syscall.utime): Use new functions and ctime.
    (syscall.compat_utime): Likewise.

testsuite/ChangeLog
2008-05-20  Mark Wielaard  <mwielaard@redhat.com>

    PR 5001
    * systemtap.syscall/futimes.c (utime): Expect new time format.
    * systemtap.syscall/stat.c (utime): Likewise.

Let me know if this patch is ok, or can be improved.

Cheers,

Mark
-------------- next part --------------
A non-text attachment was scrubbed...
Name: duplicate-ctime.patch
Type: text/x-patch
Size: 6780 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/systemtap/attachments/20080520/5d390947/attachment.bin>


More information about the Systemtap mailing list