<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Debugging on Amit Agarwal Linux Blog</title>
    <link>/tags/debugging/</link>
    <description>Recent content in Debugging on Amit Agarwal Linux Blog</description>
    <generator>Hugo -- gohugo.io</generator>
    <language>en</language>
    <lastBuildDate>Mon, 30 Jan 2017 01:19:12 +0000</lastBuildDate>
    
	<atom:link href="/tags/debugging/index.xml" rel="self" type="application/rss+xml" />
    
    
    <item>
      <title>journalctl command to see kernel messages</title>
      <link>/2017/01/30/journalctl-command-kernel-messages/</link>
      <pubDate>Mon, 30 Jan 2017 01:19:12 +0000</pubDate>
      
      <guid>/2017/01/30/journalctl-command-kernel-messages/</guid>
      <description>&lt;p&gt;Sometimes, there are just too many messages in journalctl output and it becomes a mystery game to search for the messages you are looking for. But luckily you do not need to use grep to find the right message. Here is example of what I had to do when I was looking for kernel messages.&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;journalctl _TRANSPORT=kernel
# To see all the fields, you can use the verbose mode
journalctl _TRANSPORT=kernel -o verbose

# And the filter on priority if needed to get the messages you need
journalctl _TRANSPORT=kernel PRIORITY=4

# and follow
journalctl _TRANSPORT=kernel PRIORITY=4 -f -l&lt;/pre&gt;</description>
    </item>
    
    <item>
      <title>speed up journalctl</title>
      <link>/2016/04/25/speed-journalctl/</link>
      <pubDate>Mon, 25 Apr 2016 00:40:56 +0000</pubDate>
      
      <guid>/2016/04/25/speed-journalctl/</guid>
      <description>&lt;p&gt;Sometime back I noticed that whenever I run my favourite command, viz.&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;journalctl -xn -f -l&lt;/pre&gt;
&lt;p&gt;it was taking more time than usual. So, I thought to dig more into it and finally found that the following command:&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;sudo journalctl --disk-usage&lt;/pre&gt;
&lt;p&gt;showed that journalctl was using some huge space in tune of about 4GB. So, the solution was simple, vaccum the journal entries and the command to do so is :&lt;/p&gt;
&lt;pre class=&#34;brush:shell&#34;&gt;sudo journalctl --vacuum-size 90M&lt;/pre&gt;
&lt;p&gt;Checking journalctl size after that confirms the size is reduced and after that indeed the above journal command takes no time 🙂&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>better bash debugging</title>
      <link>/2011/09/16/bash-debugging/</link>
      <pubDate>Fri, 16 Sep 2011 08:00:08 +0000</pubDate>
      
      <guid>/2011/09/16/bash-debugging/</guid>
      <description>&lt;p&gt;I was trying to &lt;a class=&#34;zem_slink&#34; title=&#34;Debugging&#34; href=&#34;http://en.wikipedia.org/wiki/Debugging&#34; rel=&#34;wikipedia&#34;&gt;debug&lt;/a&gt; some &lt;a class=&#34;zem_slink&#34; title=&#34;Bash (Unix shell)&#34; href=&#34;http://tiswww.case.edu/php/chet/bash/bashtop.html&#34; rel=&#34;homepage&#34;&gt;bash&lt;/a&gt; scripts yesterday and learnt something new 😉&lt;br&gt;
