From 5042ba6009216337f50a659d691c1d962eee38da Mon Sep 17 00:00:00 2001 From: Kaige Fu Date: Mon, 2 Jul 2018 10:31:50 +0800 Subject: [PATCH] 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 Reviewed-by: Eddie Dong Reviewed-by: Geoffroy Van Cutsem --- tools/acrntrace/README.rst | 2 +- tools/acrntrace/acrntrace.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/acrntrace/README.rst b/tools/acrntrace/README.rst index f7bf2de2e..4ef9c9262 100644 --- a/tools/acrntrace/README.rst +++ b/tools/acrntrace/README.rst @@ -18,7 +18,7 @@ output to trace file under ``/tmp/acrntrace`` with raw (binary) data format. Options: -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 -r minimal amount (in MB) of free space kept on the disk before acrntrace stops diff --git a/tools/acrntrace/acrntrace.c b/tools/acrntrace/acrntrace.c index d556d824c..0038a3bbb 100644 --- a/tools/acrntrace/acrntrace.c +++ b/tools/acrntrace/acrntrace.c @@ -24,7 +24,7 @@ static int exiting = 0; /* for opt */ 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 uint32_t flags; @@ -36,12 +36,12 @@ static int pcpu_num = 0; static void display_usage(void) { 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" "\t-h: print this message\n" "\t-r: minimal amount (in MB) of free space kept on the disk\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"); } @@ -51,10 +51,10 @@ static int parse_opt(int argc, char *argv[]) while ((opt = getopt(argc, argv, optString)) != -1) { switch (opt) { - case 't': + case 'i': ret = atoi(optarg); 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; } period = ret * 1000;