<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Readul Hasan Chayan [Heemayl] (Posts about debugging)</title><link>https://heemayl.net/</link><description></description><atom:link href="https://heemayl.net/categories/debugging.xml" rel="self" type="application/rss+xml"></atom:link><language>en</language><copyright>Contents © 2024 &lt;a href="mailto:me@heemayl.net"&gt;Readul Hasan Chayan [Heemayl]&lt;/a&gt; 
&lt;a rel="license" href="https://creativecommons.org/licenses/by-nc-sa/4.0/" target="_blank"&gt;
&lt;img alt="Creative Commons License BY-NC-SA"
style="border-width:0; margin-top: 10px; margin-bottom: 5px;"
src="https://i.creativecommons.org/l/by-nc-sa/4.0/88x31.png"&gt;&lt;/a&gt;
</copyright><lastBuildDate>Mon, 22 Jul 2024 10:13:19 GMT</lastBuildDate><generator>Nikola (getnikola.com)</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>Brief intro to `strace` : Finding all files a process is opening in GNU/Linux</title><link>https://heemayl.net/posts/brief-intro-to-strace-finding-all-files-a-process-is-opening-in-gnu-linux/</link><dc:creator>Readul Hasan Chayan [Heemayl]</dc:creator><description>&lt;div&gt;&lt;p&gt;Many times while debugging, we need to find all the files (e.g. shared libraries, configuration files, caches, logs, dumps, state files, journals, and so on) a process is opening for reading data from to get hints about the program's design and workflow.&lt;/p&gt;
&lt;p&gt;Otherwise we want to follow the lengthy route of reading the source code of the program, we could leverage the powerful system call tracing tool &lt;code&gt;strace&lt;/code&gt; to get the job done fairly easily.&lt;/p&gt;
&lt;h3&gt;Background:&lt;/h3&gt;
&lt;p&gt;&lt;code&gt;strace&lt;/code&gt; binary comes with the &lt;code&gt;strace&lt;/code&gt; package; so we need to install it first (if not done already):&lt;/p&gt;
&lt;div class="code"&gt;&lt;pre class="code literal-block"&gt;%&lt;span class="w"&gt; &lt;/span&gt;dpkg&lt;span class="w"&gt; &lt;/span&gt;-S&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;$(&lt;/span&gt;&lt;span class="nb"&gt;command&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;-v&lt;span class="w"&gt; &lt;/span&gt;strace&lt;span class="k"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
strace:&lt;span class="w"&gt; &lt;/span&gt;/usr/bin/strace
&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://heemayl.net/posts/brief-intro-to-strace-finding-all-files-a-process-is-opening-in-gnu-linux/"&gt;Read more…&lt;/a&gt; (2 min remaining to read)&lt;/p&gt;&lt;/div&gt;</description><category>debugging</category><category>gnu/linux</category><category>strace</category><guid>https://heemayl.net/posts/brief-intro-to-strace-finding-all-files-a-process-is-opening-in-gnu-linux/</guid><pubDate>Fri, 08 Feb 2019 06:23:08 GMT</pubDate></item></channel></rss>