Skip to content

Commit

Permalink
tools: acrntrace: Change option -t to -i
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
KaigeFu authored and lijinxia committed Jul 6, 2018
1 parent b04e799 commit 5042ba6
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion tools/acrntrace/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 5 additions & 5 deletions tools/acrntrace/acrntrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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");
}

Expand All @@ -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;
Expand Down

0 comments on commit 5042ba6

Please sign in to comment.