|
1 | | -## FAQ |
2 | | -1. **how to read OracleGeneral trace,how to transform from csv to it? ** |
3 | | -The [oracleGeneral](/libCacheSim/traceReader/customizedReader/oracle/oracleGeneralBin.h) trace is a binary trace, so you cannot direct read as txt file. Each request uses the following data struct |
| 1 | +# FAQ |
| 2 | + |
| 3 | +### How do I read an oracleGeneral trace, and how do I convert a csv trace into one? |
| 4 | + |
| 5 | +The [oracleGeneral](/libCacheSim/traceReader/customizedReader/oracle/oracleGeneralBin.h) trace is a binary format, so it cannot be read as a text file. Each request is the following struct: |
| 6 | + |
4 | 7 | ```c |
5 | 8 | struct { |
6 | | - uint32_t real_time; |
| 9 | + uint32_t clock_time; |
7 | 10 | uint64_t obj_id; |
8 | 11 | uint32_t obj_size; |
9 | | - int64_t next_access_vtime; |
| 12 | + int64_t next_access_vtime; // -1 if there is no next access |
10 | 13 | }; |
11 | 14 | ``` |
12 | 15 |
|
13 | | -* Read the trace: we have provided a tool `tracePrint` that you can use to print the trace in plain text, it is compiled and under `bin/` |
14 | | -* Convert csv to oracleGeneral: we have provided `traceConv` to convert traces. The help menu should be sufficient to get started. |
| 16 | +* **Read the trace**: use `tracePrint` to print the trace as plain text. It is built into `bin/` alongside `cachesim`. |
| 17 | + ```bash |
| 18 | + ./bin/tracePrint ../data/cloudPhysicsIO.oracleGeneral.bin oracleGeneral |
| 19 | + ``` |
| 20 | +* **Convert a csv trace**: use `traceConv`. See [quickstart_traceUtils.md](/doc/quickstart_traceUtils.md), or run `./bin/traceConv --help`. |
| 21 | + ```bash |
| 22 | + ./bin/traceConv ../data/cloudPhysicsIO.csv csv \ |
| 23 | + -t "time-col=2,obj-id-col=5,obj-size-col=4,obj-id-is-num=1" \ |
| 24 | + --output-format=oracleGeneral |
| 25 | + ``` |
| 26 | + |
| 27 | +oracleGeneral traces are usually stored zstd-compressed, and libCacheSim reads them without decompressing first. |
| 28 | + |
| 29 | +### What are the units in a trace? |
| 30 | + |
| 31 | +In the sample [cloudPhysicsIO.csv](/data/cloudPhysicsIO.csv), time is in seconds and object size is in bytes. |
| 32 | + |
| 33 | +`next_access_vtime` is a *logical* time: the number of requests between the current request and the next request to the same object, or `-1` when the object is never accessed again. Algorithms that need future information, such as [Belady](/libCacheSim/cache/eviction/Belady.c) and BeladySize, rely on it, which is why they only work on oracle traces. |
| 34 | + |
| 35 | +Object ids are hashed unless the reader is told they are already numeric. Pass `obj-id-is-num=true` in `--trace-type-params` when the id column holds numbers — `cachesim` stops with an error if you leave it out on such a trace. |
| 36 | + |
| 37 | +### Why does `cachesim` say "do not support algorithm X"? |
| 38 | + |
| 39 | +Some algorithms are behind an optional build flag because they pull in extra dependencies: GLCache (`-DENABLE_GLCACHE=ON`), LRB (`-DENABLE_LRB=ON`), and 3LCache (`-DENABLE_3L_CACHE=ON`). Rebuild with the relevant flag to enable them. See the [README](/README.md#supported-algorithms) for the full list. |
| 40 | + |
| 41 | +### Where can I get larger traces? |
| 42 | + |
| 43 | +The traces in [data/](/data/) are samples and are **far too small to compare miss ratios between algorithms**. We maintain a list of open-source cache datasets at [cacheMon/cache_dataset](https://github.com/cacheMon/cache_dataset). |
| 44 | + |
| 45 | +--- |
15 | 46 |
|
16 | | -2. **What are the units in the trace? ** |
17 | | -In the [trace.csv](/data/trace.csv), the time unit is in sec, the next_access_time is the logical time (# requests) between current and the next request (to the same object). The next access time is used by some algorithms that require future information, e.g., Belady. The object id is a hash of raw object id (string or numeric value). |
| 47 | +More questions? Check the [documentation index](/doc/README.md), search the [issue tracker](https://github.com/1a1a11a/libCacheSim/issues), or ask in [Discussions](https://github.com/1a1a11a/libCacheSim/discussions). |
0 commit comments