-
Notifications
You must be signed in to change notification settings - Fork 566
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
i#2062 memtrace nonmod part 2: Raw2trace parsing of encoding file #5619
Conversation
Adds raw2trace parsing of the encoding file used by the tracer to store instruction encodings for generated code. This involves the following changes: + Adds encoding file parsing to module_mapper_t. + Changes module map queries to use new module_mapper_t interfaces instead, which handle generated code. + Changes block lookup to use the modidx,modoffs pair as the key rather than the absolute pc. The changes are compatibility-breaking for raw2trace_t which now takes an encoding file parameter in the middle of existing parameters. Updates existing uses. For module_mapper_t the encoding file is added last with a default value to preserve compatibility for existing analysis tools like opcode_mix and view. It is assumed that encodings for generated code will be added to the final trace file and thus these tools will not need a module_mapper_t interface for generated code. Augments the tool.drcacheoff.gencode test to post-process the trace and ensure the generated code PC is observed. Fixes a -loglevel 4 signal dump_unmaksed() crash on detach i#5618 hit in the gencode test; confirmed the test is crash-free at loglevel 4 with the fix. Issue: #2062 Fixes #5618
…s don't have encoding files
…ashtable_t for 64-bit by adding a wrapper class block_hashtable_t
Blocked on the 32-bit hash keys where modidx:modoffs doesn't fit in hashtable_t's pointer-sized keys: so I'm using std::unordered_map (despite it being slower) for 32-bit which works for Linux, but on Windows the compiler doesn't seem to be using a move instead of a copy for the unique_ptr. Still trying to figure out a way through... |
Seems to be a known Visual Studio headache. |
There seem to be non-deterministic (32-bit was just green) Windows timeouts: very frustrating to deal with (see the poor unique_ptr support in Visual Studio I already had to work around). Please go ahead with the review and see if you can spot anything. Not looking forward to more Windows mess that may well turn out to be purely caused by the compiler. |
Turns out this is not related to the unique_ptr: I managed to reproduce in a Windows machine. It is the mmap size being expanded to a page boundary and a check vs map instead of file size. I am uploading the fix in do_encoding_parse(). |
32-bit scattergather test failed again with the same assert: #5329. |
) Adds raw2trace parsing of the encoding file used by the tracer to store instruction encodings for generated code. This involves the following changes: + Adds encoding file parsing to module_mapper_t. + Changes module map queries to use new module_mapper_t interfaces instead, which handle generated code. + Changes block lookup to use the modidx,modoffs pair as the key rather than the absolute pc. This runs into problems on 32-bit where the hashtable_t key is limited to pointer-sized. To solve this, on 32-bit we use unordered_map, via a wrapper class block_hashtable_t to abstract away the differences. The changes are compatibility-breaking for raw2trace_t which now takes an encoding file parameter in the middle of existing parameters. Updates existing uses. For module_mapper_t the encoding file is added last with a default value to preserve compatibility for existing analysis tools like opcode_mix and view. It is assumed that encodings for generated code will be added to the final trace file and thus these tools will not need a module_mapper_t interface for generated code. Augments the tool.drcacheoff.gencode test to post-process the trace and ensure the generated code PC is observed. Fixes a -loglevel 4 signal dump_unmaksed() crash on detach i#5618 hit in the gencode test; confirmed the test is crash-free at loglevel 4 with the fix. Issue: #2062 Fixes #5618
Adds raw2trace parsing of the encoding file used by the tracer to
store instruction encodings for generated code. This involves the
following changes:
which handle generated code.
the absolute pc.
The changes are compatibility-breaking for raw2trace_t which now takes
an encoding file parameter in the middle of existing parameters.
Updates existing uses.
For module_mapper_t the encoding file is added last with a default
value to preserve compatibility for existing analysis tools like
opcode_mix and view. It is assumed that encodings for generated code
will be added to the final trace file and thus these tools will not
need a module_mapper_t interface for generated code.
Augments the tool.drcacheoff.gencode test to post-process the trace
and ensure the generated code PC is observed.
Fixes a -loglevel 4 signal dump_unmaksed() crash on detach i#5618 hit
in the gencode test; confirmed the test is crash-free at loglevel 4
with the fix.
Issue: #2062
Fixes #5618