<?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: Debugging and profiling in Linux</title>
	<atom:link href="http://www.epanorama.net/blog/2014/05/19/debugging-and-profiling-in-linux/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.epanorama.net/blog/2014/05/19/debugging-and-profiling-in-linux/</link>
	<description>All about electronics and circuit design</description>
	<lastBuildDate>Thu, 16 Apr 2026 14:21:59 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.9.14</generator>
	<item>
		<title>By: Tomi Engdahl</title>
		<link>https://www.epanorama.net/blog/2014/05/19/debugging-and-profiling-in-linux/comment-page-1/#comment-1772192</link>
		<dc:creator><![CDATA[Tomi Engdahl]]></dc:creator>
		<pubDate>Wed, 15 Jun 2022 14:52:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.epanorama.net/newepa/?p=25309#comment-1772192</guid>
		<description><![CDATA[Linux Fu: Up Your GDB Game!
https://hackaday.com/2022/06/14/linux-fu-up-your-gdb-game/

No Front End Required

There was a time when Insight was popular. This wasn’t a front end to gdb. It was an actual copy of gdb with a Tk/Tcl GUI built into it. It fell out of favor, though, because of packaging issues, something my old friend Jeff Duntemann covered at length back when everyone sort of dropped it.

Why Not Web?

These days, everything runs in a web browser so why not your debugger? The gdbgui front end does just that. Of course, the debugger isn’t running in the browser, only the user interface which connects to a local server. You can see the program running against an ARM executable using gdb-multiarch in the accompanying figure.

Other Choices

Another good-looking option is Seer which does not run in a browser. Note that this is not the same as the seer package in Ubuntu, unfortunately. 

Do you care? If you use an IDE that integrates gdb, maybe not. Or maybe you are too tough to use a debugger at all. That’s fine. But for the times you need gdb, these frontends can make you more productive and give you more attention to focus on what really matters: finding the bug.]]></description>
		<content:encoded><![CDATA[<p>Linux Fu: Up Your GDB Game!<br />
<a href="https://hackaday.com/2022/06/14/linux-fu-up-your-gdb-game/" rel="nofollow">https://hackaday.com/2022/06/14/linux-fu-up-your-gdb-game/</a></p>
<p>No Front End Required</p>
<p>There was a time when Insight was popular. This wasn’t a front end to gdb. It was an actual copy of gdb with a Tk/Tcl GUI built into it. It fell out of favor, though, because of packaging issues, something my old friend Jeff Duntemann covered at length back when everyone sort of dropped it.</p>
<p>Why Not Web?</p>
<p>These days, everything runs in a web browser so why not your debugger? The gdbgui front end does just that. Of course, the debugger isn’t running in the browser, only the user interface which connects to a local server. You can see the program running against an ARM executable using gdb-multiarch in the accompanying figure.</p>
<p>Other Choices</p>
<p>Another good-looking option is Seer which does not run in a browser. Note that this is not the same as the seer package in Ubuntu, unfortunately. </p>
<p>Do you care? If you use an IDE that integrates gdb, maybe not. Or maybe you are too tough to use a debugger at all. That’s fine. But for the times you need gdb, these frontends can make you more productive and give you more attention to focus on what really matters: finding the bug.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomi Engdahl</title>
		<link>https://www.epanorama.net/blog/2014/05/19/debugging-and-profiling-in-linux/comment-page-1/#comment-1562823</link>
		<dc:creator><![CDATA[Tomi Engdahl]]></dc:creator>
		<pubDate>Thu, 14 Sep 2017 09:45:07 +0000</pubDate>
		<guid isPermaLink="false">http://www.epanorama.net/newepa/?p=25309#comment-1562823</guid>
		<description><![CDATA[Steps to debug coredump using gdb :
https://stackoverflow.com/questions/5115613/core-dump-file-analysis]]></description>
		<content:encoded><![CDATA[<p>Steps to debug coredump using gdb :<br />
<a href="https://stackoverflow.com/questions/5115613/core-dump-file-analysis" rel="nofollow">https://stackoverflow.com/questions/5115613/core-dump-file-analysis</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomi Engdahl</title>
		<link>https://www.epanorama.net/blog/2014/05/19/debugging-and-profiling-in-linux/comment-page-1/#comment-1521890</link>
		<dc:creator><![CDATA[Tomi Engdahl]]></dc:creator>
		<pubDate>Wed, 02 Nov 2016 12:23:09 +0000</pubDate>
		<guid isPermaLink="false">http://www.epanorama.net/newepa/?p=25309#comment-1521890</guid>
		<description><![CDATA[Linux in 2016 catches up to Solaris from 2004
Veteran dev says timed sampling&#039;s arrival in Berkeley Packet Filter makes Linux 4.9 a match for Solaris&#039; DTrace
http://www.theregister.co.uk/2016/11/01/linux_in_2016_catches_up_to_solaris_from_2004/

In 2004 former Reg hack Ashlee Vance brought us news of DTrace, a handy addition to Solaris 10 that “gives administrators thousands upon thousands of ways to check on a system&#039;s performance and then tweak ….production boxes with minimal system impact”. Vance was excited about the code because “it can help fix problems from the kernel level on up to the user level.”

Vance&#039;s story quoted a chap called Brendan Gregg who enthused about tool after using it and finding “... DTrace has given me a graph of a hundred points that leaves nothing to the imagination. It did more than just help my program, it helped me understand memory allocation so that I can become a better programmer.”

As Gregg explains on his blog, Linux has had plenty of tracing tools for a long time, but they were miscellaneous kernel capabilities rather than dedicated tools and didn&#039;t match DTrace&#039;s full list of functions. But over time developers have worked on further tracing tools and Facebook developer Alexei Starovoitov recently offered up some enhancements to the Linux kernel that Gregg feels mean it now matches DTrace.

DTrace for Linux 2016
http://www.brendangregg.com/blog/2016-10-27/dtrace-for-linux-2016.html]]></description>
		<content:encoded><![CDATA[<p>Linux in 2016 catches up to Solaris from 2004<br />
Veteran dev says timed sampling&#8217;s arrival in Berkeley Packet Filter makes Linux 4.9 a match for Solaris&#8217; DTrace<br />
<a href="http://www.theregister.co.uk/2016/11/01/linux_in_2016_catches_up_to_solaris_from_2004/" rel="nofollow">http://www.theregister.co.uk/2016/11/01/linux_in_2016_catches_up_to_solaris_from_2004/</a></p>
<p>In 2004 former Reg hack Ashlee Vance brought us news of DTrace, a handy addition to Solaris 10 that “gives administrators thousands upon thousands of ways to check on a system&#8217;s performance and then tweak ….production boxes with minimal system impact”. Vance was excited about the code because “it can help fix problems from the kernel level on up to the user level.”</p>
<p>Vance&#8217;s story quoted a chap called Brendan Gregg who enthused about tool after using it and finding “&#8230; DTrace has given me a graph of a hundred points that leaves nothing to the imagination. It did more than just help my program, it helped me understand memory allocation so that I can become a better programmer.”</p>
<p>As Gregg explains on his blog, Linux has had plenty of tracing tools for a long time, but they were miscellaneous kernel capabilities rather than dedicated tools and didn&#8217;t match DTrace&#8217;s full list of functions. But over time developers have worked on further tracing tools and Facebook developer Alexei Starovoitov recently offered up some enhancements to the Linux kernel that Gregg feels mean it now matches DTrace.</p>
<p>DTrace for Linux 2016<br />
<a href="http://www.brendangregg.com/blog/2016-10-27/dtrace-for-linux-2016.html" rel="nofollow">http://www.brendangregg.com/blog/2016-10-27/dtrace-for-linux-2016.html</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomi Engdahl</title>
		<link>https://www.epanorama.net/blog/2014/05/19/debugging-and-profiling-in-linux/comment-page-1/#comment-1504217</link>
		<dc:creator><![CDATA[Tomi Engdahl]]></dc:creator>
		<pubDate>Mon, 08 Aug 2016 12:07:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.epanorama.net/newepa/?p=25309#comment-1504217</guid>
		<description><![CDATA[Statistical profiling aids code understanding

http://www.edn.com/electronics-blogs/embedded-basics/4442393/Statistical-profiling-aids-code-understanding?_mc=NL_EDN_EDT_EDN_weekly_20160721&amp;cid=NL_EDN_EDT_EDN_weekly_20160721&amp;elqTrackId=1753d619a80c40e18da5426ef7fd49f2&amp;elq=9ad6a982e69743dbabc001cd93609f6f&amp;elqaid=33150&amp;elqat=1&amp;elqCampaignId=28979

The second the Run button is pressed on the IDE, the microcontroller begins executing millions of instructions a second. But what functions are executing and how often? How much time is spent idling the processor vs code execution? Nobody knows! Statistical profiling can help answer these basic questions.

For years, engineers could only guess at how their code was actually executing or, when forced to, instrumented their code with complex and time-consuming setups to answer basic and fundamental system questions. Happily, engineers today can use statistical profiling to find the answers. Statistical profiling is a method for estimating which functions are executing on the microcontroller and what their load is on the processer.

Modern 32-bit architectures, such as the ARM Cortex-M, contain a mechanism known as the Serial Wire Viewer (SWV) for sending such information over the Serial Wire Debugger. The debug hardware has the ability to periodically sample the Program Counter (PC) register and transmit its value over the debug probe to the host development environment. The host can then take the PC value and correlate it with the line of code, and therefore the function, that is being executed.]]></description>
		<content:encoded><![CDATA[<p>Statistical profiling aids code understanding</p>
<p><a href="http://www.edn.com/electronics-blogs/embedded-basics/4442393/Statistical-profiling-aids-code-understanding?_mc=NL_EDN_EDT_EDN_weekly_20160721&#038;cid=NL_EDN_EDT_EDN_weekly_20160721&#038;elqTrackId=1753d619a80c40e18da5426ef7fd49f2&#038;elq=9ad6a982e69743dbabc001cd93609f6f&#038;elqaid=33150&#038;elqat=1&#038;elqCampaignId=28979" rel="nofollow">http://www.edn.com/electronics-blogs/embedded-basics/4442393/Statistical-profiling-aids-code-understanding?_mc=NL_EDN_EDT_EDN_weekly_20160721&#038;cid=NL_EDN_EDT_EDN_weekly_20160721&#038;elqTrackId=1753d619a80c40e18da5426ef7fd49f2&#038;elq=9ad6a982e69743dbabc001cd93609f6f&#038;elqaid=33150&#038;elqat=1&#038;elqCampaignId=28979</a></p>
<p>The second the Run button is pressed on the IDE, the microcontroller begins executing millions of instructions a second. But what functions are executing and how often? How much time is spent idling the processor vs code execution? Nobody knows! Statistical profiling can help answer these basic questions.</p>
<p>For years, engineers could only guess at how their code was actually executing or, when forced to, instrumented their code with complex and time-consuming setups to answer basic and fundamental system questions. Happily, engineers today can use statistical profiling to find the answers. Statistical profiling is a method for estimating which functions are executing on the microcontroller and what their load is on the processer.</p>
<p>Modern 32-bit architectures, such as the ARM Cortex-M, contain a mechanism known as the Serial Wire Viewer (SWV) for sending such information over the Serial Wire Debugger. The debug hardware has the ability to periodically sample the Program Counter (PC) register and transmit its value over the debug probe to the host development environment. The host can then take the PC value and correlate it with the line of code, and therefore the function, that is being executed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomi Engdahl</title>
		<link>https://www.epanorama.net/blog/2014/05/19/debugging-and-profiling-in-linux/comment-page-1/#comment-1493871</link>
		<dc:creator><![CDATA[Tomi Engdahl]]></dc:creator>
		<pubDate>Thu, 09 Jun 2016 12:48:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.epanorama.net/newepa/?p=25309#comment-1493871</guid>
		<description><![CDATA[gcc: Some Assembly Required
http://goo.gl/UdIBhB


The Profiler

Sometimes it is obvious what’s taking time in your programs. When it isn’t, you can actually turn on profiling. If you are running GCC under Linux, for example, you can use the -pg option to have GCC add profiling instrumentation to your code automatically. 

execution statistics you can display using gprof 

Assembly

If you start with a C or C++ program, one thing you can do is ask the compiler to output assembly language for you. With GCC, use a file name like test.s with the -o option and then use -S to force assembly language output. The output isn’t great, but it is readable. You can also use the -ahl option to get assembly code mixed with source code in comments, which is useful.

If you find a function or section of code you want to rewrite, you can still use GCC and just stick the assembly language inline. Exactly how that works depends on what platform you use]]></description>
		<content:encoded><![CDATA[<p>gcc: Some Assembly Required<br />
<a href="http://goo.gl/UdIBhB" rel="nofollow">http://goo.gl/UdIBhB</a></p>
<p>The Profiler</p>
<p>Sometimes it is obvious what’s taking time in your programs. When it isn’t, you can actually turn on profiling. If you are running GCC under Linux, for example, you can use the -pg option to have GCC add profiling instrumentation to your code automatically. </p>
<p>execution statistics you can display using gprof </p>
<p>Assembly</p>
<p>If you start with a C or C++ program, one thing you can do is ask the compiler to output assembly language for you. With GCC, use a file name like test.s with the -o option and then use -S to force assembly language output. The output isn’t great, but it is readable. You can also use the -ahl option to get assembly code mixed with source code in comments, which is useful.</p>
<p>If you find a function or section of code you want to rewrite, you can still use GCC and just stick the assembly language inline. Exactly how that works depends on what platform you use</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tomi Engdahl</title>
		<link>https://www.epanorama.net/blog/2014/05/19/debugging-and-profiling-in-linux/comment-page-1/#comment-1364861</link>
		<dc:creator><![CDATA[Tomi Engdahl]]></dc:creator>
		<pubDate>Thu, 26 Mar 2015 14:30:48 +0000</pubDate>
		<guid isPermaLink="false">http://www.epanorama.net/newepa/?p=25309#comment-1364861</guid>
		<description><![CDATA[Debugging core works also like this:

ulimit -c unlimited

* crash the program *

gdb program core
bt]]></description>
		<content:encoded><![CDATA[<p>Debugging core works also like this:</p>
<p>ulimit -c unlimited</p>
<p>* crash the program *</p>
<p>gdb program core<br />
bt</p>
]]></content:encoded>
	</item>
</channel>
</rss>
