From 3272d2902c6f3e64d26cf459ca0a5ee17181f792 Mon Sep 17 00:00:00 2001 From: Elvira Khabirova Date: Thu, 26 Nov 2015 06:25:12 +0300 Subject: [PATCH] Rearrange flags descriptions in the usage text * strace.c (usage): Rearrange descriptions. * tests/strace-k.test: Change the option detecting regexp accordingly. --- strace.c | 91 +++++++++++++++++++++++++++------------------ tests/strace-k.test | 2 +- 2 files changed, 55 insertions(+), 38 deletions(-) diff --git a/strace.c b/strace.c index b2b82e3d..f2c42155 100644 --- a/strace.c +++ b/strace.c @@ -199,48 +199,65 @@ static void usage(FILE *ofp, int exitval) { fprintf(ofp, "\ -usage: strace [-CdffhiqrtttTvVxxy] [-I n] [-e expr]...\n\ +usage: strace [-CdffhiqrtttTvVwxxy] [-I n] [-e expr]...\n\ [-a column] [-o file] [-s strsize] [-P path]...\n\ -p pid... / [-D] [-E var=val]... [-u username] PROG [ARGS]\n\ - or: strace -c[df] [-I n] [-e expr]... [-O overhead] [-S sortby]\n\ + or: strace -c[dfw] [-I n] [-e expr]... [-O overhead] [-S sortby]\n\ -p pid... / [-D] [-E var=val]... [-u username] PROG [ARGS]\n\ --c -- count time, calls, and errors for each syscall and report summary\n\ --C -- like -c but also print regular output\n\ --w -- summarise syscall latency (default is system time)\n\ --d -- enable debug output to stderr\n\ --D -- run tracer process as a detached grandchild, not as parent\n\ --f -- follow forks, -ff -- with output into separate files\n\ --i -- print instruction pointer at time of syscall\n\ --q -- suppress messages about attaching, detaching, etc.\n\ --r -- print relative timestamp, -t -- absolute timestamp, -tt -- with usecs\n\ --T -- print time spent in each syscall\n\ --v -- verbose mode: print unabbreviated argv, stat, termios, etc. args\n\ --x -- print non-ascii strings in hex, -xx -- print all strings in hex\n\ --y -- print paths associated with file descriptor arguments\n\ --yy -- print ip:port pairs associated with socket file descriptors\n\ --h -- print help message, -V -- print version\n\ --a column -- alignment COLUMN for printing syscall results (default %d)\n\ --b execve -- detach on this syscall\n\ --e expr -- a qualifying expression: option=[!]all or option=[!]val1[,val2]...\n\ - options: trace, abbrev, verbose, raw, signal, read, write\n\ --I interruptible --\n\ - 1: no signals are blocked\n\ - 2: fatal signals are blocked while decoding syscall (default)\n\ - 3: fatal signals are always blocked (default if '-o FILE PROG')\n\ - 4: fatal signals and SIGTSTP (^Z) are always blocked\n\ - (useful to make 'strace -o FILE PROG' not stop on ^Z)\n\ --o file -- send trace output to FILE instead of stderr\n\ --O overhead -- set overhead for tracing syscalls to OVERHEAD usecs\n\ --p pid -- trace process with process id PID, may be repeated\n\ --s strsize -- limit length of print strings to STRSIZE chars (default %d)\n\ --S sortby -- sort syscall counts by: time, calls, name, nothing (default %s)\n\ --u username -- run command as username handling setuid and/or setgid\n\ --E var=val -- put var=val in the environment for command\n\ --E var -- remove var from the environment for command\n\ --P path -- trace accesses to path\n\ +\n\ +Output format:\n\ + -a column alignment COLUMN for printing syscall results (default %d)\n\ + -i print instruction pointer at time of syscall\n\ + -o file send trace output to FILE instead of stderr\n\ + -q suppress messages about attaching, detaching, etc.\n\ + -r print relative timestamp\n\ + -s strsize limit length of print strings to STRSIZE chars (default %d)\n\ + -t print absolute timestamp\n\ + -tt print absolute timestamp with usecs\n\ + -T print time spent in each syscall\n\ + -x print non-ascii strings in hex\n\ + -xx print all strings in hex\n\ + -y print paths associated with file descriptor arguments\n\ + -yy print ip:port pairs associated with socket file descriptors\n\ +\n\ +Statistics:\n\ + -c count time, calls, and errors for each syscall and report summary\n\ + -C like -c but also print regular output\n\ + -O overhead set overhead for tracing syscalls to OVERHEAD usecs\n\ + -S sortby sort syscall counts by: time, calls, name, nothing (default %s)\n\ + -w summarise syscall latency (default is system time)\n\ +\n\ +Filtering:\n\ + -e expr a qualifying expression: option=[!]all or option=[!]val1[,val2]...\n\ + options: trace, abbrev, verbose, raw, signal, read, write\n\ + -P path trace accesses to path\n\ +\n\ +Tracing:\n\ + -b execve detach on execve syscall\n\ + -D run tracer process as a detached grandchild, not as parent\n\ + -f follow forks\n\ + -ff follow forks with output into separate files\n\ + -I interruptible\n\ + 1: no signals are blocked\n\ + 2: fatal signals are blocked while decoding syscall (default)\n\ + 3: fatal signals are always blocked (default if '-o FILE PROG')\n\ + 4: fatal signals and SIGTSTP (^Z) are always blocked\n\ + (useful to make 'strace -o FILE PROG' not stop on ^Z)\n\ +\n\ +Startup:\n\ + -E var remove var from the environment for command\n\ + -E var=val put var=val in the environment for command\n\ + -p pid trace process with process id PID, may be repeated\n\ + -u username run command as username handling setuid and/or setgid\n\ +\n\ +Miscellaneous:\n\ + -d enable debug output to stderr\n\ + -v verbose mode: print unabbreviated argv, stat, termios, etc. args\n\ + -h print help message\n\ + -V print version\n\ " #ifdef USE_LIBUNWIND -"-k obtain stack trace between each syscall (experimental)\n\ +" -k obtain stack trace between each syscall (experimental)\n\ " #endif /* ancient, no one should use it diff --git a/tests/strace-k.test b/tests/strace-k.test index 90d56dc2..458d58bd 100755 --- a/tests/strace-k.test +++ b/tests/strace-k.test @@ -4,7 +4,7 @@ . "${srcdir=.}/init.sh" -$STRACE -h | grep '^-k' > /dev/null || +$STRACE -h | grep '^[[:space:]]*-k[[:space:]]' > /dev/null || skip_ 'strace -k is not available' # strace -k is implemented using /proc/$pid/maps -- 2.40.0