diff --git a/doc/quickstart_traceAnalyzer.md b/doc/quickstart_traceAnalyzer.md index a72e17c32..a6c78ce61 100644 --- a/doc/quickstart_traceAnalyzer.md +++ b/doc/quickstart_traceAnalyzer.md @@ -54,10 +54,7 @@ The basic form is: | `--reuse` | Reuse time and reuse distance distribution, overall and over time | [reuse.py](/scripts/traceAnalysis/reuse.py), [reuse_heatmap.py](/scripts/traceAnalysis/reuse_heatmap.py) | | `--popularity` | Request count of each object, by rank | [popularity.py](/scripts/traceAnalysis/popularity.py) | | `--accessPattern` | A sample of which objects are accessed when | [access_pattern.py](/scripts/traceAnalysis/access_pattern.py) | -| `--popularityDacay` | How an object's popularity fades with age | [popularity_decay.py](/scripts/traceAnalysis/popularity_decay.py) | - -> [!NOTE] -> The popularity decay flag really is spelled `--popularityDacay`. That is a typo in the code. `--popularityDecay` is rejected as an unrecognized option. +| `--popularityDecay` | How an object's popularity fades with age | [popularity_decay.py](/scripts/traceAnalysis/popularity_decay.py) | Run `./bin/traceAnalyzer --help` for the full list of tasks and options. @@ -250,7 +247,7 @@ Pass these two scripts the base name, without the `_req`/`_obj` or `_rt`/`_vt` s This shows how likely an object is to be requested again as it gets older. You need a long trace, around a week, for a useful plot. Most block workloads do not have enough requests. ```bash -./bin/traceAnalyzer --popularityDacay +./bin/traceAnalyzer --popularityDecay python3 ../scripts/traceAnalysis/popularity_decay.py ${dataname}.popularityDecay_w300_obj ``` diff --git a/libCacheSim/bin/traceAnalyzer/cli_parser.cpp b/libCacheSim/bin/traceAnalyzer/cli_parser.cpp index 7251abc92..693ecbaa4 100644 --- a/libCacheSim/bin/traceAnalyzer/cli_parser.cpp +++ b/libCacheSim/bin/traceAnalyzer/cli_parser.cpp @@ -74,7 +74,7 @@ static struct argp_option options[] = { "enable popularity analysis, output freq:cnt in dataname.popularity file, " "and prints the skewness to stdout and stat file", 3}, - {"popularityDacay", OPTION_ENABLE_POPULARITY_DECAY, NULL, + {"popularityDecay", OPTION_ENABLE_POPULARITY_DECAY, NULL, OPTION_ARG_OPTIONAL, "enable popularity decay analysis, this calculates popularity fade as a " "heatmap. It is an expensive analysis, enable only when needed.", diff --git a/test/test_cli.sh b/test/test_cli.sh index e938c0ef6..8ff5d712d 100755 --- a/test/test_cli.sh +++ b/test/test_cli.sh @@ -542,6 +542,24 @@ if [[ -x "${BIN_DIR}/traceAnalyzer" ]]; then "${BIN_DIR}/traceAnalyzer" --common -o out-common "${TRACE}" vscsi expect_ok "traceAnalyzer --num-req" \ "${BIN_DIR}/traceAnalyzer" --num-req=10000 -o out-nreq "${TRACE}" vscsi + + # The option was registered as --popularityDacay, so the documented + # --popularityDecay was rejected as unrecognized. The correct spelling must + # run the analysis and write its data file. It writes into its own + # directory so the output file check cannot be satisfied by another run. + _trace_name=$(basename "${TRACE}") + mkdir -p pd-out + expect_ok "traceAnalyzer --popularityDecay" \ + "${BIN_DIR}/traceAnalyzer" "${TRACE}" vscsi --popularityDecay \ + -o "pd-out/${_trace_name}" + if [[ -s "pd-out/${_trace_name}.popularityDecay_w300_obj" ]]; then + _report 0 "" + else + _report 1 "traceAnalyzer --popularityDecay did not write ${_trace_name}.popularityDecay_w300_obj" + fi + # [-] keeps grep from reading a pattern that starts with -- as an option + expect_output "traceAnalyzer --help lists --popularityDecay" \ + "[-]-popularityDecay" "${BIN_DIR}/traceAnalyzer" --help fi if [[ -x "${BIN_DIR}/mrcProfiler" ]]; then