Allow setting the lock back limit in ovnisort
This commit is contained in:
parent
a04fc71ae9
commit
f35741bac7
@ -49,7 +49,7 @@ enum operation_mode { SORT,
|
||||
|
||||
static char *tracedir = NULL;
|
||||
static enum operation_mode operation_mode = SORT;
|
||||
static const size_t max_look_back = 1000000;
|
||||
static size_t max_look_back = 1000000;
|
||||
|
||||
static void
|
||||
ring_reset(struct ring *r)
|
||||
@ -404,6 +404,9 @@ usage(void)
|
||||
rerr(" -c Enable check mode: don't sort, ensure the\n");
|
||||
rerr(" trace is already sorted.\n");
|
||||
rerr("\n");
|
||||
rerr(" -n Set the number of events to look back.\n");
|
||||
rerr(" Defaul: %ld\n", max_look_back);
|
||||
rerr("\n");
|
||||
rerr(" tracedir The trace directory generated by ovni.\n");
|
||||
rerr("\n");
|
||||
|
||||
@ -415,11 +418,14 @@ parse_args(int argc, char *argv[])
|
||||
{
|
||||
int opt;
|
||||
|
||||
while ((opt = getopt(argc, argv, "c")) != -1) {
|
||||
while ((opt = getopt(argc, argv, "cn:")) != -1) {
|
||||
switch (opt) {
|
||||
case 'c':
|
||||
operation_mode = CHECK;
|
||||
break;
|
||||
case 'n':
|
||||
max_look_back = atol(optarg);
|
||||
break;
|
||||
default: /* '?' */
|
||||
usage();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user