A question to Mac OS X gurus

Questions about YourKit Java Profiler
Post Reply
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

A question to Mac OS X gurus

Post by Anton Katilin »

Hi,

In case anybody knows about this issue...

There is a need to get command line of native application on Mac OS X at any arbitrary point (access to argc/argv is not possible because it's a profiler agent, i.e. plugin to Java). Other UNIXes have procfs, AFAIK Mac OS X does not. Some found references tell sysctl should be used instead, but I don't understand what I should particullary do with it.

Alternatively, where can I find source code of the 'ps' program for Mac OS X? It can print command lines so should contain the answer.

Best regards,
Anton
Sascha Weinreuter
Posts: 46
Joined: Mon Jan 24, 2005 3:01 pm

Post by Sascha Weinreuter »

I'm not a MacOS guru (I don't even have one), but maybe running 'ps' with strace (if that exists on MacOS) might give you a hint. Just a thought :wink:

Sascha
Anton Katilin
Posts: 6172
Joined: Wed Aug 11, 2004 8:37 am

Post by Anton Katilin »

Hi Sascha

Thank you for the hint. We used ps's sources and found the solution.

Best regards,
Anton
Post Reply