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
  • !2261

i#2006 generalize drcachesim: add drmemtrace_buffer_handoff()

  • Review changes

  • Download
  • Email patches
  • Plain diff
Merged Derek Bruening requested to merge i2006-global-buffer-list into master Mar 02, 2017
  • Overview 1
  • Commits 2
  • Pipelines 0
  • Changes 9

Adds a new mode of operation where each full buffer is handed over to external code. A new buffer is allocated and the thread continues instrumentation using the new buffer, with the external code responsible for writing it out and freeing it.

This mode is enabled via a new API routine drmemtrace_buffer_handoff(), which takes a buffer handoff routine, called instead of the write cb, and an exit routine. The exit routine provides a control point after other threads are native but before DR exits, when using dr_app_stop_and_cleanup(). Without it it would be impossible to use DR memory in the handoff and we'd need a hack like putting next pointers inside the redzones or something.

When the handoff is enabled, we disable dumping buffers at syscalls: they are only dumped (i.e., handed over) when full or at thread exit.

Out-of-memory is handled by keeping a buffer "in reserve" which is swapped to once we fail to allocate a buffer, at which point we switch to the size-cap protocol where we instrument but don't send the results anywhere.

Adds a test that accumulates all buffers and writes them all out at process exit.

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: i2006-global-buffer-list