From 471f6abd3600cb3b4bff6a217726d7e8cce7d713 Mon Sep 17 00:00:00 2001 From: amdn Date: Tue, 28 May 2019 17:51:41 -0500 Subject: [PATCH] Remove -u short form, use only --utc (code review) --- man/man8/exitsnoop.8 | 6 +++--- tools/exitsnoop.py | 4 ++-- tools/exitsnoop_example.txt | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/man/man8/exitsnoop.8 b/man/man8/exitsnoop.8 index 1fc29d5ad836..fb1942b4202f 100644 --- a/man/man8/exitsnoop.8 +++ b/man/man8/exitsnoop.8 @@ -2,7 +2,7 @@ .SH NAME exitsnoop \- Trace all process termination (exit, fatal signal). Uses Linux eBPF/bcc. .SH SYNOPSIS -.B exitsnoop [\-h] [\-t] [\-u] [\-x] [\-p PID] [\-\-label LABEL] +.B exitsnoop [\-h] [\-t] [\-\-utc] [\-x] [\-p PID] [\-\-label LABEL] .SH DESCRIPTION exitsnoop traces process termination, showing the command name and reason for termination, either an exit or a fatal signal. @@ -24,7 +24,7 @@ Print usage message. \-t Include a timestamp column. .TP -\-u +\-\-utc Include a timestamp column, use UTC timezone. .TP \-x @@ -60,7 +60,7 @@ Label each output line with 'EXIT': .TP TIME-TZ Time of process termination HH:MM:SS.sss with milliseconds, where TZ is -the local time zone, 'UTC' with \-u option. +the local time zone, 'UTC' with \-\-utc option. .TP LABEL The optional label if \-\-label option is used. This is useful with the diff --git a/tools/exitsnoop.py b/tools/exitsnoop.py index 0209e0d6b6c6..13a1444c5c84 100755 --- a/tools/exitsnoop.py +++ b/tools/exitsnoop.py @@ -24,7 +24,7 @@ exitsnoop # trace all process termination exitsnoop -x # trace only fails, exclude exit(0) exitsnoop -t # include timestamps (local time) - exitsnoop -u # include timestamps (UTC) + exitsnoop --utc # include timestamps (UTC) exitsnoop -p 181 # only trace PID 181 exitsnoop --label=exit # label each output line with 'exit' """ @@ -58,7 +58,7 @@ def _getParser(): epilog=_examples) a=parser.add_argument a("-t", "--timestamp", action="store_true", help="include timestamp (local time default)") - a("-u", "--utc", action="store_true", help="include timestamp in UTC (-t implied)") + a("--utc", action="store_true", help="include timestamp in UTC (-t implied)") a("-p", "--pid", help="trace this PID only") a("--label", help="label each line") a("-x", "--failed", action="store_true", help="trace only fails, exclude exit(0)") diff --git a/tools/exitsnoop_example.txt b/tools/exitsnoop_example.txt index facf8e5789d9..3a322dc15df0 100644 --- a/tools/exitsnoop_example.txt +++ b/tools/exitsnoop_example.txt @@ -37,7 +37,7 @@ of the process with hundredth of a second resolution, and the reason for the process exit (EXIT_CODE). A -t option can be used to include a timestamp column, it shows local time -by default. The -u option shows the time in UTC. The --label +by default. The --utc option shows the time in UTC. The --label option adds a column indicating the tool that generated the output, 'exit' by default. If other tools follow this format their outputs can be merged into a single trace with a simple lexical sort @@ -46,12 +46,12 @@ e.g. 'exec', 'open', 'exit', etc. Time is displayed with millisecond resolution. The -x option will show only non-zero exits and fatal signals, which excludes processes that exit with 0 code: -# ./exitsnoop.py -t -u -x --label= > exitlog & +# ./exitsnoop.py -t --utc -x --label= > exitlog & [1] 18289 # for((i=65;i<100;i+=5)); do bash -c "sleep 1.$i;exit $i"; done ^C # fg -./exitsnoop.py -t -u -x --label= > exitlog +./exitsnoop.py -t --utc -x --label= > exitlog ^C # cat exitlog TIME-UTC LABEL PCOMM PID PPID TID AGE(s) EXIT_CODE @@ -67,14 +67,14 @@ TIME-UTC LABEL PCOMM PID PPID TID AGE(s) EXIT_CODE USAGE message: # ./exitsnoop.py -h -usage: exitsnoop.py [-h] [-t] [-u] [-p PID] [--label LABEL] [-x] +usage: exitsnoop.py [-h] [-t] [--utc] [-p PID] [--label LABEL] [-x] Trace all process termination (exit, fatal signal) optional arguments: -h, --help show this help message and exit -t, --timestamp include timestamp (local time default) - -u, --utc include timestamp in UTC (-t implied) + --utc include timestamp in UTC (-t implied) -p PID, --pid PID trace this PID only --label LABEL label each line -x, --failed trace only fails, exclude exit(0) @@ -83,7 +83,7 @@ examples: exitsnoop # trace all process termination exitsnoop -x # trace only fails, exclude exit(0) exitsnoop -t # include timestamps (local time) - exitsnoop -u # include timestamps (UTC) + exitsnoop --utc # include timestamps (UTC) exitsnoop -p 181 # only trace PID 181 exitsnoop --label=exit # label each output line with 'exit'