adsr / phpspy

low-overhead sampling profiler for PHP 7+
MIT License
1.43k stars 66 forks source link

Support macOS #50

Open adsr opened 5 years ago

adsr commented 5 years ago

https://developer.apple.com/documentation/kernel/1585350-vm_read?language=objc

keyganker commented 5 years ago

Looking forward。。。

tuaris commented 4 years ago

If this request is accepted, please also consider #70 In the mean time I will research what Linux system calls need to be translated to FreeBSD equivalents.

adsr commented 4 years ago

Thank you @tuaris. I added #113 to track FreeBSD support. I have a FreeBSD VM so I can actually help with that one.

Re: macOS (#50), I do not have access to a mac. If someone has mac VM that I can remote into, I'd be happy to play around with it.

Re: Windows (#51), I do have a Windows machine somewhere... I'll add to my backlog.

mpociot commented 3 years ago

@adsr Is there any way I can help with adding Mac support? How could I provide a VM for you?

adsr commented 3 years ago

Hi @mpociot. Recently I discovered https://github.com/fastai/fastmac so it is on my backlog to investigate. We will need to port the ELF-specific stuff in addr_objump.c and the copy_proc_mem function. Hopefully not much more.

mpociot commented 2 years ago

Hey @adsr Sorry for pinging you on an old issue. I just keep coming back to this repository and would love to see this feature added. I tried to look into this myself, but I have some very limited C knowledge and couldn't make it very far.

phpspy.c:716:9: error: implicit declaration of function 'process_vm_readv' is invalid in C99 [-Werror,-Wimplicit-function-declaration]

I'd love to help in any way to make this work

adsr commented 6 months ago

Hi @mpociot sorry for the very delayed reply. process_vm_readv is a Linux-specific syscall. You might try looking at rbspy for ideas, specifically these repos:

https://github.com/rbspy/read-process-memory https://github.com/rbspy/proc-maps

which have cross-platform routines for reading remote process memory.

It looks like that fastmac thing I mentioned above is no longer around. If someone wants to donate an old mac or provide a remote shell I'd be happy to hack on this.

mpociot commented 6 months ago

Feel free to ping me on X/Twitter at https://x.com/marcelpociot

Happy to provide a macOS Server for you 🙂

mabu233 commented 2 months ago

Hi, @mpociot Please see https://github.com/mabu233/phpspy/tree/darwin Testing