<?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/"
	xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule"	>
<channel>
	<title>Comments on: Reference count debugging with systemtap</title>
	<atom:link href="http://tecnocode.co.uk/2010/07/13/reference-count-debugging-with-systemtap/feed/" rel="self" type="application/rss+xml" />
	<link>http://tecnocode.co.uk/2010/07/13/reference-count-debugging-with-systemtap/</link>
	<description>Ramblings on computers…</description>
	<lastBuildDate>Fri, 20 Jan 2012 21:19:46 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
	<item>
		<title>By: iain</title>
		<link>http://tecnocode.co.uk/2010/07/13/reference-count-debugging-with-systemtap/comment-page-1/#comment-1044</link>
		<dc:creator>iain</dc:creator>
		<pubDate>Thu, 15 Jul 2010 00:16:25 +0000</pubDate>
		<guid isPermaLink="false">http://tecnocode.co.uk/?p=365#comment-1044</guid>
		<description>I did something similar by writing a valgrind plugin. The downside was that it was quite verbose, but with some filtering options it worked quite nicely. I meant to write a logfile analyser, but never got round to it and then found something else to do.</description>
		<content:encoded><![CDATA[<p>I did something similar by writing a valgrind plugin. The downside was that it was quite verbose, but with some filtering options it worked quite nicely. I meant to write a logfile analyser, but never got round to it and then found something else to do.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Eero Tamminen</title>
		<link>http://tecnocode.co.uk/2010/07/13/reference-count-debugging-with-systemtap/comment-page-1/#comment-1042</link>
		<dc:creator>Eero Tamminen</dc:creator>
		<pubDate>Wed, 14 Jul 2010 20:18:59 +0000</pubDate>
		<guid isPermaLink="false">http://tecnocode.co.uk/?p=365#comment-1042</guid>
		<description>&quot;The ability to set a maximum number of frames to print out in a backtrace would be useful, since I’ve found that I usually only need the first eight-or-so frames for this kind of work; any more frames just get in the way.&quot;

Fewer frames will also be faster, unwinding a lot of calls can get slow...</description>
		<content:encoded><![CDATA[<p>"The ability to set a maximum number of frames to print out in a backtrace would be useful, since I’ve found that I usually only need the first eight-or-so frames for this kind of work; any more frames just get in the way."</p>
<p>Fewer frames will also be faster, unwinding a lot of calls can get slow...</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philip Withnall</title>
		<link>http://tecnocode.co.uk/2010/07/13/reference-count-debugging-with-systemtap/comment-page-1/#comment-1040</link>
		<dc:creator>Philip Withnall</dc:creator>
		<pubDate>Wed, 14 Jul 2010 08:32:34 +0000</pubDate>
		<guid isPermaLink="false">http://tecnocode.co.uk/?p=365#comment-1040</guid>
		<description>For debugging reference count problems, usually just the function name is what I need. If systemtap can&#039;t figure out the function name, the module name would definitely be useful. Other than that, a line number would be the most useful thing, although I don&#039;t know how possible that is.

The ability to set a maximum number of frames to print out in a backtrace would be useful, since I&#039;ve found that I usually only need the first eight-or-so frames for this kind of work; any more frames just get in the way. It would be nice if the memory limit for each probe was raised as well (I guess there might currently be an option for it, but I haven&#039;t looked into it), since I ran into that when I was testing this out last night — seems that a particularly long backtrace made systemtap unhappy.

Thanks!</description>
		<content:encoded><![CDATA[<p>For debugging reference count problems, usually just the function name is what I need. If systemtap can't figure out the function name, the module name would definitely be useful. Other than that, a line number would be the most useful thing, although I don't know how possible that is.</p>
<p>The ability to set a maximum number of frames to print out in a backtrace would be useful, since I've found that I usually only need the first eight-or-so frames for this kind of work; any more frames just get in the way. It would be nice if the memory limit for each probe was raised as well (I guess there might currently be an option for it, but I haven't looked into it), since I ran into that when I was testing this out last night — seems that a particularly long backtrace made systemtap unhappy.</p>
<p>Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark Wielaard</title>
		<link>http://tecnocode.co.uk/2010/07/13/reference-count-debugging-with-systemtap/comment-page-1/#comment-1039</link>
		<dc:creator>Mark Wielaard</dc:creator>
		<pubDate>Wed, 14 Jul 2010 08:01:14 +0000</pubDate>
		<guid isPermaLink="false">http://tecnocode.co.uk/?p=365#comment-1039</guid>
		<description>Very cool!

So with the soon to be released SystemTap 1.3 you get two improvements that should make your life easier:
- A new --ldd switch, which directs stap to slurp in all libraries that a binary links against, so you can drop the large -d -d -d list and just do: stap --ldd -d &quot;${bindir}/empathy&quot; refs.stp -c &quot;${bindir}/empathy&quot;
- Some backtrace as string functions (sprint_[u]backtrace() and sprint_[u]stack()) which make the above trick Frank posted above even simpler (no need to convert by hand from hex addresses to symbols/modules, etc).

I see you are using the print_ubacktrace_brief() variant instead of the print_ubacktrace() variant. Personally I thought the brief variant was a mistake since it was &quot;too brief&quot; and we needed something in between. What kinds of information do you want/need in a backtrace? address, module name, symbol name, offsets, function size, ...? We might be able to provide something even more flexible. The internal systemtap _stp_addr_sprint() function can already provide all or nothing, prefixes, suffixes, etc. But this isn&#039;t exposed to the script level (and I admit I don&#039;t yet know how to do that naturally, you quickly end up in some printf like syntax which might be overkill).</description>
		<content:encoded><![CDATA[<p>Very cool!</p>
<p>So with the soon to be released SystemTap 1.3 you get two improvements that should make your life easier:<br />
- A new --ldd switch, which directs stap to slurp in all libraries that a binary links against, so you can drop the large -d -d -d list and just do: stap --ldd -d "${bindir}/empathy" refs.stp -c "${bindir}/empathy"<br />
- Some backtrace as string functions (sprint_[u]backtrace() and sprint_[u]stack()) which make the above trick Frank posted above even simpler (no need to convert by hand from hex addresses to symbols/modules, etc).</p>
<p>I see you are using the print_ubacktrace_brief() variant instead of the print_ubacktrace() variant. Personally I thought the brief variant was a mistake since it was "too brief" and we needed something in between. What kinds of information do you want/need in a backtrace? address, module name, symbol name, offsets, function size, ...? We might be able to provide something even more flexible. The internal systemtap _stp_addr_sprint() function can already provide all or nothing, prefixes, suffixes, etc. But this isn't exposed to the script level (and I admit I don't yet know how to do that naturally, you quickly end up in some printf like syntax which might be overkill).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Philip Withnall</title>
		<link>http://tecnocode.co.uk/2010/07/13/reference-count-debugging-with-systemtap/comment-page-1/#comment-1038</link>
		<dc:creator>Philip Withnall</dc:creator>
		<pubDate>Wed, 14 Jul 2010 07:28:41 +0000</pubDate>
		<guid isPermaLink="false">http://tecnocode.co.uk/?p=365#comment-1038</guid>
		<description>I&#039;ll have to try that out today, thanks.

Post updated re. the kernel-debuginfo package.</description>
		<content:encoded><![CDATA[<p>I'll have to try that out today, thanks.</p>
<p>Post updated re. the kernel-debuginfo package.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Frank Ch. Eigler</title>
		<link>http://tecnocode.co.uk/2010/07/13/reference-count-debugging-with-systemtap/comment-page-1/#comment-1034</link>
		<dc:creator>Frank Ch. Eigler</dc:creator>
		<pubDate>Wed, 14 Jul 2010 00:54:34 +0000</pubDate>
		<guid isPermaLink="false">http://tecnocode.co.uk/?p=365#comment-1034</guid>
		<description>How to indent based upon the nearby refcount variable?  For the header lines,

		printf (&quot;%-*s %s %p ref (%u)\n&quot;, refcount, &quot;&quot;, type, object, refcount)

(see the %-*s part).  For indenting the print_*backtrace() ... not quite so easy, since
each line would need to be manipulated.  But something like this could work:

              bt = ubacktrace()  # results in a string of hex addresses
              addr = tokenize(bt, &quot; &quot;)
              while (addr != &quot;&quot;) {
                     printf(&quot;%-*s %s\n&quot;, refcount, usymdata(strtol(addr,16)))
                     addr = tokenize (&quot;&quot;, &quot; &quot;)
              }

which could be plopped into a separate function.

BTW, if you&#039;re not probing the kernel itself, you won&#039;t need the kernel-debuginfo package.</description>
		<content:encoded><![CDATA[<p>How to indent based upon the nearby refcount variable?  For the header lines,</p>
<p>		printf ("%-*s %s %p ref (%u)\n", refcount, "", type, object, refcount)</p>
<p>(see the %-*s part).  For indenting the print_*backtrace() ... not quite so easy, since<br />
each line would need to be manipulated.  But something like this could work:</p>
<p>              bt = ubacktrace()  # results in a string of hex addresses<br />
              addr = tokenize(bt, " ")<br />
              while (addr != "") {<br />
                     printf("%-*s %s\n", refcount, usymdata(strtol(addr,16)))<br />
                     addr = tokenize ("", " ")<br />
              }</p>
<p>which could be plopped into a separate function.</p>
<p>BTW, if you're not probing the kernel itself, you won't need the kernel-debuginfo package.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.310 seconds -->

