Skip to content

Commit

Permalink
i#3995 multi-window: Add repeated tracing window feature
Browse files Browse the repository at this point in the history
Adds new options -trace_for_instrs and -retrace_every_instrs to
drcachesim for periodic trace bustrs of an unmodified application.

TODO: Implement these using the new drbbdup framework by repeatedly
alternating among the cases.

Issue: #3995
  • Loading branch information
derekbruening committed Apr 20, 2020
1 parent 891c579 commit 949f3f0
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 3 deletions.
2 changes: 2 additions & 0 deletions api/docs/release.dox
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ Further non-compatibility-affecting changes include:
dr_get_process_id() in some contexts.
- The private loader's malloc redirection now guarantees double-pointer-sized
alignment, to match what system-provided allocators use.
- Added -trace_for_instrs and -retrace_every_instrs options to drcachesim
for periodic trace bustrs of an unmodified application.

**************************************************
<hr>
Expand Down
24 changes: 21 additions & 3 deletions clients/drcachesim/common/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,9 +218,27 @@ droption_t<bytesize_t> op_trace_after_instrs(
DROPTION_SCOPE_CLIENT, "trace_after_instrs", 0,
"Do not start tracing until N instructions",
"If non-zero, this causes tracing to be suppressed until this many dynamic "
"instruction "
"executions are observed. At that point, regular tracing is put into place. Use "
"-max_trace_size to set a limit on the subsequent trace length.");
"instruction executions are observed from the start of the application. "
"At that point, regular tracing is put into place. Use "
"-trace_for_instrs or -max_trace_size to set a limit on the subsequent trace "
"length. Use -retrace_every_instrs to trace repeatedly.");

droption_t<bytesize_t> op_trace_for_instrs(
DROPTION_SCOPE_CLIENT, "trace_for_instrs", 0,
"After tracing N instructions, stop tracing, but continue executing.",
"If non-zero, this stops recording a trace after the specified number of "
"instructions are traced. Unlike -exit_after_tracing, which kills the "
"application (and counts data as well as instructions), the application "
"continues executing. This can be combined with -retrace_every_instrs.");

droption_t<bytesize_t> op_retrace_every_instrs(
DROPTION_SCOPE_CLIENT, "retrace_every_instrs", 0,
"Trace for -trace_for_instrs, execute this many, and repeat.",
"This option augment -trace_for_instrs. After tracing concludes, this option "
"causes non-traced instructions to be counted and after the number specified by "
"this option, tracing start up again for the -trace_for_instrs duration. This "
"process repeats itself. This can be combined with -trace_after_instrs for an "
"initial period of non-tracing.");

droption_t<bytesize_t> op_exit_after_tracing(
DROPTION_SCOPE_CLIENT, "exit_after_tracing", 0,
Expand Down
2 changes: 2 additions & 0 deletions clients/drcachesim/common/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ extern droption_t<unsigned int> op_virt2phys_freq;
extern droption_t<bool> op_cpu_scheduling;
extern droption_t<bytesize_t> op_max_trace_size;
extern droption_t<bytesize_t> op_trace_after_instrs;
extern droption_t<bytesize_t> op_trace_for_instrs;
extern droption_t<bytesize_t> op_retrace_every_instrs;
extern droption_t<bytesize_t> op_exit_after_tracing;
extern droption_t<bool> op_online_instr_types;
extern droption_t<std::string> op_replace_policy;
Expand Down

0 comments on commit 949f3f0

Please sign in to comment.