<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Chris Gerhard&#039;s Blog</title>
	<atom:link href="http://chrisgerhard.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://chrisgerhard.wordpress.com</link>
	<description>The . in ...--- ...</description>
	<lastBuildDate>Fri, 24 Jul 2009 08:13:08 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='chrisgerhard.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/5704467dd0abeedeeae80163b82db874?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Chris Gerhard&#039;s Blog</title>
		<link>http://chrisgerhard.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://chrisgerhard.wordpress.com/osd.xml" title="Chris Gerhard&#039;s Blog" />
		<item>
		<title>gethrtime and the real time of day</title>
		<link>http://chrisgerhard.wordpress.com/2009/07/24/gethrtime-and-the-real-time-of-day/</link>
		<comments>http://chrisgerhard.wordpress.com/2009/07/24/gethrtime-and-the-real-time-of-day/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 08:13:08 +0000</pubDate>
		<dc:creator>chrisgerhard</dc:creator>
				<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://chrisgerhard.wordpress.com/2009/07/24/gethrtime-and-the-real-time-of-day/</guid>
		<description><![CDATA[Seeing Katsumi
Inoue blogging about Oracle 10g reporting timestamps using the
output from gethrtime() reminded me that I have had on occasion
wished I had a log to map hrtime to the current time. As Katsumi
points out the output of gethrtime() is not absolutely tied to the
current time. So there is no way to take the output from [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=1021&subd=chrisgerhard&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><P>Seeing <A HREF="http://blogs.sun.com/LetTheSunShineIn/entry/gethrtime_usage_in_oracle_10g1">Katsumi<br />
Inoue</A> blogging about Oracle 10g reporting timestamps using the<br />
output from gethrtime() reminded me that I have had on occasion<br />
wished I had a log to map hrtime to the current time. As Katsumi<br />
points out the output of gethrtime() is not absolutely tied to the<br />
current time. So there is no way to take the output from it and tell<br />
when in real time the output was generated unless you have some<br />
reference point. To make things more complex the output is reset each<br />
time the system reboots.</P><br />
<P>For this reason it is useful to keep a file that contains a<br />
history of the hrtime and the real time so that any logs can be<br />
retrospectively coerced back into a readable format.</P><br />
<P>There are lots of ways to do this but since on this blog we seem<br />
to be in Dtrace mode here is how using dtrace</P><br />
<PRE STYLE="margin-left: 0.79in">pfexec /usr/sbin/dtrace -o /var/log/hrtime.log -qn &#8216;BEGIN,tick-1hour,END {<br />
printf(&quot;%d:%d.%9.9d:%Y\n&quot;,<br />
timestamp, walltimestamp/1000000000,<br />
walltimestamp%1000000000, walltimestamp);<br />
}&#8217;<br />
</PRE><P STYLE="margin-bottom: 0in"><br />
<BR><br />
</P><br />
<P STYLE="margin-bottom: 0in">Then you get a nice file that contains<br />
three columns. The hrtime, the time in seconds since January 1<SUP>st</SUP><br />
1970 and a human readable representation of the time in the current<br />
timezone:</P><br />
<PRE STYLE="margin-left: 0.79in">: s4u-10-gmp03.eu TS 39 $; cat /var/log/hrtime.log<br />
5638545510919736:1248443226.350000625:2009 Jul 24 14:47:06<br />
5642145449325180:1248446826.279995332:2009 Jul 24 15:47:06<br />
</PRE><P STYLE="margin-bottom: 0in"><br />
I have to confess however that using Dtrace for this does not feel<br />
right, not least as you need to be root for this to be reliable  and<br />
also  the C code is trivial to write, compile and run from cron and<br />
send the output to syslog:</P><br />
<PRE STYLE="margin-left: 0.79in">: exdev.eu FSS 39 $; cat  ./gethrtime_base.c<br />
#include &lt;sys/time.h&gt;<br />
#include &lt;stdio.h&gt;<br />
int<br />
main(int argc, char **argv)<br />
{<br />
hrtime_t hrt = gethrtime();<br />
struct timeval tv;<br />
gettimeofday(&amp;tv, NULL);<br />
printf(&quot;%lld:%d.%6.6d:%s&quot;, hrt, tv.tv_sec, tv.tv_usec,<br />
ctime(&amp;tv.tv_sec));<br />
}<br />
: exdev.eu FSS 40 $; make ./gethrtime_base<br />
cc    -o gethrtime_base gethrtime_base.c<br />
: exdev.eu FSS 41 $;  ./gethrtime_base<br />
11013365852133078:1248444379.163215:Fri Jul 24 15:06:19 2009<br />
: exdev.eu FSS 42 $;<br />
./gethrtime_base | logger -p daemon.notice -t hrtime<br />
: exdev.eu FSS 43 $;  tail -10 /var/adm/messages | grep hrtime<br />
Jul 24 15:32:33 exdev hrtime: [ID 702911 daemon.notice] 11014939896174861:1248445953.109855:Fri Jul 24 15:32:33 2009<br />
Jul 24 16:09:21 exdev hrtime: [ID 702911 daemon.notice] 11017148054584749:1248448161.131675:Fri Jul 24 16:09:21 2009<br />
: exdev.eu FSS 50 $;<br />
</PRE></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisgerhard.wordpress.com/1021/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisgerhard.wordpress.com/1021/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisgerhard.wordpress.com/1021/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisgerhard.wordpress.com/1021/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisgerhard.wordpress.com/1021/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisgerhard.wordpress.com/1021/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisgerhard.wordpress.com/1021/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisgerhard.wordpress.com/1021/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisgerhard.wordpress.com/1021/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisgerhard.wordpress.com/1021/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=1021&subd=chrisgerhard&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chrisgerhard.wordpress.com/2009/07/24/gethrtime-and-the-real-time-of-day/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6780cba6f47fadebb85a3051ca1b05f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chrisgerhard</media:title>
		</media:content>
	</item>
		<item>
		<title>1,784,593 the highest load average ever?</title>
		<link>http://chrisgerhard.wordpress.com/2009/07/22/1784593-the-highest-load-average-ever/</link>
		<comments>http://chrisgerhard.wordpress.com/2009/07/22/1784593-the-highest-load-average-ever/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 03:48:52 +0000</pubDate>
		<dc:creator>chrisgerhard</dc:creator>
				<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://chrisgerhard.wordpress.com/2009/07/22/1784593-the-highest-load-average-ever/</guid>
		<description><![CDATA[As I cycled home I realised there was one more thing I could do on
the exploring the limits of threads and processes on Solaris. That
would be the highest load average ever. Modifying the thread creator
program to not have each thread sleep once started but instead wait
until all the threads were set up and then go [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=1022&subd=chrisgerhard&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><P>As I cycled home I realised there was one more thing I could do on<br />
the exploring the limits of threads and processes on Solaris. That<br />
would be the highest load average ever. Modifying the thread creator<br />
program to not have each thread sleep once started but instead wait<br />
until all the threads were set up and then go into an infinite<br />
compute loop that should get me the highest load average possible on<br />
a system or so you would think.</P><br />
<P STYLE="margin-bottom: 0in">With 784001 threads the load stabilised<br />
at:</P><br />
<PRE STYLE="margin-left: 0.79in">10:16am  up 18:07,  2 users,  load average: 22114.50, 22022.68, 21245.781</PRE><P STYLE="margin-bottom: 0in"><br />
Which was somewhat disappointing. However an earlier run with just<br />
780,000 threads managed to peak the load at 1,784,593 while it was<br />
exiting:</P><br />
<PRE STYLE="margin-left: 0.79in"> 7:44am  up 15:35,  2 users,  load average: 1724593.79, 477392.80, 188985.10</PRE><P STYLE="margin-bottom: 0in"><br />
I&#8217; still pondering how 780000 thread can result in a load average of<br />
more than 1 million.</P></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisgerhard.wordpress.com/1022/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisgerhard.wordpress.com/1022/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisgerhard.wordpress.com/1022/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisgerhard.wordpress.com/1022/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisgerhard.wordpress.com/1022/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisgerhard.wordpress.com/1022/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisgerhard.wordpress.com/1022/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisgerhard.wordpress.com/1022/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisgerhard.wordpress.com/1022/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisgerhard.wordpress.com/1022/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=1022&subd=chrisgerhard&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chrisgerhard.wordpress.com/2009/07/22/1784593-the-highest-load-average-ever/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6780cba6f47fadebb85a3051ca1b05f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chrisgerhard</media:title>
		</media:content>
	</item>
		<item>
		<title>784972 threads in a process</title>
		<link>http://chrisgerhard.wordpress.com/2009/07/19/784972-threads-in-a-process/</link>
		<comments>http://chrisgerhard.wordpress.com/2009/07/19/784972-threads-in-a-process/#comments</comments>
		<pubDate>Sun, 19 Jul 2009 11:24:04 +0000</pubDate>
		<dc:creator>chrisgerhard</dc:creator>
				<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://chrisgerhard.wordpress.com/2009/07/19/784972-threads-in-a-process/</guid>
		<description><![CDATA[After the surprise interest in the maximum
number of processes on a system it seems rude not to try and see
how many threads I can squeeze into a single process while I have
access to a system where physical memory will not be the limiting
factor. The expectation is that this will closely match the number of
processes as [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=1023&subd=chrisgerhard&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><P>After the surprise interest in the <A HREF="http://blogs.sun.com/chrisg/entry/784956_processes">maximum<br />
number of processes</A> on a system it seems rude not to try and see<br />
how many threads I can squeeze into a single process while I have<br />
access to a system where physical memory will not be the limiting<br />
factor. The expectation is that this will closely match the number of<br />
processes as each thread will have an LWP in the kernel which will in<br />
turn consume the segkp.<br />
</P><br />
<P>A slight modification to the forker program:</P><br />
<PRE STYLE="margin-left: 0.79in">: exdev.eu FSS 62 $; cat thr_creater.c<br />
#include &lt;stdio.h&gt;<br />
#include &lt;stdlib.h&gt;<br />
#include &lt;sys/types.h&gt;<br />
#include &lt;unistd.h&gt;<br />
#include &lt;thread.h&gt;<br />
int<br />
main(int argc, char **argv)<br />
{<br />
pid_t pid;<br />
int count=0;<br />
while(count &lt; (argc != 2 ? 100 : atoi(argv[1])) &amp;&amp;<br />
(pid = thr_create(NULL, 0, (void * (*)(void *))pause,<br />
NULL, THR_DETACHED, NULL)) != -1) {<br />
if (pid == 0 ) {<br />
/* Success, ) */<br />
if (count % 1000 == 0)<br />
printf(&quot;%d\n&quot;, count);<br />
count++;<br />
}<br />
}<br />
if (pid &lt; 0)<br />
perror(&quot;fork&quot;);<br />
printf(&quot;%d\n&quot;, count);<br />
pause();<br />
}</PRE><P STYLE="margin-bottom: 0in"><br />
and this time it has to be built as a 64 bit program:</P><br />
<PRE STYLE="margin-left: 0.79in"># make &quot;CFLAGS=-m64 -mt&quot; thr_creater<br />
#</PRE><P STYLE="margin-bottom: 0in"><br />
Here is how it went:</P><br />
<PRE STYLE="margin-left: 0.79in">$; ./thr_creater 1000000<br />
01000<br />
2000<br />
3000<br />
4000<br />
5000<br />
6000<br />
7000<br />
8000<br />
9000<br />
10000<br />
11000<br />
12000<br />
13000<br />
14000<br />
15000<br />
&#8230;..<br />
782000<br />
783000<br />
784000</PRE><P STYLE="margin-bottom: 0in"><br />
Here things have stopped and for some bizarre reason attaching a<br />
debugger to see what is going on does not seem to be a good idea. I<br />
had prstat running in another window and it reported:</P><br />
<P STYLE="margin-bottom: 0in"><BR><br />
</P><br />
<PRE STYLE="margin-left: 0.79in; margin-bottom: 0.2in">  2336 cg13442  7158M 7157M cpu73    0    0   1:42:59 1.6% thr_creater/784970</PRE><P STYLE="margin-bottom: 0in"><br />
Which is just a few more threads than I got processes (784956) when<br />
running in multi user. However at this point the system is pretty<br />
much a warm brick as if I exit any process thr_creater hoovers up the<br />
process so I can create no more. Fortunately I had realized this<br />
would happen and had some sleep(1) processes running so I could pause<br />
the thr_creater and then kill one of the sleeps to allow me to run a<br />
command:</P><br />
<PRE STYLE="margin-left: 0.79in">$; ps -o pid,vsz,rss,nlwp,comm -p 2336<br />
PID  VSZ  RSS NLWP COMMAND<br />
2336 7329704 7329248 784972 ./thr_creater<br />
</PRE><P STYLE="margin-bottom: 0in"><br />
as you can see it managed to get another two threads created since<br />
the prstat exited.</P></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisgerhard.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisgerhard.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisgerhard.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisgerhard.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisgerhard.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisgerhard.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisgerhard.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisgerhard.wordpress.com/1023/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisgerhard.wordpress.com/1023/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisgerhard.wordpress.com/1023/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=1023&subd=chrisgerhard&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chrisgerhard.wordpress.com/2009/07/19/784972-threads-in-a-process/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6780cba6f47fadebb85a3051ca1b05f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chrisgerhard</media:title>
		</media:content>
	</item>
		<item>
		<title>Cycle helmets or brakes</title>
		<link>http://chrisgerhard.wordpress.com/2009/07/18/cycle-helmets-or-brakes/</link>
		<comments>http://chrisgerhard.wordpress.com/2009/07/18/cycle-helmets-or-brakes/#comments</comments>
		<pubDate>Sat, 18 Jul 2009 04:52:12 +0000</pubDate>
		<dc:creator>chrisgerhard</dc:creator>
				<category><![CDATA[Cycling]]></category>

		<guid isPermaLink="false">http://chrisgerhard.wordpress.com/2009/07/18/cycle-helmets-or-brakes/</guid>
		<description><![CDATA[I&#8217;ve just straightened the rear wheel on the bike of a friend of
my daughter and while I was at it checked over the rest of the bike.
This leads to my top tip for parents of children who cycle (which IMO
should be every parent of an able bodied child).
Before you start worrying about whether your child [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=1024&subd=chrisgerhard&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><P>I&#8217;ve just straightened the rear wheel on the bike of a friend of<br />
my daughter and while I was at it checked over the rest of the bike.<br />
This leads to my top tip for parents of children who cycle (which IMO<br />
should be every parent of an able bodied child).</P><br />
<P>Before you start worrying about whether your child is or is not<br />
wearing a helmet<A CLASS="sdfootnoteanc" NAME="sdfootnote1anc" HREF="#sdfootnote1sym"><SUP>1</SUP></A><br />
make sure that the brakes on their bike work. Not just when the bike<br />
is new but regularly.</P><br />
<DIV ID="sdfootnote1"><br />
<P CLASS="sdfootnote"><A CLASS="sdfootnotesym" NAME="sdfootnote1sym" HREF="#sdfootnote1anc">1</A>See<br />
<A HREF="http://cyclehelmets.org/">http://cyclehelmets.org</A> for<br />
whether you should worry about that at all.</P><br />
</DIV></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisgerhard.wordpress.com/1024/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisgerhard.wordpress.com/1024/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisgerhard.wordpress.com/1024/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisgerhard.wordpress.com/1024/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisgerhard.wordpress.com/1024/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisgerhard.wordpress.com/1024/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisgerhard.wordpress.com/1024/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisgerhard.wordpress.com/1024/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisgerhard.wordpress.com/1024/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisgerhard.wordpress.com/1024/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=1024&subd=chrisgerhard&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chrisgerhard.wordpress.com/2009/07/18/cycle-helmets-or-brakes/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6780cba6f47fadebb85a3051ca1b05f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chrisgerhard</media:title>
		</media:content>
	</item>
		<item>
		<title>10 Steps to OpenSolaris Laptop Heaven</title>
		<link>http://chrisgerhard.wordpress.com/2009/07/17/10-steps-to-opensolaris-laptop-heaven/</link>
		<comments>http://chrisgerhard.wordpress.com/2009/07/17/10-steps-to-opensolaris-laptop-heaven/#comments</comments>
		<pubDate>Fri, 17 Jul 2009 01:42:06 +0000</pubDate>
		<dc:creator>chrisgerhard</dc:creator>
				<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://chrisgerhard.wordpress.com/2009/07/17/10-steps-to-opensolaris-laptop-heaven/</guid>
		<description><![CDATA[If you have recently come into possession of a Laptop onto which
to load Solaris then here are my top tips:

Install OpenSolaris.
At the time of writing the release is 2009.06, install that, parts
of this advice may become obsolete with later releases. Do not
install Solaris 10 or even worse Nevada. You should download the
live CD and burn [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=5&subd=chrisgerhard&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><P>If you have recently come into possession of a Laptop onto which<br />
to load Solaris then here are my top tips:</P><br />
<OL><br />
<LI><P>Install <A HREF="http://opensolaris.org/os/downloads/">OpenSolaris</A>.<br />
At the time of writing the release is 2009.06, install that, parts<br />
of this advice may become obsolete with later releases. Do not<br />
install Solaris 10 or even worse Nevada. You should download the<br />
live CD and burn it onto a disk boot that and let it install but<br />
before you start the install read the next tip.</P><br />
<LI><P>Before you start the install open a terminal so that you can<br />
turn on compression on the root pool once it it created. You have to<br />
keep running &ldquo;zpool list&rdquo; until you see the pool is<br />
created and then run (pfexec zfs set compression=on rpool). You may<br />
think that disk is big but after a few months you will be needing<br />
every block you can get. Also laptop drives are so slow that<br />
compression will probably make things faster.</P><br />
<LI><P>Before you do anything after installation take a snapshot of<br />
the system so you can always go back (pfexec beadm create<br />
<A HREF="mailto:opensolaris@initialinstall">opensolaris@initialinstall</A>).<br />
I really mean this.</P><br />
<LI><P>Add the extras repository. It contains virtualbox, the flash<br />
plugin for firefox, true type fonts and more. All you need is a sun<br />
online account. See <A HREF="https://pkg.sun.com/register/">https://pkg.sun.com/register/</A><br />
and<br />
<A HREF="http://blogs.sun.com/chrisg/entry/installing_support_certificates_in_opensolaris">http://blogs.sun.com/chrisg/entry/installing_support_certificates_in_opensolaris</A><br />
</P><br />
<LI><P>Decide whether you want to use the development or support<br />
repository. If in doubt choose the supported one. Sun employees get<br />
access to the support repository. Customers need to get a support<br />
contract. (<A HREF="http://www.opensolaris.com/learn/subscriptions/">http://www.opensolaris.com/learn/subscriptions/</A>).<br />
Then update to the latest bigs (pfexec pkg image-update).</P><br />
<LI><P>Add any extra packages you need. Since I am now writing this<br />
retrospectively there may be things missing. My starting list is:</P><br />
<UL><br />
<LI><P>OpenOffice (pfexec pkg install openoffice)</P><br />
<LI><P>SunStudio (pfexec pkg install sunstudioexpress)</P><br />
<LI><P>Netbeans (pfexec pkg install netbeans)</P><br />
<LI><P>Flash (pkfexec pkg install flash)</P><br />
<LI><P>Virtualbox (pfexec pkg install virtualbox)</P><br />
<LI><P>TrueType fonts (pfxec pkg install ttf-fonts-core)</P><br />
</UL><br />
<LI><P>If you are a Sun Employee install the punchin packages so you<br />
can access SWAN. I actually rarely use this as I have a Solaris 10<br />
virtualbox image that I use for punchin so I can be both on and off<br />
SWAN at the same time but it is good to have the option.</P><br />
<LI><P>Add you keys to firefox so that you can browse the extras and<br />
support repositories from firefox. See<br />
<A HREF="http://wikis.sun.com/display/OpenSolarisInfo200906/How+to+Browse+the+Support+and+Extra+Repositories">http://wikis.sun.com/display/OpenSolarisInfo200906/How+to+Browse+the+Support+and+Extra+Repositories</A>.</P><br />
<LI><P>Go to <A HREF="http://www.fluendo.com/shop/product/fluendo-mp3-decoder/">Fluendo</A><br />
and get and install the free mp3 decoder. They also sell a complete<br />
and legal set of decoders for the major video formats, I have them<br />
and have been very happy with them. They allow me to view the videos<br />
I have cycling events.</P><br />
<LI><P>Got to <A HREF="http://get.adobe.com/reader/">Adobe</A> and<br />
get acroread. I live in hope that at some point this will be in a<br />
repository either at Sun or one Adobe runs so that it can be<br />
installed using the standard pkg commands but until then do it by<br />
hand.</P><br />
</OL><br />
<P>Enjoy.</P></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisgerhard.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisgerhard.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisgerhard.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisgerhard.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisgerhard.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisgerhard.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisgerhard.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisgerhard.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisgerhard.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisgerhard.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=5&subd=chrisgerhard&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chrisgerhard.wordpress.com/2009/07/17/10-steps-to-opensolaris-laptop-heaven/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6780cba6f47fadebb85a3051ca1b05f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chrisgerhard</media:title>
		</media:content>
	</item>
		<item>
		<title>784956 Processes</title>
		<link>http://chrisgerhard.wordpress.com/2009/07/16/784956-processes/</link>
		<comments>http://chrisgerhard.wordpress.com/2009/07/16/784956-processes/#comments</comments>
		<pubDate>Thu, 16 Jul 2009 07:46:21 +0000</pubDate>
		<dc:creator>chrisgerhard</dc:creator>
				<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://chrisgerhard.wordpress.com/2009/07/16/784956-processes/</guid>
		<description><![CDATA[This week we had a customer claiming that they were unable to
create more then 60,000 processes.  This turned out to be due to them
tuning max_nproc, maxuprc and maxpid but not setting segkpsize
so the system would run out of &#8220;memory&#8221; before it ran
into the resource limits for process.
Tuning  segkpsize to 8G resolved it but [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=6&subd=chrisgerhard&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><P>This week we had a customer claiming that they were unable to<br />
create more then 60,000 processes.  This turned out to be due to them<br />
tuning max_nproc, maxuprc and maxpid but not setting <A HREF="http://docs.sun.com/app/docs/doc/819-2724/chapter2-150?a=view">segkpsize</A><br />
so the system would run out of &ldquo;memory&rdquo; before it ran<br />
into the resource limits for process.</P><br />
<P>Tuning  segkpsize to 8G resolved it but I just had to see how many<br />
processes I could get running on an M8000.</P><br />
<P>Using these settings in /etc/system:</P><br />
<PRE STYLE="margin-left: 0.79in">set segkpsize=0&#215;300000<br />
set pidmax=999999<br />
set maxuprc=999990<br />
set max_nprocs=999999<br />
</PRE><P STYLE="margin-bottom: 0in"><br />
and a simple forker program:</P><br />
<PRE STYLE="margin-left: 0.79in">#include &lt;stdio.h&gt;<br />
#include &lt;stdlib.h&gt;<br />
#include &lt;sys/types.h&gt;<br />
#include &lt;unistd.h&gt;<br />
int<br />
main(int argc, char **argv)<br />
{<br />
pid_t pid;<br />
int count=0;<br />
while(count &lt; argc == 2 ? 100 : atoi(argv[1]) &amp;&amp;<br />
(pid = fork()) != -1) {<br />
if (pid != 0 ) {<br />
/* Parent */<br />
if (count % 1000 == 0)<br />
printf(&quot;%d\n&quot;, count);<br />
count++;<br />
} else {<br />
pause();<br />
exit(0);<br />
}<br />
}<br />
if (pid &lt; 0)<br />
perror(&quot;fork&quot;);<br />
printf(&quot;%d\n&quot;, count);<br />
}</PRE><P STYLE="margin-bottom: 0in"><br />
I was slightly disappointed at the result:</P><br />
<P STYLE="margin-bottom: 0in"><BR><br />
</P><br />
<PRE STYLE="margin-left: 0.79in">$ ./forker 100000<br />
1000<br />
2000<br />
3000<br />
&#8230;..<br />
782000<br />
783000<br />
784000<br />
fork: Resource temporarily unavailable<br />
784956<br />
$</PRE><P STYLE="margin-bottom: 0in"><br />
Only 784956 processes, plus the ones already running when the system<br />
booted. Trying to count them with ps obviously fails but mdb gives<br />
the real count.</P><br />
<PRE STYLE="margin-left: 0.79in"># ps -e| wc<br />
ksh: cannot fork: too many processes<br />
#<br />
# echo nproc::print -d | mdb -k<br />
0t785025<br />
# </PRE><P STYLE="margin-bottom: 0in"><br />
Someone must have managed to get more.</P></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisgerhard.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisgerhard.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisgerhard.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisgerhard.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisgerhard.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisgerhard.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisgerhard.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisgerhard.wordpress.com/6/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisgerhard.wordpress.com/6/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisgerhard.wordpress.com/6/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=6&subd=chrisgerhard&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chrisgerhard.wordpress.com/2009/07/16/784956-processes/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6780cba6f47fadebb85a3051ca1b05f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chrisgerhard</media:title>
		</media:content>
	</item>
		<item>
		<title>Cycling route from Farnborough Main to the Sun Office</title>
		<link>http://chrisgerhard.wordpress.com/2009/07/13/cycling-route-from-farnborough-main-to-the-sun-office/</link>
		<comments>http://chrisgerhard.wordpress.com/2009/07/13/cycling-route-from-farnborough-main-to-the-sun-office/#comments</comments>
		<pubDate>Mon, 13 Jul 2009 06:49:01 +0000</pubDate>
		<dc:creator>chrisgerhard</dc:creator>
				<category><![CDATA[Cycling]]></category>

		<guid isPermaLink="false">http://chrisgerhard.wordpress.com/2009/07/13/cycling-route-from-farnborough-main-to-the-sun-office/</guid>
		<description><![CDATA[In case anyone wanted to cycle from Farnborough Main railway
station to the Sun Microsystems offices at Guillemont Park here is
the route I take.
View Larger Map

       <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=7&subd=chrisgerhard&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><P>In case anyone wanted to cycle from Farnborough Main railway<br />
station to the Sun Microsystems offices at Guillemont Park here is<br />
the route I take.</P><br />
<P><iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://maps.google.co.uk/maps?f=d&amp;source=s_d&amp;saddr=Guillemont Park, Blackwater and Hawley, Hampshire GU17 9, United Kingdom&amp;daddr=Minley Rd to:Minley Rd to:Minley Rd to:W Heath Rd to:51.296169,-0.755568&amp;geocode=FT_dDgMdP-Pz_w;FcDTDgMdzOXz_w;FcLMDgMdBu3z_w;FRPBDgMd6gz0_w;FVe-DgMdgVH0_w;&amp;hl=en&amp;mra=dme&amp;mrcr=0&amp;mrsp=5&amp;sz=14&amp;via=1,2,3,4&amp;dirflg=w&amp;sll=51.29692,-0.769215&amp;sspn=0.025385,0.076132&amp;ie=UTF8&amp;ll=51.296008,-0.761662&amp;spn=0.025385,0.076132&amp;output=embed"></iframe><br /><small><a href="http://maps.google.co.uk/maps?f=d&amp;source=s_d&amp;saddr=Guillemont Park, Blackwater and Hawley, Hampshire GU17 9, United Kingdom&amp;daddr=Minley Rd to:Minley Rd to:Minley Rd to:W Heath Rd to:51.296169,-0.755568&amp;geocode=FT_dDgMdP-Pz_w;FcDTDgMdzOXz_w;FcLMDgMdBu3z_w;FRPBDgMd6gz0_w;FVe-DgMdgVH0_w;&amp;hl=en&amp;mra=dme&amp;mrcr=0&amp;mrsp=5&amp;sz=14&amp;via=1,2,3,4&amp;dirflg=w&amp;sll=51.29692,-0.769215&amp;sspn=0.025385,0.076132&amp;ie=UTF8&amp;ll=51.296008,-0.761662&amp;spn=0.025385,0.076132&amp;source=embed" style="color:#0000FF;text-align:left">View Larger Map</a></small><br />
</P></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisgerhard.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisgerhard.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisgerhard.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisgerhard.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisgerhard.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisgerhard.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisgerhard.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisgerhard.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisgerhard.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisgerhard.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=7&subd=chrisgerhard&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chrisgerhard.wordpress.com/2009/07/13/cycling-route-from-farnborough-main-to-the-sun-office/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6780cba6f47fadebb85a3051ca1b05f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chrisgerhard</media:title>
		</media:content>
	</item>
		<item>
		<title>Using dtrace to track down memory leaks</title>
		<link>http://chrisgerhard.wordpress.com/2009/06/30/using-dtrace-to-track-down-memory-leaks/</link>
		<comments>http://chrisgerhard.wordpress.com/2009/06/30/using-dtrace-to-track-down-memory-leaks/#comments</comments>
		<pubDate>Tue, 30 Jun 2009 04:14:33 +0000</pubDate>
		<dc:creator>chrisgerhard</dc:creator>
				<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://chrisgerhard.wordpress.com/2009/06/30/using-dtrace-to-track-down-memory-leaks/</guid>
		<description><![CDATA[I&#8217;ve been working with a customer to try and find a memory &#8220;leak&#8221;
in their application. Many things have been tried, libumem, and the
mdb ::findleaks command all with no success.
So I was, as I am sure others before me have, pondering if you
could use dtrace to do this. Well I think you can. I have a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=8&subd=chrisgerhard&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><P>I&#8217;ve been working with a customer to try and find a memory &ldquo;leak&rdquo;<br />
in their application. Many things have been tried, libumem, and the<br />
mdb ::findleaks command all with no success.</P><br />
<P>So I was, as I am sure others before me have, pondering if you<br />
could use dtrace to do this. Well I think you can. I have a script<br />
that  puts probes into malloc et al and counts how often they are<br />
called  by this thread and when they are freed often free is called.</P><br />
<P>Then in the entry probe of the target application note away how<br />
many calls there have been to the allocators and how many to free and<br />
with a bit of care realloc. Then in the return probe compare the<br />
number of calls to  allocate and free with the saved values and<br />
aggregate the results. The principle is that you find the routines<br />
that are resulting in allocations that they don&#8217;t clear up.  This<br />
should give you a list of functions that are possible leakers which<br />
you can then investigate<A CLASS="sdfootnoteanc" NAME="sdfootnote1anc" HREF="#sdfootnote1sym"><SUP>1</SUP></A>.</P><br />
<P>Using the same technique I for getting dtrace to &ldquo;follow<br />
fork&rdquo; that I <A HREF="http://blogs.sun.com/chrisg/entry/follow_fork_for_dtrace_pid">described<br />
here</A> I ran this up on diskomizer, a program that I understand<br />
well and I&#8217;m reasonably sure does not have systemic memory leaks. The<br />
dtrace script reports three sets of results.<br />
</P><br />
<OL><br />
<LI><P>A count of how many times each routine and it&#8217;s descendents<br />
have called a memory allocator.</P><br />
<LI><P>A count of how many times each routine and it&#8217;s descendents<br />
have called free or realloc with a non NULL pointer as the first<br />
argument.</P><br />
<LI><P>The difference between the two numbers above.</P><br />
</OL><br />
<P>Then with a little bit of nawk to remove all the functions for<br />
which the counts are zero gives:</P><br />
<PRE STYLE="margin-left: 0.79in"># /usr/sbin/dtrace -Z -wD TARGET_OBJ=diskomizer<A CLASS="sdfootnoteanc" NAME="sdfootnote2anc" HREF="#sdfootnote2sym"><SUP>2</SUP></A> -o /tmp/out-us \<br />
-s /tmp/followfork.d \<br />
-Cs /tmp/allocated.d -c \<br />
&quot;/opt/SUNWstc-diskomizer/bin/sparcv9/diskomizer -f /devs -f background \<br />
-o background=0 -o SECONDS_TO_RUN=1800&quot;<br />
dtrace: failed to compile script /tmp/allocated.d: line 20: failed to create entry probe for &#8216;realloc&#8217;: No such process<br />
dtrace: buffer size lowered to 25m<br />
dtrace: buffer size lowered to 25m<br />
dtrace: buffer size lowered to 25m<br />
dtrace: buffer size lowered to 25m<br />
# nawk &#8216;$1 != 0 { print  $0 }&#8217; &lt; /tmp/out.3081<br />
allocations<br />
1 diskomizer`do_dev_control<br />
1 diskomizer`set_dev_state<br />
1 diskomizer`set_state<br />
3 diskomizer`report_exit_reason<br />
6 diskomizer`alloc_time_str<br />
6 diskomizer`alloc_time_str_fmt<br />
6 diskomizer`update_aio_read_stats<br />
7 diskomizer`cancel_all_io<br />
9 diskomizer`update_aio_write_stats<br />
13 diskomizer`cleanup<br />
15 diskomizer`update_aio_time_stats<br />
15 diskomizer`update_time_stats<br />
80 diskomizer`my_calloc<br />
240 diskomizer`init_read<br />
318 diskomizer`do_restart_stopped_devices<br />
318 diskomizer`start_io<br />
449 diskomizer`handle_write<br />
606 diskomizer`do_new_write<br />
2125 diskomizer`handle_read_then_write<br />
2561 diskomizer`init_buf<br />
2561 diskomizer`set_io_len<br />
58491 diskomizer`handle_read<br />
66255 diskomizer`handle_write_then_read<br />
124888 diskomizer`init_read_buf<br />
124897 diskomizer`do_new_read<br />
127460 diskomizer`expect_signal<br />
freecount<br />
1 diskomizer`expect_signal<br />
3 diskomizer`report_exit_reason<br />
4 diskomizer`close_and_free_paths<br />
6 diskomizer`update_aio_read_stats<br />
9 diskomizer`update_aio_write_stats<br />
11 diskomizer`cancel_all_io<br />
15 diskomizer`update_aio_time_stats<br />
15 diskomizer`update_time_stats<br />
17 diskomizer`cleanup<br />
160 diskomizer`init_read<br />
318 diskomizer`do_restart_stopped_devices<br />
318 diskomizer`start_io<br />
442 diskomizer`handle_write<br />
599 diskomizer`do_new_write<br />
2125 diskomizer`handle_read_then_write<br />
2560 diskomizer`init_buf<br />
2560 diskomizer`set_io_len<br />
58491 diskomizer`handle_read<br />
66246 diskomizer`handle_write_then_read<br />
124888 diskomizer`do_new_read<br />
124888 diskomizer`init_read_buf<br />
127448 diskomizer`cancel_expected_signal<br />
mismatch_count<br />
-127448 diskomizer`cancel_expected_signal<br />
-4 diskomizer`cancel_all_io<br />
-4 diskomizer`cleanup<br />
-4 diskomizer`close_and_free_paths<br />
1 diskomizer`do_dev_control<br />
1 diskomizer`init_buf<br />
1 diskomizer`set_dev_state<br />
1 diskomizer`set_io_len<br />
1 diskomizer`set_state<br />
6 diskomizer`alloc_time_str<br />
6 diskomizer`alloc_time_str_fmt<br />
7 diskomizer`do_new_write<br />
7 diskomizer`handle_write<br />
9 diskomizer`do_new_read<br />
9 diskomizer`handle_write_then_read<br />
80 diskomizer`init_read<br />
80 diskomizer`my_calloc<br />
127459 diskomizer`expect_signal<br />
#<br />
</PRE><P STYLE="margin-bottom: 0in"><br />
From the above you can see that there are two functions that create<br />
and free the majority of the allocations and the allocations almost<br />
match each other, which is expected as they are effectively<br />
constructor and destructor for each other. The small mismatch is not<br />
unexpected in this context.<br />
</P><br />
<P STYLE="margin-bottom: 0in">However it is the vast number of<br />
functions that are not listed at all as they and their children make<br />
no calls to the memory allocator or have exactly matching allocation<br />
and free that are important here. Those are the functions that we<br />
have just ruled out.</P><br />
<P STYLE="margin-bottom: 0in">From here it is easy now to drill down<br />
on the functions that are interesting you, ie the ones where there<br />
are unbalanced allocations.</P><br />
<P STYLE="margin-bottom: 0in"><BR><br />
</P><br />
<P STYLE="margin-bottom: 0in">I&#8217;ve uploaded the files <A HREF="http://chrisgerhard.wordpress.comdtrace/allocated.d">allocated.d</A><br />
and <A HREF="http://chrisgerhard.wordpress.comdtrace/followfork.d">followfork.d</A><br />
so you can see the details. If you find it useful then let me know.</P><br />
<DIV ID="sdfootnote1"><br />
<P CLASS="sdfootnote"><A CLASS="sdfootnotesym" NAME="sdfootnote1sym" HREF="#sdfootnote1anc">1</A>Unfortunately<br />
the list is longer than you want as on SPARC it includes any<br />
functions that don&#8217;t have their own stack frame due to the way<br />
dtrace calculates ustackdepth, which the script makes use of.<br />
</P><br />
</DIV><br />
<DIV ID="sdfootnote2"><br />
<P CLASS="sdfootnote"><A CLASS="sdfootnotesym" NAME="sdfootnote2sym" HREF="#sdfootnote2anc">2</A>The<br />
script only probes particular objects, in this case the main<br />
diskomizer binary, but you can limit it to a particular library or<br />
even a particular set of  entry points based on name if you edit the<br />
script.</P><br />
</DIV></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisgerhard.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisgerhard.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisgerhard.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisgerhard.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisgerhard.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisgerhard.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisgerhard.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisgerhard.wordpress.com/8/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisgerhard.wordpress.com/8/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisgerhard.wordpress.com/8/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=8&subd=chrisgerhard&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chrisgerhard.wordpress.com/2009/06/30/using-dtrace-to-track-down-memory-leaks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6780cba6f47fadebb85a3051ca1b05f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chrisgerhard</media:title>
		</media:content>
	</item>
		<item>
		<title>Follow fork for dtrace pid provider?</title>
		<link>http://chrisgerhard.wordpress.com/2009/06/27/follow-fork-for-dtrace-pid-provider/</link>
		<comments>http://chrisgerhard.wordpress.com/2009/06/27/follow-fork-for-dtrace-pid-provider/#comments</comments>
		<pubDate>Sat, 27 Jun 2009 05:25:52 +0000</pubDate>
		<dc:creator>chrisgerhard</dc:creator>
				<category><![CDATA[Solaris]]></category>

		<guid isPermaLink="false">http://chrisgerhard.wordpress.com/2009/06/27/follow-fork-for-dtrace-pid-provider/</guid>
		<description><![CDATA[There is a ongoing request to have follow fork functionality for
the dtrace pid provider but so far no one has stood upto the plate
for that RFE. In the mean time my best workaround for this is this:
cjg@brompton:~/lang/d$ cat followfork.d
proc:::start
/ppid == $target/
{
stop();
printf(&#34;fork %d\n&#34;, pid);
system(&#34;dtrace -qs child.d -p %d&#34;, pid);
}
cjg@brompton:~/lang/d$ cat child.d
pid$target::malloc:entry
{
printf(&#34;%d %s:%s %d\n&#34;, pid, probefunc, probename, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=9&subd=chrisgerhard&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><P>There is a ongoing request to have follow fork functionality for<br />
the dtrace pid provider but so far no one has stood upto the plate<br />
for that RFE. In the mean time my best workaround for this is this:</P><br />
<PRE STYLE="margin-left: 2cm">cjg@brompton:~/lang/d$ cat followfork.d<br />
proc:::start<br />
/ppid == $target/<br />
{<br />
stop();<br />
printf(&quot;fork %d\n&quot;, pid);<br />
system(&quot;dtrace -qs child.d -p %d&quot;, pid);<br />
}<br />
cjg@brompton:~/lang/d$ cat child.d<br />
pid$target::malloc:entry<br />
{<br />
printf(&quot;%d %s:%s %d\n&quot;, pid, probefunc, probename, ustackdepth)<br />
}<br />
cjg@brompton:~/lang/d$ pfexec /usr/sbin/dtrace -qws followfork.d -s child.d -p 26758<br />
26758 malloc:entry 22<br />
26758 malloc:entry 15<br />
26758 malloc:entry 18<br />
26758 malloc:entry 18<br />
26758 malloc:entry 18<br />
fork 27548<br />
27548 malloc:entry 7<br />
27548 malloc:entry 7<br />
27548 malloc:entry 18<br />
27548 malloc:entry 16<br />
27548 malloc:entry 18<br />
</PRE><P STYLE="margin-bottom: 0cm"><br />
Clearly you can have the child script do what ever you wish.</P><br />
<P>Better solutions are welcome!</P></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisgerhard.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisgerhard.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisgerhard.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisgerhard.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisgerhard.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisgerhard.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisgerhard.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisgerhard.wordpress.com/9/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisgerhard.wordpress.com/9/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisgerhard.wordpress.com/9/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=9&subd=chrisgerhard&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chrisgerhard.wordpress.com/2009/06/27/follow-fork-for-dtrace-pid-provider/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6780cba6f47fadebb85a3051ca1b05f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chrisgerhard</media:title>
		</media:content>
	</item>
		<item>
		<title>Why a fixie</title>
		<link>http://chrisgerhard.wordpress.com/2009/06/25/why-a-fixie/</link>
		<comments>http://chrisgerhard.wordpress.com/2009/06/25/why-a-fixie/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 14:02:38 +0000</pubDate>
		<dc:creator>chrisgerhard</dc:creator>
				<category><![CDATA[Cycling]]></category>

		<guid isPermaLink="false">http://chrisgerhard.wordpress.com/2009/06/25/why-a-fixie/</guid>
		<description><![CDATA[Why a fixie1?
A few people have asked
me this so here are the reasons for a fixie:

They are alleged to improve you pedaling.
They are supposed to make your legs stronger.
People say you are more in touch with the bike on a fixie
People say they are fun to ride. Quite why is hard to
understand why would this [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=10&subd=chrisgerhard&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><P>Why a fixie<A CLASS="sdfootnoteanc" NAME="sdfootnote1anc" HREF="#sdfootnote1sym"><SUP>1</SUP></A>?</P><br />
<P>A few people have <A HREF="http://blogs.sun.com/chrisg/entry/500_fixie_miles">asked</A><br />
me this so here are the reasons for a fixie:</P><br />
<UL><br />
<LI><P>They are alleged to improve you pedaling.</P><br />
<LI><P>They are supposed to make your legs stronger.</P><br />
<LI><P>People say you are more in touch with the bike on a fixie</P><br />
<LI><P>People say they are fun to ride. Quite why is hard to<br />
understand why would this be significantly different from just<br />
picking a gear and sticking to it. For a single speed bike with a<br />
free wheel I would agree except a single speed there is no way to<br />
give in up hills without getting off.</P><br />
</UL><br />
<P>My additional reasons were:</P><br />
<UL><br />
<LI><P>I had noticed I generally ride in 3 gears during the winter<br />
so wondered if I could make it on a single speed.</P><br />
<LI><P>Bike to work made it very affordable.</P><br />
<LI><P> <SPAN STYLE="font-style: normal">I  wanted one.</SPAN></P><br />
</UL><br />
<P><SPAN STYLE="font-style: normal">Now having one I agree they are<br />
fun more fun than I ever expected and even though I don&#8217;t think I<br />
have mastered it yet I do understand about it being in touch with the<br />
bike. Going up hill there is nowhere to hide I don&#8217;t know if it is<br />
making me stronger but it feels like it. </SPAN><br />
</P><br />
<P><SPAN STYLE="font-style: normal">It certainly has improved my<br />
ability to &#8220;spin&#8221;.</SPAN></P><br />
<DIV ID="sdfootnote1"><br />
<P CLASS="sdfootnote" STYLE="margin-left: 0in; text-indent: 0in"><A CLASS="sdfootnotesym" NAME="sdfootnote1sym" HREF="#sdfootnote1anc">1</A>Obvioulsy<br />
the answer that you can never have too many bikes I assume will not<br />
wash. Indeed I have that problem at home since the house rule is<br />
that I can only have three bikes. The brompton, luckily, does not<br />
count leaving some others. However since under UK law a bike that<br />
has no pedals is not a bike I only have three sets of pedals so I&#8217;m<br />
o.k.</P><br />
</DIV></p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chrisgerhard.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chrisgerhard.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/chrisgerhard.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/chrisgerhard.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/chrisgerhard.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/chrisgerhard.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/chrisgerhard.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/chrisgerhard.wordpress.com/10/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/chrisgerhard.wordpress.com/10/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/chrisgerhard.wordpress.com/10/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=chrisgerhard.wordpress.com&blog=8196535&post=10&subd=chrisgerhard&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://chrisgerhard.wordpress.com/2009/06/25/why-a-fixie/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/6780cba6f47fadebb85a3051ca1b05f2?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chrisgerhard</media:title>
		</media:content>
	</item>
	</channel>
</rss>