tools: acrntrace: Change option -t to -i

Option -i is more suitable for interval. Meanwhile, we will use option -t for
timeout in later patch.

Signed-off-by: Kaige Fu <kaige.fu@intel.com>
Reviewed-by: Eddie Dong <eddie.dong@intel.com>
Reviewed-by: Geoffroy Van Cutsem <geoffroy.vancutsem@intel.com>
This commit is contained in:
Kaige Fu 2018-07-02 10:31:50 +08:00 committed by lijinxia
parent b04e799b31
commit 5042ba6009
2 changed files with 6 additions and 6 deletions

View File

@ -18,7 +18,7 @@ output to trace file under ``/tmp/acrntrace`` with raw (binary) data format.
Options: Options:
-h print this message -h print this message
-t period specify polling interval in milliseconds [1-999] -i period specify polling interval in milliseconds [1-999]
-c clear the buffered old data -c clear the buffered old data
-r minimal amount (in MB) of free space kept on the disk -r minimal amount (in MB) of free space kept on the disk
before acrntrace stops before acrntrace stops

View File

@ -24,7 +24,7 @@ static int exiting = 0;
/* for opt */ /* for opt */
static uint64_t period = 10000; static uint64_t period = 10000;
static const char optString[] = "t:hcr:"; static const char optString[] = "i:hcr:";
static const char dev_name[] = "/dev/acrn_trace"; static const char dev_name[] = "/dev/acrn_trace";
static uint32_t flags; static uint32_t flags;
@ -36,12 +36,12 @@ static int pcpu_num = 0;
static void display_usage(void) static void display_usage(void)
{ {
printf("acrntrace - tool to collect ACRN trace data\n" printf("acrntrace - tool to collect ACRN trace data\n"
"[Usage] acrntrace [-t] [period in msec] [-ch]\n\n" "[Usage] acrntrace [-i] [period in msec] [-ch]\n\n"
"[Options]\n" "[Options]\n"
"\t-h: print this message\n" "\t-h: print this message\n"
"\t-r: minimal amount (in MB) of free space kept on the disk\n" "\t-r: minimal amount (in MB) of free space kept on the disk\n"
"\t before acrntrace stops\n" "\t before acrntrace stops\n"
"\t-t: period_in_ms: specify polling interval [1-999]\n" "\t-i: period_in_ms: specify polling interval [1-999]\n"
"\t-c: clear the buffered old data\n"); "\t-c: clear the buffered old data\n");
} }
@ -51,10 +51,10 @@ static int parse_opt(int argc, char *argv[])
while ((opt = getopt(argc, argv, optString)) != -1) { while ((opt = getopt(argc, argv, optString)) != -1) {
switch (opt) { switch (opt) {
case 't': case 'i':
ret = atoi(optarg); ret = atoi(optarg);
if (ret <= 0 || ret >=1000) { if (ret <= 0 || ret >=1000) {
pr_err("'-t' require integer between [1-999]\n"); pr_err("'-i' require integer between [1-999]\n");
return -EINVAL; return -EINVAL;
} }
period = ret * 1000; period = ret * 1000;