Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • D dynamorio
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,467
    • Issues 1,467
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 44
    • Merge requests 44
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • DynamoRIO
  • dynamorio
  • Merge requests
  • !4281

i#4280: Add support for opcode insert instrumentation to drmgr

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged John F.X. Galea requested to merge i4280-opcode-instrum into master May 02, 2020
  • Overview 50
  • Commits 13
  • Pipelines 0
  • Changes 6

Adds the support of instrumentation events specific to opcode instructions to drmgr. In particular, two new API functions are introduced: drmgr_register_opcode_instrumentation_event() and drmgr_unregister_opcode_instrumentation_event().

drmgr_register_opcode_instrumentation_event() takes a call-back function and an opcode as input. The call-back is triggered during the insert per instruction stage (i.e., stage 3) only for those instructions that have the specified opcode.

Call-backs pertaining to an opcode are maintained via a hashtable.

Some care is taken to avoid any performance hits if opcode events are not registered. For instance, with the use of flags, the code avoids locking or hash-lookups if opcode events are never registered by the user.

In order to ensure call-backs pertaining to insert-bb and insert-opcode events are jointly triggered in the right order, with respect to their priorities, drmgr combines them into a single list on the fly by performing lookups. I avoided using one monolithic cb list as clients with a long list of different registered opcode events would have required drmgr to do wasteful iterations.

Fixes: #4280 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i4280-opcode-instrum