<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Objective-C:  Using dtrace to trace messages-to-nil</title>
	<atom:link href="http://www.friday.com/bbum/2008/01/03/objective-c-using-dtrace-to-trace-messages-to-nil/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.friday.com/bbum/2008/01/03/objective-c-using-dtrace-to-trace-messages-to-nil/</link>
	<description>...so google can index my head.</description>
	<lastBuildDate>Fri, 12 Mar 2010 13:55:08 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: bbum&#8217;s weblog-o-mat &#187; Blog Archive &#187; Objective-C: Printing Class Name from Dtrace</title>
		<link>http://www.friday.com/bbum/2008/01/03/objective-c-using-dtrace-to-trace-messages-to-nil/comment-page-1/#comment-184902</link>
		<dc:creator>bbum&#8217;s weblog-o-mat &#187; Blog Archive &#187; Objective-C: Printing Class Name from Dtrace</dc:creator>
		<pubDate>Sat, 26 Jan 2008 07:42:35 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2008/01/03/objective-c-using-dtrace-to-trace-messages-to-nil/#comment-184902</guid>
		<description>[...] and the name of the method that is about to be forwarded (Huge thanks to Daniel Delwood &#8212; who commented on this entry with something very very useful &#8212; for boatloads of help on [...]</description>
		<content:encoded><![CDATA[<p>[...] and the name of the method that is about to be forwarded (Huge thanks to Daniel Delwood &#8212; who commented on this entry with something very very useful &#8212; for boatloads of help on [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Daniel Delwood</title>
		<link>http://www.friday.com/bbum/2008/01/03/objective-c-using-dtrace-to-trace-messages-to-nil/comment-page-1/#comment-184432</link>
		<dc:creator>Daniel Delwood</dc:creator>
		<pubDate>Sat, 05 Jan 2008 01:32:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2008/01/03/objective-c-using-dtrace-to-trace-messages-to-nil/#comment-184432</guid>
		<description>It&#039;s also quite fun to drop the info in an aggregate to get an idea of how many messages there are from certain points in the app&#039;s code, as well as just checking the overall number of calls to each selector. Remove the printf() line if you don&#039;t care about seeing the events go by in real time. The index at the beginning of the events is because dtrace can report out of order data; with that index, you can always re-assemble the order of the nils to see if there&#039;s a chain you&#039;re interested in.

$ sudo dtrace -s nil.d -p 

File: &quot;nil.d&quot;
------
&lt;pre&gt;
#pragma D option quiet

BEGIN
{
        globalNilMsgIndex = 0;
        globalVtime = vtimestamp;
        globalWtime = walltimestamp;
}

pid$target::objc_msgSend:entry
/ arg0 == 0 /
{
        this-&gt;mIndex = ++globalNilMsgIndex;

        printf(&quot;%7d: [nil %s] (thread: %08x)\n&quot;, this-&gt;mIndex, copyinstr(arg1), tid);
        @nilAgg[ustack()] = count();
        @selCounter[copyinstr(arg1)] = count();
}

END
{
        printf(&quot;Nil-calling sites:\n&quot;);
        printa(@nilAgg);

        printf(&quot;Selectors frequently sent to nil:\n&quot;);
        printa(@selCounter);
}
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>It&#8217;s also quite fun to drop the info in an aggregate to get an idea of how many messages there are from certain points in the app&#8217;s code, as well as just checking the overall number of calls to each selector. Remove the printf() line if you don&#8217;t care about seeing the events go by in real time. The index at the beginning of the events is because dtrace can report out of order data; with that index, you can always re-assemble the order of the nils to see if there&#8217;s a chain you&#8217;re interested in.</p>
<p>$ sudo dtrace -s nil.d -p </p>
<p>File: &#8220;nil.d&#8221;<br />
&#8212;&#8212;</p>
<pre>
#pragma D option quiet

BEGIN
{
        globalNilMsgIndex = 0;
        globalVtime = vtimestamp;
        globalWtime = walltimestamp;
}

pid$target::objc_msgSend:entry
/ arg0 == 0 /
{
        this-&gt;mIndex = ++globalNilMsgIndex;

        printf("%7d: [nil %s] (thread: %08x)\n", this-&gt;mIndex, copyinstr(arg1), tid);
        @nilAgg[ustack()] = count();
        @selCounter[copyinstr(arg1)] = count();
}

END
{
        printf("Nil-calling sites:\n");
        printa(@nilAgg);

        printf("Selectors frequently sent to nil:\n");
        printa(@selCounter);
}
</pre>
]]></content:encoded>
	</item>
	<item>
		<title>By: bbum&#8217;s weblog-o-mat &#187; Blog Archive &#187; Objective-C: Using Instruments to trace messages-to-nil</title>
		<link>http://www.friday.com/bbum/2008/01/03/objective-c-using-dtrace-to-trace-messages-to-nil/comment-page-1/#comment-184413</link>
		<dc:creator>bbum&#8217;s weblog-o-mat &#187; Blog Archive &#187; Objective-C: Using Instruments to trace messages-to-nil</dc:creator>
		<pubDate>Fri, 04 Jan 2008 07:02:41 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2008/01/03/objective-c-using-dtrace-to-trace-messages-to-nil/#comment-184413</guid>
		<description>[...] This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.          Amazon.com Widgets  &#171; Objective-C: Using dtrace to trace messages-to-nil [...]</description>
		<content:encoded><![CDATA[<p>[...] This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 2.5 License.          Amazon.com Widgets  &laquo; Objective-C: Using dtrace to trace messages-to-nil [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Adrian Milliner</title>
		<link>http://www.friday.com/bbum/2008/01/03/objective-c-using-dtrace-to-trace-messages-to-nil/comment-page-1/#comment-184398</link>
		<dc:creator>Adrian Milliner</dc:creator>
		<pubDate>Thu, 03 Jan 2008 21:04:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2008/01/03/objective-c-using-dtrace-to-trace-messages-to-nil/#comment-184398</guid>
		<description>Cool, and great tip on &lt;code&gt; DYLD_SHARED_REGION&lt;/code&gt;. Thanks.</description>
		<content:encoded><![CDATA[<p>Cool, and great tip on <code> DYLD_SHARED_REGION</code>. Thanks.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Michael Tsai - Blog - Logging Messages to Nil</title>
		<link>http://www.friday.com/bbum/2008/01/03/objective-c-using-dtrace-to-trace-messages-to-nil/comment-page-1/#comment-184393</link>
		<dc:creator>Michael Tsai - Blog - Logging Messages to Nil</dc:creator>
		<pubDate>Thu, 03 Jan 2008 16:15:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2008/01/03/objective-c-using-dtrace-to-trace-messages-to-nil/#comment-184393</guid>
		<description>[...] Update: Bumgarner shows how to do the logging using Leopard&#8217;s DTrace. [...]</description>
		<content:encoded><![CDATA[<p>[...] Update: Bumgarner shows how to do the logging using Leopard&rsquo;s DTrace. [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Bryan Cantrill</title>
		<link>http://www.friday.com/bbum/2008/01/03/objective-c-using-dtrace-to-trace-messages-to-nil/comment-page-1/#comment-184390</link>
		<dc:creator>Bryan Cantrill</dc:creator>
		<pubDate>Thu, 03 Jan 2008 14:14:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.friday.com/bbum/2008/01/03/objective-c-using-dtrace-to-trace-messages-to-nil/#comment-184390</guid>
		<description>Great stuff -- and invaluable for Leopard DTrace users, I&#039;m sure.  Not sure if you&#039;ve seen this or not, but we&#039;re having a DTrace (un)conference in San Francisco in March, details of which are &lt;a href=&quot;http://blogs.sun.com/bmc/entry/announcing_dtrace_conf&quot;&gt;here&lt;/a&gt;.  The Apple DTrace team will be there, so this will be an excellent opportunity to both swap tips, and to talk about potential Leopard-specific issues and enhancements...</description>
		<content:encoded><![CDATA[<p>Great stuff &#8212; and invaluable for Leopard DTrace users, I&#8217;m sure.  Not sure if you&#8217;ve seen this or not, but we&#8217;re having a DTrace (un)conference in San Francisco in March, details of which are <a href="http://blogs.sun.com/bmc/entry/announcing_dtrace_conf">here</a>.  The Apple DTrace team will be there, so this will be an excellent opportunity to both swap tips, and to talk about potential Leopard-specific issues and enhancements&#8230;</p>
]]></content:encoded>
	</item>
</channel>
</rss>
