-
Notifications
You must be signed in to change notification settings - Fork 569
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
i#3995: tracing windows at irregular instruction intervals (#6927)
Currently we can only perform window-tracing at regular intervals on binaries using the -trace_after_instrs, -trace_for_instrs, -retrace_every_instrs options. Sometimes it's useful to trace windows of different sizes at irregular instruction intervals (e.g., for tracing simpoints). We do so introducing a new option: ``` -trace_instr_intervals_file path/to/instr/intervals.csv ``` which takes a CSV file where every line has <start,duration> pairs representing intervals in terms of number of instructions. The implementation relies on the same window-tracing mechanism used by -trace_after_instrs, -trace_for_instrs, -retrace_every_instrs. We add a level of indirection to obtain the values of these options through the `get_initial_no_trace_for_instrs_value()`, `get_current_trace_for_instrs_value()`, and `get_current_no_trace_for_instrs_value()` functions respectively. This allows us to change the returned value of these options depending on the window we are tracing at that point. We do so using a global, read-only vector `irregular_windows_list` containing the trace_for_instrs/no_trace_for_instrs window, and an atomic (also global) index `irregular_window_idx` that we increment every time we finish tracing a window to go to the next one in the vector. We add a new end-to-end test: tool.drcachesim.irregular-windows-simple. Issue #3995
- Loading branch information
Showing
11 changed files
with
317 additions
and
21 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
100,10000, | ||
40000,20000, | ||
100000,1000, |
17 changes: 17 additions & 0 deletions
17
clients/drcachesim/tests/irregular-windows-simple.templatex
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
Hit delay threshold: enabling tracing. | ||
Hit tracing window #0 limit: disabling tracing. | ||
Hit retrace threshold: enabling tracing for window #1. | ||
Hit tracing window #1 limit: disabling tracing. | ||
Hit retrace threshold: enabling tracing for window #2. | ||
Hit tracing window #2 limit: disabling tracing. | ||
.* | ||
---- <application exited with code 0> ---- | ||
Basic counts tool results: | ||
.* | ||
Total windows: [0-9]* | ||
Window #0: | ||
.* | ||
Window #1: | ||
.* | ||
Window #2: | ||
.* |
This file contains 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
This file contains 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
Oops, something went wrong.