From 3764e2bcf773da6dc4b33b9a24d7820938421528 Mon Sep 17 00:00:00 2001 From: prasun3 Date: Mon, 21 Nov 2022 14:19:22 +0530 Subject: [PATCH] i#5199 warmup trace: Renamed cmdline option Changed cmdline option from L0_warmup_refs to L0_filter_until_instrs plus minor related changes. Issue: #5199 --- clients/drcachesim/common/options.cpp | 13 ++++++----- clients/drcachesim/common/options.h | 2 +- clients/drcachesim/tracer/instr_counter.cpp | 2 +- clients/drcachesim/tracer/tracer.cpp | 25 +++++++++------------ 4 files changed, 20 insertions(+), 22 deletions(-) diff --git a/clients/drcachesim/common/options.cpp b/clients/drcachesim/common/options.cpp index 051d69eac3d..3c2247f2dfb 100644 --- a/clients/drcachesim/common/options.cpp +++ b/clients/drcachesim/common/options.cpp @@ -504,12 +504,13 @@ droption_t "of being simulated. This skipping may be slow for large skip values; " "consider -skip_instrs for a faster method of skipping."); -droption_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 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 op_warmup_refs( DROPTION_SCOPE_FRONTEND, "warmup_refs", 0, diff --git a/clients/drcachesim/common/options.h b/clients/drcachesim/common/options.h index f4cddd66a5b..21a5445180d 100644 --- a/clients/drcachesim/common/options.h +++ b/clients/drcachesim/common/options.h @@ -85,7 +85,7 @@ extern droption_t op_L0_filter_deprecated; extern droption_t op_L0I_filter; extern droption_t op_L0D_filter; extern droption_t op_L0D_size; -extern droption_t op_L0_warmup_refs; +extern droption_t op_L0_filter_until_instrs; extern droption_t op_instr_only_trace; extern droption_t op_coherence; extern droption_t op_use_physical; diff --git a/clients/drcachesim/tracer/instr_counter.cpp b/clients/drcachesim/tracer/instr_counter.cpp index 0fab84f8b49..3e799878cf3 100644 --- a/clients/drcachesim/tracer/instr_counter.cpp +++ b/clients/drcachesim/tracer/instr_counter.cpp @@ -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; diff --git a/clients/drcachesim/tracer/tracer.cpp b/clients/drcachesim/tracer/tracer.cpp index bc20817c8f9..cb82e81e619 100644 --- a/clients/drcachesim/tracer/tracer.cpp +++ b/clients/drcachesim/tracer/tracer.cpp @@ -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); } @@ -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; @@ -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 @@ -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); } @@ -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()) {