Skip to content

Commit

Permalink
Fix option --num-req (#71)
Browse files Browse the repository at this point in the history
* Fix option --num-req

* Add usage in doc of traceAnalyzer
  • Loading branch information
haochengxia authored Jul 5, 2024
1 parent 84a44b2 commit b77b659
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions doc/quickstart_traceAnalyzer.md
Original file line number Diff line number Diff line change
Expand Up @@ -256,3 +256,15 @@ The block workload has most objects being 4 KiB and 64 KiB, while the Twitter wo
The Request curve is weighted by request count, and the Object curve is weighted by object count.
</div>
<br> -->

### Advanced features
```bash
# cap the number of requests read from the trace
./traceAnalyzer --num-req=1000000 ../data/trace.vscsi vscsi

# change output
./traceAnalyzer -o my-output ../data/trace.vscsi vscsi

# use part of the trace to warm up the cache
./traceAnalyzer --warmup-sec=86400 ../data/trace.vscsi vscsi
```
4 changes: 2 additions & 2 deletions libCacheSim/bin/traceAnalyzer/cli_parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ static struct argp_option options[] = {
{"trace-type-params", OPTION_TRACE_TYPE_PARAMS,
"time-col=1,obj-id-col=2,obj-size-col=3,delimiter=,", 0,
"Parameters used for csv trace", 1},
{"num-req", OPTION_NUM_REQ, 0, 0,
{"num-req", OPTION_NUM_REQ, "-1", 0,
"Num of requests to process, default -1 means all requests in the trace",
1},

Expand Down Expand Up @@ -133,7 +133,7 @@ static error_t parse_opt(int key, char *arg, struct argp_state *state) {
strncpy(arguments->ofilepath, arg, OFILEPATH_LEN);
break;
case OPTION_NUM_REQ:
arguments->n_req = atoi(arg);
arguments->n_req = atoll(arg);
break;
case OPTION_TIME_WINDOW:
arguments->analysis_param.time_window = atoi(arg);
Expand Down

0 comments on commit b77b659

Please sign in to comment.