Skip to content

Port to macOS #13

@atheriel

Description

@atheriel

xrprof is already somewhat designed with portability in mind. To get basic R profiling functionality working on macOS will require the following:

  • Implementing copy_address() (see memory.h and memory.c) for macOS, likely using the vm_read() function provided by that platform. For an idea of what this might look like, check out this well-known Rust implementation.

  • Implementing locate_libR_globals() (see locate.h and locate.c) for macOS. I'm less sure of how to locate the address of a symbol on that platform, but it's definitely possible.

  • Implementing proc_suspend() and proc_resume() (see process.h) for macOS. Although not 100% necessary, sampling from a process when it's still running may yield incomplete/inconsistent stacks.

  • Modifying the build system as needed to compile on macOS.

Mixed R & C/C++ profiling will probably be more difficult to implement. I do not know if there is any "help" provided by macOS APIs for this, but obviously some tools (e.g. gdb) are able to generate backtraces of a remote process on that platform.

cc @jimhester

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions