8000 Speed up reading the target process memory on Linux · Issue #72 · rust-minidump/minidump-writer · GitHub
[go: up one dir, main page]

Skip to content

Speed up reading the target process memory on Linux #72

Closed

Description

@gabrielesvelto

The function we use to copy data out of the target process currently relies on ptrace::read() (see here). While this guarantees compatibility with versions of Linux as old as 2.6 it is a bit slow as we're doing one syscall per every memory word read.

One way to speed this up would be to pread64() the data from /proc/<pid>/mem. This should work on pretty much any version of Linux but would require a fallback to ptrace::read() as it might fail due to lack of appropriate credentials. The second approach would be to use process_vm_readv(). This would be even faster if we could read several chunks in a single call (like all the stacks for example) but would fail on very old versions of Linux and if appropriate credentials aren't available. Thus it would also need a fallpack to ptrace::read().

Activity

  1. added a commit that references this issue on Aug 19, 2024
    d5726d3
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      0