Skip to content

Commit

Permalink
i#4014 offline phys: Exit up front on -offline -use_physical (#4015)
Browse files Browse the repository at this point in the history
In drcachesim, the combination of -offline and -use_physical is not
supported at this time.  We make that clear in the option docs and
with an up-front exit when the two are requested at once.

Issue: #4014
  • Loading branch information
derekbruening authored Jan 13, 2020
1 parent af21cdc commit 40b61af
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
5 changes: 3 additions & 2 deletions clients/drcachesim/common/options.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* **********************************************************
* Copyright (c) 2015-2019 Google, Inc. All rights reserved.
* Copyright (c) 2015-2020 Google, Inc. All rights reserved.
* **********************************************************/

/*
Expand Down Expand Up @@ -175,7 +175,8 @@ droption_t<bool> op_coherence(
droption_t<bool> op_use_physical(
DROPTION_SCOPE_CLIENT, "use_physical", false, "Use physical addresses if possible",
"If available, the default virtual addresses will be translated to physical. "
"This is not possible from user mode on all platforms.");
"This is not possible from user mode on all platforms. "
"This is not supported with -offline at this time.");

droption_t<unsigned int> op_virt2phys_freq(
DROPTION_SCOPE_CLIENT, "virt2phys_freq", 0, "Frequency of physical mapping refresh",
Expand Down
3 changes: 3 additions & 0 deletions clients/drcachesim/tracer/instru_offline.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,9 @@ offline_instru_t::get_entry_size(byte *buf_ptr) const
addr_t
offline_instru_t::get_entry_addr(byte *buf_ptr) const
{
// TODO i#4014: To support -use_physical we would need to handle a PC
// entry here.
DR_ASSERT(!type_is_instr(get_entry_type(buf_ptr)));
offline_entry_t *entry = (offline_entry_t *)buf_ptr;
return entry->addr.addr;
}
Expand Down
4 changes: 4 additions & 0 deletions clients/drcachesim/tracer/tracer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1764,6 +1764,10 @@ drmemtrace_client_main(client_id_t id, int argc, const char *argv[])
instru = new (placement) offline_instru_t(
insert_load_buf_ptr, op_L0_filter.get_value(), &scratch_reserve_vec,
file_ops_func.write_file, module_file, op_disable_optimizations.get_value());
if (op_use_physical.get_value()) {
/* TODO i#4014: Add support for this combination. */
FATAL("Usage error: -offline does not currently support -use_physical.");
}
} else {
void *placement;
/* we use placement new for better isolation */
Expand Down

0 comments on commit 40b61af

Please sign in to comment.