Open derekbruening opened 4 years ago
Previously, physaddr_t was just used racily. I made it per-thread all at once. This does result in a per-thread file descriptor being opened, which may not scale well: it will exhaust DR's private file-descriptor space and could possibly hit rlimits. Improving scaling is a still-open action item.
-use_physical is only supported for online drcachesim today, but that is not made clear in the docs nor in actual usage. The tool lets you run
-offline -use_physical
and ends up with a post-processed trace with physical data addresses but virtual PC fetches, due to an accident.instr_offline_t::get_entry_addr
blindly treats the entry as a data ref, so it tries to translate bogus addresses composed of module id + offset encodings.And indeed we get warnings at -verbose 1+:
Those are the instruction entries:
So we have two action items. First, we should have the front-end refuse to combine
-use_physical
and-offline
for now, and update the docs to reflect this.Next, we need to decide whether to try to support this combination. Is it possible that future Linux distros will all shut down access to pagemap? Although for research purposes running as sudo or something may still be feasible.
How would we support this? We'd either have to store extra info for each data ref plus an entry for each instr like for DGC (#2062), or have a custom solution just for offline where each block PC has 2 entries: one virtual and one physical. The former will not work well w/ tools that want operands (like opcode_mix or micro-arch simulators): but that would be the same for DGC, so we might need an option to store the full instr bytes.
Another limitation today (which perhaps should have its own issue) with
-use_physical
relates to static linking which we often use for offline tracing:Xref #2912 but that issue has many confusing entries so it seemed better to start clean here.