Tianzhou Chen
2008-Oct-05 04:58 UTC
[dtrace-discuss] How to put '':'' in function name to specify probe
Hi all, I write a method in Objective-C - (void)foo:(int)a; in class MyClass; and then try to fire the probe. So I try to write as follows: objc$target:MyClass:''I don''t know what to write here":entry since the method name in Objective-C is "foo:" ,which includes a ":" ,however ":" is reserved as the separator. Is there anyway that I can put a ":" other than as a separator? I know using wildcard would solve the problem, but it would be better if I can accurately specify the exact method name. I am a newbie to dtrace. Thanks for any help! -- This message posted from opensolaris.org
Adam Leventhal
2008-Oct-05 19:22 UTC
[dtrace-discuss] How to put '':'' in function name to specify probe
> I write a method in Objective-C - (void)foo:(int)a; in class > MyClass; and then try to fire the probe. So I try to write as follows: > objc$target:MyClass:''I don''t know what to write here":entry > > since the method name in Objective-C is "foo:" ,which includes a > ":" ,however ":" is reserved as the separator. Is there anyway that > I can put a ":" other than as a separator? I know using wildcard > would solve the problem, but it would be better if I can accurately > specify the exact method name.Since you''re using Objective-C, I''m going to guess that you''re on the Mac platform. If that''s the case, the folks at Apple have a special ''objc'' provider that''s documented in the dtrace(1) manpage in Mac OS X. If you''re on Solaris, you''ll need to use the mangled name as it would appear in the symbol table, and use that with the pid provider. Adam -- Adam Leventhal, Fishworks http://blogs.sun.com/ahl
Tianzhou Chen
2008-Oct-06 01:39 UTC
[dtrace-discuss] How to put '':'' in function name to specify
Yes, I use leopard. So I check the Manual and find an example: objc123::method?with?many?colons:entry The method method:with:many:colons in every class in process 123. (A ? wildcard must be used to match colon characters inside of Objective C method names, as they would otherwise be parsed as the provider field separators.) So according to the manual ,I think I can only use wildcard ''?'' to match ":" in the method name. After all ,dtrace is not designed for objective-c :-) Thanks Adam. -- This message posted from opensolaris.org