Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-12-05 19:39:06 +0300
committerChristopher Faylor <me@cgf.cx>2005-12-05 19:39:06 +0300
commit801d6cc7532a6f419c3553c4180820db6540f263 (patch)
tree8fa1a29dbe6cc1b3b0d91cc453979ddd80aa4846 /winsup/utils/strace.cc
parenta7dc05b5d1d9fcb634059f0e1fbd848869b53caa (diff)
* strace.cc (show_usecs): Renamed from 'usecs'.
(main): Use show_usecs rather than usecs. Toggle delta if '-u' is specified. (handle_output_debug_string): Avoid printing microsecond timestamp if show_usecs == 0. * utils.sgml (strace): Add words to describe '-u'.
Diffstat (limited to 'winsup/utils/strace.cc')
-rw-r--r--winsup/utils/strace.cc10
1 files changed, 6 insertions, 4 deletions
diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc
index 1bd54ced0..3a34b31ba 100644
--- a/winsup/utils/strace.cc
+++ b/winsup/utils/strace.cc
@@ -35,7 +35,7 @@ static const char version[] = "$Revision$";
static const char *pgm;
static int forkdebug = 1;
static int numerror = 1;
-static int usecs = 1;
+static int show_usecs = 1;
static int delta = 1;
static int hhmmss = 0;
static int bufsize = 0;
@@ -381,7 +381,7 @@ syst (long long t)
{
FILETIME n;
static SYSTEMTIME st;
- long long now = t + ((long long) usecs * 10);
+ long long now = t /*+ ((long long) usecs * 10)*/;
n.dwHighDateTime = now >> 32;
n.dwLowDateTime = now & 0xffffffff;
FileTimeToSystemTime (&n, &st);
@@ -475,7 +475,7 @@ handle_output_debug_string (DWORD id, LPVOID p, unsigned mask, FILE *ofile)
else
{
ptrest = q;
- ptusec = s;
+ ptusec = show_usecs ? s : ptrest;
usecs = dusecs;
}
@@ -817,6 +817,7 @@ Trace system calls and signals\n\
the default microsecond timestamp. Implies -d\n\
-T, --toggle toggle tracing in a process already being\n\
traced. Requires -p <pid>\n\
+ -u, --usecs toggle printing of microseconds timestamp\n\
-v, --version output version information and exit\n\
-w, --new-window spawn program under test in a new window\n\
\n", pgm, pgm);
@@ -974,7 +975,8 @@ character #%d.\n", optarg, (int) (endptr - optarg), endptr);
break;
case 'u':
// FIXME: currently unimplemented
- usecs ^= 1;
+ show_usecs ^= 1;
+ delta ^= 1;
break;
case 'v':
// Print version info and exit