Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mac OS X support? #7

Open
mzachh opened this issue Oct 30, 2013 · 5 comments
Open

Mac OS X support? #7

mzachh opened this issue Oct 30, 2013 · 5 comments

Comments

@mzachh
Copy link

mzachh commented Oct 30, 2013

Hi,

should this module work on Mac OS X?
I have some issues to get it running.

At the moment I am stuck at the following issue:

sudo dtrace -s examples/http-requests.d
dtrace: failed to compile script examples/http-requests.d: line 22: index 1 is out of range for httpd*:::request-done args[ ]

http-requests-bylatency.d (without arguments) works.

@davepacheco
Copy link
Contributor

I believe the problem is that OS X does not support USDT translators.
mod_usdt could be modified to pass additional primitive (i.e., non-struct)
arguments, which is what we did to address this for the Node.js provider,
though we'll be limited to only a few arguments this way.

the bylatency script works because it doesn't try to use the arguments at
all.

On Wed, Oct 30, 2013 at 4:58 PM, mzachh notifications@github.com wrote:

Hi,

should this module work on Mac OS X?
I have some issues to get it running.

At the moment I am stuck at the following issue:

sudo dtrace -s examples/http-requests.d
dtrace: failed to compile script examples/http-requests.d: line 22: index
1 is out of range for httpd*:::request-done args[ ]

http-requests-bylatency.d (without arguments) works.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7
.

@mzachh
Copy link
Author

mzachh commented Oct 31, 2013

I think I understand. Can we we somehow verify of USDT translators are for sure not supported on MacOSX 10.9? The man page (https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dtrace.1.html) does not mention it.

Sorry USDT probes and also MacOSX is quite new to me, therefore me naive approach:

I could not use the Makefile, therefore I did the following:

  1. dtrace -h ...
  2. build with apxs
  3. I did not do "dtrace -G" because it's not supported and afaik not necessary on osx
  4. Copied the net.d and procfs.d from Solaris to /usr/lib/dtrace/. Guess this was too naive.

At the moment I could imagine that:

  1. USDT translators are in general not supported.
  2. net.d and procfs.d needs to be ported to osx

But it's already great that the probes work without the arguments.

@davepacheco
Copy link
Contributor

I'm not sure how to verify that USDT translators don't work on MacOS. At
one point, I got this error:

sudo dtrace -n 'node*:::http-server-request{ printf("%s\n",

args[0]->method); }'
dtrace: invalid probe specifier node*:::http-server-request{
printf("%s\n", args[0]->method); }: in action list: operator -> cannot be
applied to pointer to type "int"; must be applied to a struct or union
pointer

and when I looked at the types of the probe's arguments using "dtrace -lv",
OS X thought they were all "int *". On illumos, the types of that probe
are "(unknown)", and the translators work. I stopped there.

The net.d and procfs.d from Solaris will almost certainly not work on OS X,
as those are implemented using kernel implementation details.

On Thu, Oct 31, 2013 at 2:18 AM, mzachh notifications@github.com wrote:

I think I understand. Can we we somehow verify of USDT translators are for
sure not supported on MacOSX 10.9? The man page (
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/dtrace.1.html)
does not mention it.

Sorry USDT probes and also MacOSX is quite new to me, therefore me naive
approach:

I could not use the Makefile, therefore I did the following:

  1. dtrace -h ...
  2. build with apxs
  3. I did not do "dtrace -G" because it's not supported and afaik not
    necessary on osx
  4. Copied the net.d and procfs.d from Solaris to /usr/lib/dtrace/. Guess
    this was too naive.

At the moment I could imagine that:

  1. USDT translators are in general not supported.
  2. net.d and procfs.d needs to be ported to osx

But it's already great that the probes work without the arguments.


Reply to this email directly or view it on GitHubhttps://github.com//issues/7#issuecomment-27471534
.

@mzachh
Copy link
Author

mzachh commented Nov 13, 2013

I hacked together a first prototype with non-struct arguments and it seems to work.

What do you think, does it make sense do add additional probes like "request-start_nonstruct", to not break existing scripts for your module? Or create an own fork?

@davepacheco
Copy link
Contributor

How many arguments are there? Could you put them after the existing the arguments, using the same probes? (That's what we did for the Node.js provider when we added support for OS X. We kept the struct arguments for platforms that support those, but added additional non-struct args for those platforms.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants