-
Notifications
You must be signed in to change notification settings - Fork 68
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
Function name and probe name always seem to be the same #51
Comments
The "module" and "function" that DTrace knows about were historically the native module (i.e., kernel module, shared library, or "a.out") and native function name where the probe itself is defined. See http://dtrace.org/guide/chapter.html#chp-intro-3 This makes sense for the native environments DTrace was initially created for, and I'm not sure whether these fields were intended to be generalized to mean something more useful for dynamic environments. I can see arguments both ways, so I'd defer to @bcantrill on this. CC'ing @tjfontaine, who's also wondered about this. |
Thanks for the response, Dave.
I would argue that having dtrace-provider at all shows intention to make DTrace more useful for dynamic environments. We can already specify provider, module, and probe names to be something meaningful for our application, being able to specify the function name simply adds to that utility. An example use case is: I want to profile high-level entry points to a module to see how it is being used. With the pid provider on native code, I could set up a probe on app1234:mymodule::entry, and aggregate on call stack (to see usage), or start a timer. However, if I want to trace what is calling one of my functions that is producing an error, I would need to set up a probe on app1234:mymodule:myfunction:entry. I can solve the first case by having a single pair of entry and exit probes for my module:
and calling it from each entry point. I can solve the second case by creating a separate probe for each function entry and exit in my module:
and setting my DTrace script to fire on just the one probe. I suppose I could work around this by creating both sets of probes, but this isn't the nicest solution. |
I'm just starting to use DTrace with node, but have noticed that the function name and probe name seem to be the same. For example, when using:
dtrace -l will return:
where 'myprobe' is listed as both the function name and probe name. However, for other probes, I see separate function and probe names:
Digging into
DTraceProvider::AddProbe()
shows the call to usdt_create_probe passing the name as both the function name and probe name:probe->probedef = usdt_create_probe(*name, *name, probe->argc, types);
Is this intentional?
The text was updated successfully, but these errors were encountered: