Skip to content
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

Collapse drmgr into the core and unify the event interface #5161

Open
derekbruening opened this issue Oct 14, 2021 · 0 comments
Open

Collapse drmgr into the core and unify the event interface #5161

derekbruening opened this issue Oct 14, 2021 · 0 comments

Comments

@derekbruening
Copy link
Contributor

Xref #4128 where having key libraries separate from the core causes headaches, and #5160.

The DR API has evolved to the point where all the powerful features rely on drmgr and there's really no reason to support non-drmgr use anymore. Having it separate adds complications that may outweigh the "keep the core simple" goal.

The idea here would be to move drmgr into the core and remove all the layered events, and probably give all events a priority and user_data (user_data is key to better C++ interaction to avoid requiring static functions). So we'd get rid of the plain basic block event, e.g.

derekbruening added a commit that referenced this issue Oct 14, 2021
Adds new dr_cleancall_save_t flags which are required for proper
interaction between clean calls and drreg:
DR_CLEANCALL_READS_APP_CONTEXT must be set for dr_get_mcontext() to
obtain the proper values, and #DR_CLEANCALL_WRITES_APP_CONTEXT must be
set to ensure that dr_set_mcontext() is persistent.

Adds a clean call insertion event to enable drreg to know about clean
calls at the time they are inserted.  dr_insert_clean_call_ex()
invokes the callback and passes the flags to drreg, who then treats
the clean call as an app instruction.

For annotations, for now we leave drreg looking for the annotation
label (possible future changes #5160 or #5161 would eliminate this
special case).

dr_insert_{cbr,ubr,mbr,call}_instrumentation() always set both labels.

drwrap always sets both labels for pre and post callbacks.

Updates uses throughout our tests and samples to use the new flags as
appropriate.

Adds a new dedicated test client.drwrap-drreg-test which tests both a
drwrap call and a direct clean call.

Fixes a missing drwrap cache invalidation on module unload that the
new test uncovers.

Fixes #4128
derekbruening added a commit that referenced this issue Oct 20, 2021
Adds new dr_cleancall_save_t flags which are required for proper
interaction between clean calls and drreg:
DR_CLEANCALL_READS_APP_CONTEXT must be set for dr_get_mcontext() to
obtain the proper values, and #DR_CLEANCALL_WRITES_APP_CONTEXT must be
set to ensure that dr_set_mcontext() is persistent.
DR_CLEANCALL_MULTIPATH must be additionally set for might-skip calls.

Adds a clean call insertion event to enable drreg to know about clean
calls at the time they are inserted.  dr_insert_clean_call_ex()
invokes the callback and passes the flags to drreg, who then treats
the clean call as an app instruction.

For annotations, for now we leave drreg looking for the annotation
label (possible future changes #5160 or #5161 would eliminate this
special case).

dr_insert_{cbr,ubr,mbr,call}_instrumentation() always set both labels.

drwrap always sets both labels for pre and post callbacks.

Updates uses throughout our tests and samples to use the new flags as
appropriate.

Adds drreg_statelessly_restore_all() for clean call multipath restoration.

Adds a new dedicated test client.drwrap-drreg-test which tests both a
drwrap call and direct clean calls.

Fixes a missing drwrap cache invalidation on module unload that the
new test uncovers.

This likely fixes #4711 as its code was passing the same location for
the where_respill as where_restore for stateless drreg restoration;
the automated restore here correctly passes the post-instr location.

Issue: #4128, #4711
Fixes #4128
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant