diff options
author | Pav Lucistnik <pav@FreeBSD.org> | 2006-05-15 21:18:28 +0000 |
---|---|---|
committer | Pav Lucistnik <pav@FreeBSD.org> | 2006-05-15 21:18:28 +0000 |
commit | 081e5c4890341d92b593510630f5c6be67fa50ae (patch) | |
tree | bc8d8d905841a0fb10ed22ce3afee50b7fefe6a5 /usr.bin/truss/main.c | |
parent | c46cb391cb3a22a1f7137f139a17d020d2834f49 (diff) |
- Add decoding of kse_release, kevent, sigprocmask, unmount, socket, getrusage,
rename, __getcwd, shutdown, getrlimit, setrlimit, _umtx_lock, _umtx_unlock,
pathconf, truncate, ftruncate, kill
- Decode more arguments of open, mprot, *stat, and fcntl.
- Convert all constant-macro and bitfield decoding to lookup tables; much
cleaner than previous code.
- Print the timestamp of process exit and signal reception when -d or -D are in
use
- Try six times with 1/2 second delay to debug the child
PR: bin/52190 (updated)
Submitted by: Dan Nelson <dnelson@allantgroup.com>
Approved by: alfred
Notes
Notes:
svn path=/head/; revision=158630
Diffstat (limited to 'usr.bin/truss/main.c')
-rw-r--r-- | usr.bin/truss/main.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/usr.bin/truss/main.c b/usr.bin/truss/main.c index 34c4e7a175c0..209644277198 100644 --- a/usr.bin/truss/main.c +++ b/usr.bin/truss/main.c @@ -279,6 +279,7 @@ START_TRACE: do { int val = 0; + struct timespec timediff; if (ioctl(Procfd, PIOCWAIT, &pfs) == -1) warn("PIOCWAIT top of loop"); @@ -328,6 +329,23 @@ START_TRACE: funcs->exit_syscall(trussinfo, pfs.val); break; case S_SIG: + if (trussinfo->flags & FOLLOWFORKS) + fprintf(trussinfo->outfile, "%5d: ", + trussinfo->pid); + if (trussinfo->flags & ABSOLUTETIMESTAMPS) { + timespecsubt(&trussinfo->after, + &trussinfo->start_time, &timediff); + fprintf(trussinfo->outfile, "%ld.%09ld ", + (long)timediff.tv_sec, + timediff.tv_nsec); + } + if (trussinfo->flags & RELATIVETIMESTAMPS) { + timespecsubt(&trussinfo->after, + &trussinfo->before, &timediff); + fprintf(trussinfo->outfile, "%ld.%09ld ", + (long)timediff.tv_sec, + timediff.tv_nsec); + } signame = strsig(pfs.val); fprintf(trussinfo->outfile, "SIGNAL %lu (%s)\n", pfs.val, @@ -336,6 +354,22 @@ START_TRACE: sigexit = pfs.val; break; case S_EXIT: + if (trussinfo->flags & FOLLOWFORKS) + fprintf(trussinfo->outfile, "%5d: ", + trussinfo->pid); + if (trussinfo->flags & ABSOLUTETIMESTAMPS) { + timespecsubt(&trussinfo->after, + &trussinfo->start_time, &timediff); + fprintf(trussinfo->outfile, "%ld.%09ld ", + (long)timediff.tv_sec, + timediff.tv_nsec); + } + if (trussinfo->flags & RELATIVETIMESTAMPS) { + timespecsubt(&trussinfo->after, + &trussinfo->before, &timediff); + fprintf(trussinfo->outfile, "%ld.%09ld ", + (long)timediff.tv_sec, timediff.tv_nsec); + } fprintf(trussinfo->outfile, "process exit, rval = %lu\n", pfs.val); break; |