There are lot of things in bash that you can use to debug and to start with you can enable xtrace mode as follows:&lt;/p&gt;
&lt;pre class=&#34;brush: bash; gutter: true; first-line: 1; &#34;&gt;set -x&lt;/pre&gt;
&lt;p&gt;With this set you will see that all the commands are printed along with all other information as they are executed.&lt;br&gt;
This you can do for any line or for the function or for the whole script. Once you set the option you can turn it&lt;br&gt;
off with&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>debug call function() to debug a function in vim</title>
      <link>/2011/09/04/debug-call-function-debug-function-vim/</link>
      <pubDate>Sun, 04 Sep 2011 06:04:53 +0000</pubDate>
      
      <guid>/2011/09/04/debug-call-function-debug-function-vim/</guid>
      <description>&lt;div class=&#34;zemanta-img&#34; style=&#34;margin: 1em; display: block;&#34;&gt;
  &lt;p&gt;
    &lt;figure style=&#34;width: 159px&#34; class=&#34;wp-caption alignright&#34;&gt;&lt;a href=&#34;http://commons.wikipedia.org/wiki/File:Function_machine2.svg&#34;&gt;&lt;img title=&#34;Drawn in Autosketch + pasting in words from Excel&#34; src=&#34;https://i1.wp.com/blog.amit-agarwal.co.in/wp-content/uploads/zemanta//159px-Function_machine2.svg_3.png?resize=159%2C152&#34; alt=&#34;Drawn in Autosketch + pasting in words from Excel&#34; width=&#34;159&#34; height=&#34;152&#34; data-recalc-dims=&#34;1&#34; /&gt;&lt;/a&gt;&lt;figcaption class=&#34;wp-caption-text&#34;&gt;Image via Wikipedia&lt;/figcaption&gt;&lt;/figure&gt;
  &lt;/p&gt;
&lt;/div&gt;
&lt;!--[ad#ad-2]--&gt;
&lt;p&gt;Have you ever wished that you could either see what is going on initially at the vim startup like you could do with C program in the gdm mode, but really did not want to go through &lt;a class=&#34;zem_slink&#34; title=&#34;GNU Debugger&#34; href=&#34;http://www.gnu.org/software/gdb&#34; rel=&#34;homepage&#34;&gt;gdb&lt;/a&gt;. Or rather you sometime felt that some &lt;a class=&#34;zem_slink&#34; title=&#34;Function (mathematics)&#34; href=&#34;http://en.wikipedia.org/wiki/Function_%28mathematics%29&#34; rel=&#34;wikipedia&#34;&gt;function&lt;/a&gt; defined by some plugin is causing some issue and you wanted to debug just that function. Well you need not wish anymore, the functionality is already there.&lt;/p&gt;</description>
    </item>
    
    <item>
      <title>/bash debugger</title>
      <link>/2011/02/27/bash-debugger/</link>
      <pubDate>Sun, 27 Feb 2011 13:09:48 +0000</pubDate>
      
      <guid>/2011/02/27/bash-debugger/</guid>
      <description>&lt;!--[ad#ad-2]--&gt;
&lt;h3 id=&#34;span-stylefont-size-medium92-a-a-classzem_slink-titlebash-unix-shell-relhomepage-hrefhttptiswwwcaseeduphpchetbashbashtophtmlbasha-a-classzem_slink-titledebugger-relwikipedia-hrefhttpenwikipediaorgwikidebuggerdebuggeraspan&#34;&gt;&lt;strong&gt;&lt;span style=&#34;font-size: medium;&#34;&gt;9.2. A &lt;a class=&#34;zem_slink&#34; title=&#34;Bash (Unix shell)&#34; rel=&#34;homepage&#34; href=&#34;http://tiswww.case.edu/php/chet/bash/bashtop.html&#34;&gt;bash&lt;/a&gt; &lt;a class=&#34;zem_slink&#34; title=&#34;Debugger&#34; rel=&#34;wikipedia&#34; href=&#34;http://en.wikipedia.org/wiki/Debugger&#34;&gt;Debugger&lt;/a&gt;&lt;/span&gt;&lt;/strong&gt;&lt;/h3&gt;
&lt;p&gt;In this section we’ll develop a very basic debugger for bash.&lt;a href=&#34;http://book.chinaunix.net/special/ebook/oreilly/Learning_bash_Shell/0596009658/bash3-CHP-9-SECT-2.html#bash3-CHP-9-FNOTE-10&#34;&gt;[10]&lt;/a&gt; Most debuggers have numerous sophisticated features that help a programmer in dissecting a program, but just about all of them include the ability to step through a running program, stop it at selected places, and examine the values of variables. These simple features are what we will concentrate on providing in our debugger. Specifically, we’ll provide the ability to:&lt;/p&gt;</description>
    </item>
    
  </channel>
</rss>
