Skip to content

Commit

Permalink
i#5199 warmup trace: Renamed cmdline option
Browse files Browse the repository at this point in the history
Changed cmdline option from L0_warmup_refs to L0_filter_until_instrs
plus minor related changes.

Issue: #5199
  • Loading branch information
prasun3 committed Nov 21, 2022
1 parent 1271081 commit 3764e2b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 22 deletions.
13 changes: 7 additions & 6 deletions clients/drcachesim/common/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -504,12 +504,13 @@ droption_t<bytesize_t>
"of being simulated. This skipping may be slow for large skip values; "
"consider -skip_instrs for a faster method of skipping.");

droption_t<bytesize_t> op_L0_warmup_refs(
DROPTION_SCOPE_CLIENT, "L0_warmup_refs", 0,
"Number of memory references for warmup trace",
"Specifies the number of memory references included in the warm up trace."
"The warmup references come after the fast forward count and before the "
"instruction trace. ");
droption_t<bytesize_t> op_L0_filter_until_instrs(
DROPTION_SCOPE_CLIENT, "L0_filter_until_instrs", 0,
"Number of instructions for warmup trace",
"Specifies the number of instructions to run in warmup mode. In warmup mode, we "
"filter accesses through the L0{D,I}_filter caches. The size of these can be "
"specified using L0{D,I}_size. The filter instructions come after the "
"-trace_after_instrs count and before the instruction trace. ");

droption_t<bytesize_t> op_warmup_refs(
DROPTION_SCOPE_FRONTEND, "warmup_refs", 0,
Expand Down
2 changes: 1 addition & 1 deletion clients/drcachesim/common/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ extern droption_t<bool> op_L0_filter_deprecated;
extern droption_t<bool> op_L0I_filter;
extern droption_t<bool> op_L0D_filter;
extern droption_t<bytesize_t> op_L0D_size;
extern droption_t<bytesize_t> op_L0_warmup_refs;
extern droption_t<bytesize_t> op_L0_filter_until_instrs;
extern droption_t<bool> op_instr_only_trace;
extern droption_t<bool> op_coherence;
extern droption_t<bool> op_use_physical;
Expand Down
2 changes: 1 addition & 1 deletion clients/drcachesim/tracer/instr_counter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ hit_instr_count_threshold(app_pc next_pc)
#endif
DR_ASSERT(tracing_mode.load(std::memory_order_acquire) == BBDUP_MODE_COUNT);

if (op_L0_warmup_refs.get_value())
if (op_L0_filter_until_instrs.get_value())
mode = BBDUP_MODE_L0_FILTER;
else
mode = BBDUP_MODE_TRACE;
Expand Down
25 changes: 11 additions & 14 deletions clients/drcachesim/tracer/tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ event_bb_setup(void *drbbdup_ctx, void *drcontext, void *tag, instrlist_t *bb,
res = drbbdup_register_case_encoding(drbbdup_ctx, BBDUP_MODE_COUNT);
DR_ASSERT(res == DRBBDUP_SUCCESS);
}
if (op_L0_warmup_refs.get_value()) {
if (op_L0_filter_until_instrs.get_value()) {
res = drbbdup_register_case_encoding(drbbdup_ctx, BBDUP_MODE_L0_FILTER);
DR_ASSERT(res == DRBBDUP_SUCCESS);
}
Expand Down Expand Up @@ -387,7 +387,7 @@ instrumentation_drbbdup_init()
++opts.non_default_case_limit; // BBDUP_MODE_NOP.
if (bbdup_instr_counting_enabled())
++opts.non_default_case_limit; // BBDUP_MODE_COUNT.
if (op_L0_warmup_refs.get_value())
if (op_L0_filter_until_instrs.get_value())
++opts.non_default_case_limit; // BBDUP_MODE_L0_FILTER.
// Save per-thread heap for a feature we do not need.
opts.never_enable_dynamic_handling = true;
Expand All @@ -412,7 +412,7 @@ instrumentation_init()
tracing_mode.store(BBDUP_MODE_NOP, std::memory_order_release);
else if (op_trace_after_instrs.get_value() != 0)
tracing_mode.store(BBDUP_MODE_COUNT, std::memory_order_release);
else if (op_L0_warmup_refs.get_value())
else if (op_L0_filter_until_instrs.get_value())
tracing_mode.store(BBDUP_MODE_L0_FILTER, std::memory_order_release);

#ifdef DELAYED_CHECK_INLINED
Expand Down Expand Up @@ -1042,7 +1042,7 @@ event_app_instruction(void *drcontext, void *tag, instrlist_t *bb, instr_t *inst
bool is_l0_filter = (op_L0I_filter.get_value() || op_L0D_filter.get_value());
// If we have both BBDUP_MODE_TRACE and BBDUP_MODE_L0_FILTER, then L0 filter is active
// only when mode is BBDUP_MODE_L0_FILTER
if (op_L0_warmup_refs.get_value()) {
if (op_L0_filter_until_instrs.get_value()) {
is_l0_filter = (mode == BBDUP_MODE_L0_FILTER);
}

Expand Down Expand Up @@ -1980,18 +1980,15 @@ drmemtrace_client_main(client_id_t id, int argc, const char *argv[])
(op_record_heap.get_value() || !op_record_function.get_value().empty())) {
FATAL("Usage error: function recording is only supported for -offline\n");
}
if (op_L0_warmup_refs.get_value()) {
if (op_L0_filter_until_instrs.get_value()) {

DR_ASSERT(!op_L0D_filter.get_value());
DR_ASSERT(!op_L0I_filter.get_value());
if (op_L0D_filter.get_value() || op_L0I_filter.get_value()) {
FATAL("Usage error: cannot use -L0_filter with -L0_warmup.");
if (!op_L0D_filter.get_value() && !op_L0I_filter.get_value()) {
NOTIFY(
0,
"Assuming both L0D_filter and L0I_filter for L0_filter_until_instrs\n");
op_L0D_filter.set_value(op_L0_filter_until_instrs.get_value());
op_L0I_filter.set_value(op_L0_filter_until_instrs.get_value());
}
if (op_exit_after_tracing.get_value()) {
FATAL("Usage error: -warmup does not currently support -exit_after_tracing.");
}
op_L0I_filter.set_value(op_L0_warmup_refs.get_value());
op_L0D_filter.set_value(op_L0_warmup_refs.get_value());
}

if (op_L0_filter_deprecated.get_value()) {
Expand Down

0 comments on commit 3764e2b

Please sign in to comment.