Robert Kern
2009-Apr-22 20:52 UTC
[dtrace-discuss] Missing pid probes in OS X Python processes
I cannot seem to probe any of the Python interpreter''s C functions on OS X. $ sudo dtrace -n ''pid$target::PyEval_EvalFrameEx:entry'' -c python dtrace: invalid probe specifier pid$target::PyEval_EvalFrameEx:entry: probe description pid59706::PyEval_EvalFrameEx:entry does not match any probes These functions show up in ustack()s, but they do not appear to be available for probing. There do not appear to be any probes in the "a.out" module: $ sudo dtrace -n ''pid$target:a.out::entry'' -c python dtrace: invalid probe specifier pid$target:a.out::entry: probe description pid59714:python::entry does not match any probes I suspect that part of the reason may be that these functions are in Python.framework rather than a shared library or the executable itself, but I don''t know how to get any farther than this. Any suggestions? -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco
James McIlree
2009-Apr-23 08:39 UTC
[dtrace-discuss] Missing pid probes in OS X Python processes
On Apr 22, 2009, at 1:52 PM, Robert Kern wrote:> I cannot seem to probe any of the Python interpreter''s C functions > on OS X. > > $ sudo dtrace -n ''pid$target::PyEval_EvalFrameEx:entry'' -c python > dtrace: invalid probe specifier pid > $target::PyEval_EvalFrameEx:entry: probe description > pid59706::PyEval_EvalFrameEx:entry does not match any probes > > These functions show up in ustack()s, but they do not appear to be > available for probing. There do not appear to be any probes in the > "a.out" module: > > $ sudo dtrace -n ''pid$target:a.out::entry'' -c python > dtrace: invalid probe specifier pid$target:a.out::entry: probe > description pid59714:python::entry does not match any probes > > I suspect that part of the reason may be that these functions are in > Python.framework rather than a shared library or the executable > itself, but I don''t know how to get any farther than this. > > Any suggestions?Robert, Python seems to have multiple files that resolve to the same name, specifically Python.app/Contents/MacOS/Python and Python.framework/ Python. There is a bug in the OS X dtrace that when it looks for the "Python" module, it only finds the first one. The Python.app executable has no symbols, and happens to be the first one found. I filed <rdar://problem/6819690> dtrace cannot create probes when libraries have the same name James M
Robert Kern
2009-Apr-23 20:02 UTC
[dtrace-discuss] Missing pid probes in OS X Python processes
On 2009-04-23 03:39, James McIlree wrote:> > On Apr 22, 2009, at 1:52 PM, Robert Kern wrote: > >> I cannot seem to probe any of the Python interpreter''s C functions on >> OS X. >> >> $ sudo dtrace -n ''pid$target::PyEval_EvalFrameEx:entry'' -c python >> dtrace: invalid probe specifier pid$target::PyEval_EvalFrameEx:entry: >> probe description pid59706::PyEval_EvalFrameEx:entry does not match >> any probes >> >> These functions show up in ustack()s, but they do not appear to be >> available for probing. There do not appear to be any probes in the >> "a.out" module: >> >> $ sudo dtrace -n ''pid$target:a.out::entry'' -c python >> dtrace: invalid probe specifier pid$target:a.out::entry: probe >> description pid59714:python::entry does not match any probes >> >> I suspect that part of the reason may be that these functions are in >> Python.framework rather than a shared library or the executable >> itself, but I don''t know how to get any farther than this. >> >> Any suggestions? > > Robert, > > Python seems to have multiple files that resolve to the same name, > specifically Python.app/Contents/MacOS/Python and Python.framework/Python. > > There is a bug in the OS X dtrace that when it looks for the "Python" > module, it only finds the first one. The Python.app executable has no > symbols, > and happens to be the first one found. > > I filed <rdar://problem/6819690> dtrace cannot create probes when > libraries have the same nameThank you! I can verify that when I rebuild Python to use PythonApp.app/Contents/MacOS/PythonApp, I can now trace pid$target:Python::entry probes. What do you think the timeline is for getting that dtrace fix out? Is this in the userland dtrace tools? I.e. could a user build their own patched dtrace with this fix, or do they have to wait for a new 10.5.x or even 10.6 update of the OS? I''m wondering whether it would be worthwhile to propose the PythonApp workaround, or something similar, in the upstream sources. -- Robert Kern "I have come to believe that the whole world is an enigma, a harmless enigma that is made terrible by our own mad attempt to interpret it as though it had an underlying truth." -- Umberto Eco