Repository navigation
feat: report both ratios every --report-interval seconds of trace time, as cachesim does - #5
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@haochengxia asked on #4 (comment, follow-up) for interval-level reporting like libCacheSim's: both metrics every N requests or over fixed trace-time windows, to see how cache performance changes through a trace. Until now prefixsim printed only the totals at the end of each run. This adds the trace-time version, modeled on cachesim's
--report-interval.What this does
--report-interval <s>prints a line everysseconds of trace time with the block hit ratio and compute saving ratio, both over the run so far and over the interval just closed:It follows cachesim (
libCacheSim/bin/cachesim/sim.c):sseconds after the previous report, and that request belongs to the interval it closes.<hours> hour: <n> requests, miss ratio X, interval miss ratio Ybecomes the two prefixsim ratios, so a script likescripts/plot_mrc_time.pyneeds only a changed regex.Where it differs from cachesim:
RESULTlines.RESULTline.Inside the simulator,
SimulatorConfiggainsreport_interval_secand anon_reportcallback that receives anIntervalReportwith the totals so far and the interval's ownStats. The figures are read off phase 1's statistics, so the simulation itself is unchanged.Reporting every N requests instead would be a small addition on top of this, if it turns out to be useful.
How it was tested
testPrefixsimandtestLcppass, also under LeakSanitizer.Stats, the last report's totals equal them, and running without reports gives the same result and no report.qwen3coder30b_blksz_16: with--report-interval 86400theRESULTlines are identical to a run without the option. The example above is from that run.--report-interval 3600theRESULTline is again identical.