Skip to content

Commit

Permalink
minor updates
Browse files Browse the repository at this point in the history
update documentation of traceConv;
add better description in Belady algorithm
  • Loading branch information
1a1a11a committed Mar 17, 2024
1 parent 3080f2c commit 0252dcf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
11 changes: 6 additions & 5 deletions doc/quickstart_traceUtils.md
Expand Up @@ -7,21 +7,22 @@ Print requests from a trace.

```bash
# print 10 requests from a trace
./tracePrint ../data/trace.vscsi vscsi -n 10
./bin/tracePrint ../data/cloudPhysicsIO.vscsi vscsi -n 10
```

### traceConv
Convert a trace to libCacheSim format so it has a smaller size, contains next request time (oracle information) and runs faster.
Convert a trace to oracleGeneral format so you can run it faster (10x speedup) using less memory. Meanwhile, the generated trace has a smaller size, contains next request time.
```bash
./traceConv ../data/trace.vscsi vscsi ../data/trace.vscsi.bin
# the first parameter is the input trace, the second parameter is trace type, the third parameter is the output trace path
./bin/traceConv ../data/cloudPhysicsIO.txt txt cloudPhysicsIO.oracleGeneral.bin
```
Note that the conversion supports all trace types including csv trace. Note that if the object id is numeric, add the option -e `obj_id_is_num=1` to the command line, which reduces memory usage.
Note that the conversion supports all trace types including csv trace. Moreover, if the object id is numeric, add the option `-e obj_id_is_num=1` to the command line, which reduces memory usage.


We can also sample a trace to reduce the size of the trace.
```bash
# sample 1% of the trace
./traceConv ../data/trace.vscsi vscsi ../data/trace.vscsi.bin -s 0.01
./bin/traceConv ../data/cloudPhysicsIO.vscsi vscsi ../data/cloudPhysicsIO.oracleGeneral -s 0.01
```


Expand Down
4 changes: 4 additions & 0 deletions libCacheSim/bin/cachesim/cache_init.h
Expand Up @@ -87,6 +87,10 @@ static inline cache_t *create_cache(const char *trace_path,
} else if (strcasecmp(eviction_algo, "belady") == 0) {
if (strcasestr(trace_path, "oracleGeneral") == NULL) {
WARN("belady is only supported for oracleGeneral trace\n");
WARN("to convert a trace to oracleGeneral format\n");
WARN("./bin/traceConv input_trace trace_format output_trace\n");
WARN("./bin/traceConv ../data/cloudPhysicsIO.txt txt cloudPhysicsIO.oracleGeneral.bin\n");
exit(1);
}
cache = Belady_init(cc_params, eviction_params);
} else if (strcasecmp(eviction_algo, "nop") == 0) {
Expand Down

0 comments on commit 0252dcf

Please sign in to comment.