<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Christina Jacob on Medium]]></title>
        <description><![CDATA[Stories by Christina Jacob on Medium]]></description>
        <link>https://medium.com/@christina.jacob.koikara?source=rss-54f3e174cfea------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*BsQ-iAd3o9ZNblQIdG7g9Q.jpeg</url>
            <title>Stories by Christina Jacob on Medium</title>
            <link>https://medium.com/@christina.jacob.koikara?source=rss-54f3e174cfea------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 23:25:09 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@christina.jacob.koikara/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[The setup.py]]></title>
            <link>https://medium.com/@christina.jacob.koikara/the-setup-py-16eefeb2f6f2?source=rss-54f3e174cfea------2</link>
            <guid isPermaLink="false">https://medium.com/p/16eefeb2f6f2</guid>
            <dc:creator><![CDATA[Christina Jacob]]></dc:creator>
            <pubDate>Fri, 10 Nov 2023 04:07:15 GMT</pubDate>
            <atom:updated>2023-11-10T04:07:15.509Z</atom:updated>
            <content:encoded><![CDATA[<p>Packaging Python modules using setuptools is a common practice in the Python community. Setuptools is a library that simplifies the process of packaging, distributing, and installing Python projects. It allows you to define project metadata, dependencies, and installation instructions, making it easier for others to use your Python module or package. Here’s a step-by-step guide on how to package a Python module using setuptools:</p><p>1. Create a Directory Structure:</p><p>Start by organizing your project into a directory structure. A typical structure might look like this:</p><pre>my_module/<br>    ├── my_module/<br>    │   ├── __init__.py<br>    │   ├── module_code.py<br>    ├── setup.py<br>    ├── README.md</pre><ul><li>The outer my_module directory is the root of your project.</li><li>The inner my_module directory is where your Python module code resides.</li><li>setup.py is the script that contains the package metadata and instructions for setuptools.</li><li>README.md is optional but recommended for documentation.</li></ul><p>2. Writing Module Code:</p><p>Write your Python module code in the module_code.py file. This is the core functionality of your package.</p><p>3. <strong>Create a </strong><strong>setup.py Script:</strong></p><p>The setup script is the center of all activity in building, distributing, and installing modules using the setuptools. In the setup.py script, you define the metadata and instructions for setuptools., so that the various commands that operate on your modules work right together.</p><p>Here&#39;s an example setup.py script:</p><pre>from setuptools import setup<br>setup(<br>    name=&quot;my_module&quot;,<br>    version=&quot;1.0.0&quot;,<br>    description=&quot;A description of your module&quot;,<br>    author=&quot;Your Name&quot;,<br>    author_email=&quot;your@email.com&quot;,<br>    packages=[&quot;my_module&quot;],<br>    install_requires=[<br>        # List your module&#39;s dependencies here<br>    ],<br>)</pre><p>In this script:</p><ul><li>name is the name of your module.</li><li>version specifies the version of your module.</li><li>description provides a brief description of your module.</li><li>author and author_email are your information.</li><li>packages lists the Python packages to be included in the distribution.</li><li>install_requires lists your module&#39;s dependencies.</li></ul><p>4. Building the Distribution:</p><p>To create a source distribution, navigate to your project’s root directory and run the following command:</p><pre>python setup.py sdist</pre><p>This will generate a dist directory containing a compressed source distribution of your module.</p><p>5. Installing or Distributing Your Module:</p><p>To install your module locally, use the following command:</p><pre>pip install ./dist/my_module-1.0.0.tar.gz</pre><p>To distribute your module, you can upload it to the Python Package Index (PyPI) or use a tool like twine. You’ll need to create an account on PyPI and follow their guidelines for uploading packages.</p><p>6. Document Your Module:</p><p>It’s essential to provide documentation for your module. A README.md file is a good start, but you can also generate documentation using tools like Sphinx and include it in your distribution.</p><p>Conclusion</p><p>By following these steps, you can package your Python module using setuptools, making it easier for others to install and use your code. Remember to keep your module and package metadata up to date as you make changes and improvements to your project.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16eefeb2f6f2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Linux Init Process]]></title>
            <link>https://medium.com/@christina.jacob.koikara/a-comprehensive-guide-to-the-linux-init-process-e9cc85d37753?source=rss-54f3e174cfea------2</link>
            <guid isPermaLink="false">https://medium.com/p/e9cc85d37753</guid>
            <category><![CDATA[init-process]]></category>
            <category><![CDATA[getty]]></category>
            <category><![CDATA[runlevel]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[inittab]]></category>
            <dc:creator><![CDATA[Christina Jacob]]></dc:creator>
            <pubDate>Tue, 10 Oct 2023 04:58:09 GMT</pubDate>
            <atom:updated>2023-10-12T06:05:46.320Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zj3tIC6YTzoGp5bFQQOxvw.png" /></figure><p>Init is the first user world process that runs in linux, It creates processes by starting scripts stored in /etc/inittab. Lets look at the details about how init process starts and runs and how to add entries in inittab file.</p><h3>The Init Thread: A bridge</h3><h4>The Init Thread</h4><p>When the system boots, the kernel initially runs in kernel mode. The transition to running in usermode and executing user-level program begins with the init process moving from kernel mode to usermode.</p><h4>Preparing for User-Space Execution</h4><p><em>start_kernel</em> function, which is the starting point of any generic kernel forks out the init thread the init thread readies itself to execute the user-space init process. Typically, this process is found in /sbin/init, /etc/init, or /bin/init. If these are missing, /bin/sh can serve as a recovery measure.</p><h4>Transition to User Space</h4><p>To move to user space, the code opens /dev/console as standard input, connects the console to stdout and stderr, and calls execve to execute the user-space program.</p><h4>Kernel System Calls</h4><p>The init thread can invoke system calls while in kernel mode, thanks to __KERNEL_SYSCALLS__. This allows kernel code to use a limited number of system calls, mirroring user-space behavior.</p><h4>Execve and Memory Maps</h4><p>The final execve call ensures a smooth transition to user space. It replaces memory maps with those defined by the binary file being executed.</p><h4>Init in Action</h4><p>With the transition to user space complete, the init process now operates in user space. Subsequent kernel operations are driven by system calls from init itself or its spawned processes. This ensures a seamless Linux system initialization.</p><h3>The Inittab: Configfile</h3><p>Now lets think about how the init process spawns other processes?</p><p>The /etc/inittab it defines various aspects of how the init process behaves during system startup and how terminal login sessions are managed.</p><h4><strong>Sample Inittab file</strong></h4><blockquote><em># Sample /etc/inittab file</em></blockquote><blockquote><em># Default run level<br>id:3:initdefault:</em></blockquote><blockquote><em># Sysinit tasks<br>si::sysinit:/etc/init.d/rcS</em></blockquote><blockquote><em># Getty lines for terminals<br>c1:12345:respawn:/sbin/agetty 38400 tty1 linux<br>c2:12345:respawn:/sbin/agetty 38400 tty2 linux</em></blockquote><blockquote><em># Power failure and reboot actions<br>pf::powerfail:/usr/sbin/shutdown -y -i5 -g0<br>rb:6:wait:/sbin/reboot</em></blockquote><blockquote><em># Custom run level 2 tasks<br>s2:2:wait:/etc/init.d/my_custom_service start</em></blockquote><p>The init process executes each line entry in inittab file appropriately spawning new user processes.</p><p>A single line in inittab has 4 fields</p><blockquote>ID : Identifier for the entry</blockquote><blockquote>Rstate : Runlevel</blockquote><blockquote>Action : How the process specified in the process field is to be run. Possible values include: initdefault, sysinit, boot, bootwait, wait, and respawn</blockquote><blockquote>Process: The process to be executed</blockquote><h4>More on RunLevels</h4><p>Run Levels: Run levels define different system states or modes in which the system can operate. Each run level represents a specific configuration of processes and services. Common run levels include:</p><ul><li>Run Level 0: Halts or shuts down the system.</li><li>Run Level 1: Single-user mode for system maintenance.</li><li>Run Level 3: Multi-user mode with networking and terminal login.</li><li>Run Level 5: Multi-user mode with a graphical desktop environment.</li><li>Run Level 6: Reboots the system.</li></ul><p>Now Interpreting the Sample /etc/inittab File</p><p>Let’s interpret the components of this sample /etc/inittab file:</p><ul><li>initdefault: This line specifies that the default run level is 3, indicating a multi-user mode with terminal login.</li><li>sysinit tasks: The si::sysinit:/etc/init.d/rcS line defines tasks to be executed during system initialization, such as mounting and checking file systems.</li><li>Getty lines for terminals: Getty lines for terminals (c1 to c6) are configured to start terminal login sessions on virtual consoles (tty1 to tty6) in run levels 1, 2, 3, 4, and 5.</li></ul><p>Note: Getty lines are entries in /etc/inittab responsible for managing terminal login sessions. Each getty line specifies the settings and behavior for a particular TTY device. Getty lines control tasks such as displaying login prompts, accepting usernames, and initializing terminal settings.</p><ul><li>Power failure and reboot actions: These lines (pf::powerfail:/usr/sbin/shutdown -y -i5 -g0 and rb:6:wait:/sbin/reboot) define actions to be taken during power failures or system reboots.</li><li>Custom run level 2 tasks: The s2:2:wait:/etc/init.d/my_custom_service start line specifies custom tasks to be executed in run level 2.</li><li>Run level 5 tasks (graphical environment): The x:5:respawn:/usr/bin/startx line initiates a graphical environment in run level 5.</li></ul><h3>Summary</h3><p>Init is the first userlevel process, init uses the inittab files that specify different aspects of how further user actions should be laid out.</p><p>The runlevels define different state and modes of the system and actions specify the action needed on the actual process that is being run.</p><p>The default console is /dev/console, the getty lines define a proper terminal.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e9cc85d37753" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Remote Development with VS Code on Mac in 5 simple steps]]></title>
            <link>https://medium.com/macoclock/remote-development-with-vscode-on-mac-in-simple-5-steps-6ae100938d67?source=rss-54f3e174cfea------2</link>
            <guid isPermaLink="false">https://medium.com/p/6ae100938d67</guid>
            <category><![CDATA[vscode]]></category>
            <category><![CDATA[macos]]></category>
            <category><![CDATA[remote-working]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[productivity]]></category>
            <dc:creator><![CDATA[Christina Jacob]]></dc:creator>
            <pubDate>Sun, 09 Aug 2020 07:04:12 GMT</pubDate>
            <atom:updated>2020-08-11T03:45:19.749Z</atom:updated>
            <content:encoded><![CDATA[<p>This is about using VS Code for remote development on mac os.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RUlszJKRo4n0GAj4BWh0RA.png" /><figcaption>VSCODE</figcaption></figure><h4>Why VSCode?</h4><p>With COVID-19 pandemic spreading, as everyone else I had to work from home Since march. I started using tmux after a few months into my first job so that I will have the same session at home or office or anywhere I login to my machine. That was enough for me during the old normal! But working from home had its own challenges, among which flaky connection was the worst. I looked for options, found mosh. With mosh you will have your session maintained even if you have your internet cut off for a few seconds, unlike an ssh connection that would get lost when your internet connection is interrupted, even from a short while. That wasn’t enough, the connection is maintained but my continuity is lost. Then I tried the option of Remote development with VS Code, that gave me a local development feel while connected to a codebase in a remote machine. Even if the connection is lost for 15–20 seconds you don’t have an impact, it reconnects automatically(if configured to) when the network comes back.</p><h3>System requirements</h3><p>Local: Ssh client compatible with openssh. On macOS, it comes preinstalled.</p><p>Remote SSH host: A running ssh server on your remote Linux machine [I used CentOS Linux release]</p><p>Below command can be used to do the same</p><p>sudo yum install openssh-server &amp;&amp; sudo systemctl start sshd.service &amp;&amp; sudo systemctl enable sshd.service</p><h4>Installation</h4><ol><li>Download and install VS Code for mac</li></ol><ul><li>Go to URL <a href="https://code.visualstudio.com/download">https://code.visualstudio.com/download</a> and click on the download button.</li><li>Extract the zip file generated using the below command on the command line. or double click on the zip file to extract the content.</li></ul><blockquote>tar -xvzf VSCode-darwin-stable.zip</blockquote><ul><li>Double click on the Visual Studio Code. app to launch VS Code.</li></ul><p>Note: Drag it to the application folder to make it available on the launch pad. Make it available on the dock by right-clicking and choosing option keep in doc</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FGpv1xYbun3Y&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DGpv1xYbun3Y&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/671453ea4beeecae0ce2650ea34ea9da/href">https://medium.com/media/671453ea4beeecae0ce2650ea34ea9da/href</a></iframe><h4>Configure</h4><p>step 0: Install Visual Studio Code Remote Development Extension Pack.</p><blockquote>Click on the extensions icon.</blockquote><blockquote>Search for remote development extension pack.</blockquote><blockquote>Click install</blockquote><p>Step1: Try connecting to a remote host.</p><p>To verify that you can connect to the remote machine, where your actual code base is executed the command from the terminal replacing username with your username on the remote machine and host IP with the IP of the remote machine.</p><p>ssh username@hostip</p><p>Step 2: Configuring ssh In VS Code</p><p>In the command pallete(F1)select Remote-SSH: Add New SSH Host… and use the same user@hostname as in step 1</p><p>Select Remote-SSH: Connect to Host… from the Command Palette (F1). From the drop-down choose the already added host. Type in the password when prompted for it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iN7OJb58DiYLUkJU.png" /><figcaption>From <a href="https://code.visualstudio.com/docs/remote/ssh">https://code.visualstudio.com/docs/remote/ssh</a></figcaption></figure><p>Vs Code will automatically detect the type of the server, if not you will be asked to select the type manually.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lWygZI4F4SHiebPu.png" /><figcaption>From <a href="https://code.visualstudio.com/docs/remote/ssh">https://code.visualstudio.com/docs/remote/ssh</a></figcaption></figure><p>You can edit this in vscode settings (Code &gt; Preferences &gt; Settings)by updating remote.SSH.remotePlatform property</p><p>After a moment, VS Code will connect to the SSH server and set itself up. VS Code will keep you up-to-date using a progress notification and you can see a detailed log in the Remote - SSH output channel. You can check the status bar to check the remote host you are connected to</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/0*ARy9lFrVmgdCTRVB.png" /><figcaption>From <a href="https://code.visualstudio.com/docs/remote/ssh">https://code.visualstudio.com/docs/remote/ssh</a></figcaption></figure><p>Step 3: You can then open any folder or workspace using File &gt; Open… or File &gt; Open Workspace… on the remote machine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*LACk7oRH570_Q_XF.png" /><figcaption>From <a href="https://code.visualstudio.com/docs/remote/ssh">https://code.visualstudio.com/docs/remote/ssh</a></figcaption></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FSoe_oANwXpk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DSoe_oANwXpk&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="640" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/cffef8cde3481705ca8e2ae4a474b71f/href">https://medium.com/media/cffef8cde3481705ca8e2ae4a474b71f/href</a></iframe><h4>Reference</h4><ul><li><a href="https://code.visualstudio.com/blogs/2019/05/02/remote-development">Remote Development with Visual Studio Code</a></li><li><a href="https://code.visualstudio.com/download">Download Visual Studio Code - Mac, Linux, Windows</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6ae100938d67" width="1" height="1" alt=""><hr><p><a href="https://medium.com/macoclock/remote-development-with-vscode-on-mac-in-simple-5-steps-6ae100938d67">Remote Development with VS Code on Mac in 5 simple steps</a> was originally published in <a href="https://medium.com/macoclock">Mac O’Clock</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to write and compile an XDP program in samples/bpf]]></title>
            <link>https://medium.com/@christina.jacob.koikara/how-to-write-and-compile-an-xdp-program-in-samples-bpf-29e69b8a2864?source=rss-54f3e174cfea------2</link>
            <guid isPermaLink="false">https://medium.com/p/29e69b8a2864</guid>
            <category><![CDATA[xdp]]></category>
            <category><![CDATA[linux-kernel]]></category>
            <category><![CDATA[datapath]]></category>
            <category><![CDATA[networking]]></category>
            <dc:creator><![CDATA[Christina Jacob]]></dc:creator>
            <pubDate>Thu, 02 Apr 2020 03:48:57 GMT</pubDate>
            <atom:updated>2020-07-23T09:04:18.662Z</atom:updated>
            <content:encoded><![CDATA[<p>This article Assumes the reader knows a bit about what is xdp and why is it used. You can refer to <a href="https://medium.com/@christina.jacob.koikara/what-is-xdp-the-express-data-path-in-linux-kernel-9413880a0113">this</a> article in this series if you are new to xdp or want to brush up things.</p><h4>Xdp architecture</h4><p>The xdp programs are using the ebpf virtual machine inside the kernel. The program will be compiled to platform-independent ebpf bytecode so that the object files can be loaded to different architectures without recompiling.</p><p><strong>The control plane</strong></p><p>This is a user space program typically named with “_user.c”. This will load the kernel bpf program and can interact with it via ebpf maps.</p><p><strong>The data plane</strong></p><p>The kernel piece of code. This piece of code is bound to the network interface making decision on the incoming packet and speeds up the processing by directly working on the packet. Typically named as “_kern.c”. There are two modes of operation</p><ul><li>Generic XDP</li></ul><p>This is a generic implementation which does not require driver support. xdp is called from metic_receive_skb() processing the packet after the skb allocation so not as efficient as Native xdp</p><ul><li>Native XDP</li></ul><p>Hook is attached at the beginning of packet processing before any skb allocaton, hence faster. but it requires driver support.</p><p><strong>How they work together</strong></p><p>The user space program must call the bpf system call to insert the program into kernel. with the libbpf library inplace, bpf_prog_load_xattr function does this for the user. Now bpf_set_link_xdp_fd() will be used to attach the program fd to the specific interface. this configures the kernel program for use and as said earlier the user program and the kernel programs mainly interact via the ebpf maps.</p><h4>How to write an xdp program</h4><p>Xdp is a new programming layer. Inside the kernel. This is not a bypass. To the Linux kernel stack, but a runtime programmable layer inside the kernel</p><p>Xdp programs are written in the BPF virtual machine infrastructure. There are many uses for the BPF subsystem inside the kernel like a Tc program and xdp is one among them</p><p>Xdp programs are attached to the earliest networking data path in the driver and triggers a BPF program to run</p><p>Here is a simple xdp program that simply counts the number of packets passed to it and and drops the packet.</p><p>The program is just for demonstration purpose may not have any useful use cases.</p><p>Kernel is the best source for sample bpf programs. Lets have a look at a sample program in kernel.</p><p><a href="https://elixir.bootlin.com/linux/v4.11.12/source/samples/bpf/xdp1_kern.c">xdp1_kern.c - samples/bpf/xdp1_kern.c - Linux source code (v4.11.12) - Bootlin</a></p><p><a href="https://elixir.bootlin.com/linux/v4.11.12/source/samples/bpf/xdp1_user.c">https://elixir.bootlin.com/linux/v4.11.12/source/samples/bpf/xdp1_user.c</a></p><p>The kernel program defines a map to keep count of the packets being sent out of the program. There are different types of maps out there which has different usecases. Here this is a simple key value pair specified by</p><pre> .type = <a href="https://elixir.bootlin.com/linux/latest/source/samples/bpf/latest/ident/BPF_MAP_TYPE_ARRAY"><strong>BPF_MAP_TYPE_ARRAY</strong></a>,</pre><p>along with the data types for key, value pair.</p><p>every kernel program has at least one section defined. which can be considered as an execution context. The loader recognises the section and loads to the kernel as it is loaded in the particular named section of the ELF file generated.</p><p>xdpmd_ctx is passed to the program</p><p>value = <a href="https://elixir.bootlin.com/linux/latest/source/samples/bpf/latest/ident/bpf_map_lookup_elem"><strong>bpf_map_lookup_elem</strong></a>(&amp;my_map, &amp;index);</p><p>does a lookup for the index(type of data) if that is found the value is incremented accordingly. not found, adds a new entry to the map.</p><p>This program tries to identify IPV4 and IPv6 packets and maintains a counter on dropping them. This is identified by parsing the raw ethhdr available in the xdp ctx passed to the program.</p><p>The user program attaches the kernel program to the interface as mentioned earlier.</p><p>gets the information from the map every x seconds.</p><h4>Steps to compile and run an xdp program</h4><pre>$ sudo apt-get install -y make gcc libssl-dev bc libelf-dev libcap-dev \<br>clang gcc-multilib llvm libncurses5-dev git pkg-config libmnl-dev bison flex \<br>graphviz</pre><p>Have to have a kernel with xdp support compiled in. refer to the article below for details</p><p><a href="https://medium.com/@christina.jacob.koikara/how-to-compile-a-kernel-with-xdp-support-c245ed3460f1">How to compile a kernel with XDP support</a></p><p><strong>LLVM</strong></p><p>LLVM 3.7 supports the BPF backend. This enables tools like clang to compile c programs to bpf. No other compiler provides this support.</p><p>compile the program in kernel samples folder using the kernel make file support</p><pre>make M=samples/bpf</pre><h4>End note.</h4><p>Have fun with xdp. please feel free to correct or add more information to the article.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29e69b8a2864" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Doxygen with Graphviz to generate call graph on Mac]]></title>
            <link>https://medium.com/macoclock/doxygen-with-graphviz-to-generate-call-graph-on-mac-f9a3160db641?source=rss-54f3e174cfea------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9a3160db641</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[documentation]]></category>
            <category><![CDATA[graphviz]]></category>
            <category><![CDATA[doxygen]]></category>
            <dc:creator><![CDATA[Christina Jacob]]></dc:creator>
            <pubDate>Tue, 31 Mar 2020 06:36:12 GMT</pubDate>
            <atom:updated>2020-04-02T04:47:07.690Z</atom:updated>
            <content:encoded><![CDATA[<p>I was dragged into a project where no one originally worked on was there for a knowledge transfer. I found Doxygen with Graghviz very useful to understand the code flow. My experiments were on Mac.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*6Qbj5TQTaXFuziyB" /><figcaption>Photo by <a href="https://unsplash.com/@hngstrm?utm_source=medium&amp;utm_medium=referral">Henry &amp; Co.</a> on <a href="https://unsplash.com/?utm_source=medium&amp;utm_medium=referral">Unsplash</a></figcaption></figure><h3>Doxygen and Graphviz</h3><p><strong>Doxygen<br></strong>Doxygen is a documentation generator primarily used for c++ code. More on doxygen can be found here. <a href="http://www.doxygen.nl/">http://www.doxygen.nl/</a></p><p><strong>Graghviz<br></strong>Doxygen can use the “dot” tool from graphviz to generate more advanced diagrams and graphs. Graphviz is an open-source, cross-platform graph drawing toolkit and can be found at <a href="http://www.graphviz.org/">http://www.graphviz.org/</a>. This can do a lot more things but I have used it for my c project so using it to generate the call graphs.</p><h3>Steps to generate call/caller graph</h3><p>Install doxygen and Graphviz. I was using mac os <a href="https://support.apple.com/kb/HT210190">macOS Mojave</a></p><pre>1. brew install doxygen<br>2. brew install graphviz</pre><p>Generate Doxyfile. Goto the project folder and do</p><pre>doxygen -g</pre><p>Edit the doxygen file to add the below configs</p><pre>HAVE_DOT               = YES<br>EXTRACT_ALL            = YES<br>EXTRACT_PRIVATE        = YES<br>EXTRACT_STATIC         = YES<br>CALL_GRAPH             = YES<br>CALLER_GRAPH           = YES<br>DISABLE_INDEX          = YES <br>GENERATE_TREEVIEW      = YES<br>RECURSIVE              = YES</pre><p>Note:</p><pre>RECURSIVE is to consider the subfolders in the  project.<br>DISABLE_INDEX and GENERATE_TREEVIEW is to get rid of the index view in the html file that will get generated and have a tree like view.<br>I like it this way. If you are ok with the default setting, can get rid of this option.</pre><p>Run Doxygen</p><pre>doxygen Doxyfile</pre><p>The HTML and latex folders are generated now. You can access the index.html file from the browser to see the results.</p><p>Here is the call graph created for the inotify_add_watch system call implementation in Linux kernel</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/727/1*S1nv8j2ehOTVxmmW04Q0sQ.png" /><figcaption>inotify_add_watch</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9a3160db641" width="1" height="1" alt=""><hr><p><a href="https://medium.com/macoclock/doxygen-with-graphviz-to-generate-call-graph-on-mac-f9a3160db641">Doxygen with Graphviz to generate call graph on Mac</a> was originally published in <a href="https://medium.com/macoclock">Mac O’Clock</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is XDP — The eXpress Data Path in linux kernel.]]></title>
            <link>https://medium.com/@christina.jacob.koikara/what-is-xdp-the-express-data-path-in-linux-kernel-9413880a0113?source=rss-54f3e174cfea------2</link>
            <guid isPermaLink="false">https://medium.com/p/9413880a0113</guid>
            <category><![CDATA[kernel]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[xdp]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[introduction]]></category>
            <dc:creator><![CDATA[Christina Jacob]]></dc:creator>
            <pubDate>Sun, 20 Oct 2019 07:05:15 GMT</pubDate>
            <atom:updated>2020-04-02T05:13:11.952Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is XDP — The eXpress Data Path in linux kernel.</h3><h4>XDP as the name suggests is a fast path framework in the Linux kernel network subsystem.</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1023/1*dDb3M0edFv0vpppXahDjqg.png" /></figure><h4>WHAT?</h4><p>Xdp provides a bare metal packet processing at the lowest level. The xdp programs are written as an ebpf program that will be attached to the driver hook. This is similar to dpdk but unlike dpdk the interface will not be detached from the driver. Instead of using a user space driver the user is allowed to directly read or make changes to network packet data and take decisions on how to handle the packet at an earlier stage with the attached xdp program so that the kernel stack can be eliminated from the data path hence avoiding overheads like converting the packets to skbs context switch costs etc. Basically introduces a new programmable layer in the kernel stack intended to close the performance gap between kernel bypass solutions.</p><h4>WHY?</h4><p>There is a lot of overhead in the linux kernel network data path as mentioned above. In many scenarios the packets don’t have to travel through all the layers in order to reach the decision on what to do about the packet. One of the easiest examples are turning down the DDOS attack packets. The introduction of the architecture is aimed at making the decision at an earlier stage packet processing so that it can be done faster by eliminating much of the overheads in the usual kernel stack.</p><h4>HOW ?</h4><p>The xdp support was added to the Linux kernel from v4.8 on wards. See how to build a kernel with xdp support in my another post below</p><p><a href="https://medium.com/@christina.jacob.koikara/how-to-compile-a-kernel-with-xdp-support-c245ed3460f1">https://medium.com/@christina.jacob.koikara/how-to-compile-a-kernel-with-xdp-support-c245ed3460f1</a></p><p>Many useful sample bpf programs are available in samples/bpf folder in the Linux sources. llvm provides the backend for this.</p><h3>Summary</h3><p>Express data path is a new addition to the linux kernel which is intended to speed up the packet processing or network data processing in linux kernel. This is enabled by using the ebpf virtual machine infrastructure which is available in the kernel for many other purposes already. XDP make use of a user space c(like) program which manages actions of a kernel space program also written in c that would be attached to the driver hook. Making it possible to make decisions at early stages of packet processing and hence eliminating many over heads involved in kernel network stack. This is still in an early stage. and a lot of potential remains to be untapped.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9413880a0113" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to compile a kernel with XDP support]]></title>
            <link>https://medium.com/@christina.jacob.koikara/how-to-compile-a-kernel-with-xdp-support-c245ed3460f1?source=rss-54f3e174cfea------2</link>
            <guid isPermaLink="false">https://medium.com/p/c245ed3460f1</guid>
            <category><![CDATA[kernel-compilation]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[xdp]]></category>
            <dc:creator><![CDATA[Christina Jacob]]></dc:creator>
            <pubDate>Sun, 20 Oct 2019 07:01:41 GMT</pubDate>
            <atom:updated>2019-10-20T07:01:41.397Z</atom:updated>
            <content:encoded><![CDATA[<p>eXpress Data Path(XDP) is a new addition to the linux kernel intended at speeding up the in kernel network data processing. The support is added from 4.8 linux kernel. Below are the steps to compile a kernel with XDP support.</p><h4>Features supported on different kernel versions</h4><p>Below is a list of xdp features with kernel version in which it got into the mainline kernel. The development goes to the net-next kernel. So better to clone net-next repo and use either the kernel version or the one depending on what feature is needed.</p><pre>Feature              kernel version<br>------------------------------------<br>BPF_MAPS               3.18<br>XDP support            4.8<br>AF_XDP                 4.18</pre><p>Addition of different types of maps to the kernel</p><pre>       MAP TYPE                        Kernel Version<br>-----------------------------------------------------<br>       BPF_MAP_TYPE_HASH                  3.19<br>       BPF_MAP_TYPE_ARRAY                 3.19<br>       BPF_MAP_TYPE_PROG_ARRAY            4.2<br>       BPF_MAP_TYPE_PERF_EVENT_ARRAY      4.3<br>       BPF_MAP_TYPE_PERCPU_HASH           4.6<br>       BPF_MAP_TYPE_PERCPU_ARRAY          4.6<br>       BPF_MAP_TYPE_STACK_TRACE           4.6<br>       BPF_MAP_TYPE_CGROUP_ARRAY          4.8   <br>       BPF_MAP_TYPE_LRU_HASH              4.10<br>       BPF_MAP_TYPE_LRU_PERCPU_HASH       4.10<br>       BPF_MAP_TYPE_LPM_TRIE              4.11<br>       BPF_MAP_TYPE_ARRAY_OF_MAPS         4.12<br>       BPF_MAP_TYPE_HASH_OF_MAPS          4.12<br>       BPF_MAP_TYPE_DEVMAP                4.14<br>       BPF_MAP_TYPE_SOCKMAP               4.14<br>       BPF_MAP_TYPE_CPUMAP                4.18<br>       BPF_MAP_TYPE_XSKMAP	          4.18<br>       BPF_MAP_TYPE_SOCKHASH              4.18<br>       BPF_MAP_TYPE_CGROUP_STORAGE        4.19<br>       BPF_MAP_TYPE_REUSEPORT_SOCKARRAY   4.19<br>       BPF_MAP_TYPE_PERCPU_CGROUP_STORAGE 4.20<br>       BPF_MAP_TYPE_QUEUE                 4.20<br>       BPF_MAP_TYPE_STACK                 4.20<br>       BPF_MAP_TYPE_SK_STORAGE            5.2</pre><p>Helper functions</p><pre> BPF_FUNC_get_smp_processor_id()  4.1<br> BPF_FUNC_redirect()              4.4<br> BPF_FUNC_perf_event_output()     4.4<br> BPF_FUNC_csum_diff()             4.6<br> BPF_FUNC_xdp_adjust_head()       4.10<br> BPF_FUNC_redirect_map()          4.14<br> BPF_FUNC_xdp_adjust_meta()       4.15<br> BPF_FUNC_xdp_adjust_tail()       4.18<br> BPF_FUNC_fib_lookup()            4.18</pre><p>XDP actions</p><pre>ACTION                 Kernel Version<br>--------------------------------------<br>XDP_ABORTED               4.8<br>XDP_DROP                  4.8<br>XDP_PASS                  4.8<br>XDP_TX                    4.8<br>XDP_REDIRECT              4.14</pre><h4>Kernel Configs</h4><pre>CONFIG_BPF=y<br>CONFIG_BPF_SYSCALL=y<br>CONFIG_BPF_JIT=y<br>CONFIG_HAVE_EBPF_JIT=y<br></pre><p>You can choose not to have the jit compiler but at the cost of performance. In the absence of jit the kernel depend on the in kernel interpreter for the purpose. Additionally if you want to have xdp socket support(AF_XDP) add</p><pre>CONFIG_XDP_SOCKETS=y</pre><p>to the kernel config.</p><h4>Kernel Compilation steps</h4><p>Now we have all the information on which kernel version to go for. Now lets see how to compile a kernel with this.(If you are familiar with the steps you can skip this part.) Not planning to include a detailed explanation here. There are many good and detailed articles out there.</p><ol><li>fetch the linux kernel sources</li></ol><pre>git clone <a href="https://github.com/torvalds/linux.git">https://github.com/torvalds/linux.git</a></pre><p>Checkout the required branch from the sources.</p><p>2. Do the necessary changes in the config file</p><pre>Make menuconfig</pre><p>select the required options here or you can directly edit the .config file in the kernel sources.</p><p>3. compile and install the kernel</p><pre>sudo make -j 4 &amp;&amp; sudo make modules_install -j 4 &amp;&amp; sudo make install -j 4</pre><p>5. update grub</p><pre>sudo update-initramfs -c -k &lt;version&gt;<br>sudo update-grub</pre><p>6. reboot the system.</p><pre>sudo reboot</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c245ed3460f1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The kernel debugging techniques for a device driver developer on arm64]]></title>
            <link>https://medium.com/@christina.jacob.koikara/the-kernel-debugging-techniques-for-a-device-driver-developer-on-arm64-fa984e4d2a09?source=rss-54f3e174cfea------2</link>
            <guid isPermaLink="false">https://medium.com/p/fa984e4d2a09</guid>
            <category><![CDATA[debugging]]></category>
            <category><![CDATA[hacks]]></category>
            <category><![CDATA[kernel-panic]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Christina Jacob]]></dc:creator>
            <pubDate>Wed, 02 Oct 2019 07:00:42 GMT</pubDate>
            <atom:updated>2020-08-12T05:12:38.676Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>The article is about the usual issues I face as a kernel developer and common approaches to debug the issues.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G_8EMylc9EXyT960LIMrzg@2x.jpeg" /></figure><h4>Undefined/unexpected behavoiur</h4><p>As usual, unexpected or undefined behaviour is due to a possible bug in the code It can be cause one among the below problems. Printk can be very useful in this case. With printk usage we can traverse the code flow properly. Ftrace can also be used to see the code flow.</p><p>See a nice tutorial below.</p><p>https://lwn.net/Articles/365835/</p><h4>Kernel oops vs kernel panic/crash</h4><p>On a kernel panic the system stops and needs to be restarted to continue. An OOPs leaves the system on an unstable state. But continues to run. An OOPs is typically caused by an invalid access to the memory. The counter part on user space is segmentation fault.</p><p>In both the cases the stacktrace which is dumped to the console can be read to see where the actual issue occurred. You can use a printk or objdump or map the elements from boot/system.map to get more information about the data printed onto the screen. Can check what the message in the trace mean and the oops number could also be of some use.</p><p>Kexec and kdump can be used to take a crash dump that would give more insight to the details of kernel panic.<a href="https://medium.com/@christina.jacob.koikara/linux-disk-monitoring-tools-1825d073fe62?source=friends_link&amp;sk=d5bb2f77cb7014c64ca5e11f61fceb2d"> </a><a href="https://medium.com/@christina.jacob.koikara/kexec-and-kdump-on-arm64-e456132d410f?source=friends_link&amp;sk=626e544d3cb960b5ca1305f504e3235f">Here</a> is a two minute read on kexec and kdump.</p><h4>Memory leak</h4><p>Memory leak occurs when the allocated memory is not freed properly. There are many static code analysis tools. Coverty is one among them but it is paid. Valgrid, smatch etc can also be used.</p><p>You can test your application for memory leak by monitoring the /proc/meminfo, /proc/slabinfo and using free command for a while. Once if the leak is confirmed you can use the kmemleak debugger to have more detailed insight to the problem.</p><p>CONFIG_DEBUG_KMEMLEAK has to be enabled for using kmemleak debugger. With CONFIG_DEBUG_KMEMLEAK_EARLY_LOG_SIZE set to a large value may be 20k or above. This relies on debugfs filesystem. So if debugfs is not already mounted you have to by doing</p><pre> mount -t debugfs nodev /sys/kernel/debug/</pre><p>If you find that the leak is in the slab allocator. There is in kernel slab debugger that you can enable by putting CONFIG_SLUB_DEBUG=y in the .config file when you build your kernel. Once the Kernel is up and the module you want to debug is running simply doing</p><pre> echo 1 &gt; /sys/kernel/slab/&lt;leaking_slab&gt;/trace.</pre><p>Will give out a slab allocation trace that would point to possible memory leak.</p><p>Slabtop command also can be used to monitor the slab allocation and usage.</p><p>See the below link for further information.</p><p><a href="https://linoxide.com/linux-command/kernel-slab-cache-informationa">https://linoxide.com/linux-command/kernel-slab-cache-informationa</a></p><h4>Latency/ performance issues</h4><p>Latency issues occurs due to code that is not optimised for the underlying hardware or due to the incorrect or suboptimal usage and/or of apis exposed by other subsystem layers in the kernel. There are many tools out there to monitor the performance of different subsystems.</p><h4>Race condition</h4><p>Race conditions can be detected by introducing a delay in the code. Sometimes a simple printk might be enough.</p><h3>Misc</h3><p>There is a great facility built in the kernel filesystem which can be of great help in verifying debugging many of the issues. Can get more about it here</p><p><a href="https://johnsofteng.wordpress.com/2013/11/20/sysfs-procfs-sysctl-debugfs-and-other-similar-kernel-interfacesa">https://johnsofteng.wordpress.com/2013/11/20/sysfs-procfs-sysctl-debugfs-and-other-similar-kernel-interfacesa</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fa984e4d2a09" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[My solid step on the job search road]]></title>
            <link>https://medium.com/@christina.jacob.koikara/my-placement-preparation-a4acf7438061?source=rss-54f3e174cfea------2</link>
            <guid isPermaLink="false">https://medium.com/p/a4acf7438061</guid>
            <dc:creator><![CDATA[Christina Jacob]]></dc:creator>
            <pubDate>Mon, 23 Sep 2019 05:25:30 GMT</pubDate>
            <atom:updated>2020-04-02T05:22:41.622Z</atom:updated>
            <content:encoded><![CDATA[<p>So I decided to move on at the end of my fourth year at my first company. I had a longer duration road map as I had a family to look after and some other personal commitments. Here is how I did it.</p><h4>Working on your core areas of strength</h4><p>I am from computer science background working in linux device drivers, So Data structures, algorithms and operating systems are my core subjects with a bit of understanding in linux networking stack. Went back to the basics, did my home work. solved problems and attended some online courses.</p><h4><strong>Programming</strong></h4><p>Writing correct code on paper or white board is the next thing I practiced. This is some advice that I had been neglecting for long. Its really worth it. Even if you are a good programmer, this won’t come naturally to you. You have to practice.</p><h4>Solving problems within a time frame.</h4><p>There are many online programming portals that help you do so. I did it on <a href="https://www.interviewbit.com/">https://www.interviewbit.com/</a> . Writing actual compiling code with all corner cases will actually sharpen your programming and analytical/logical thinking skills. It hleps you do things time aware and gives you bit of a pressure that you would actually face in a real interview and will take you to the mood.</p><p><strong>Your resume.</strong></p><p>In India The resumes are screened by either the company HR or the consultants. They have limited domain knowledge. So the initial resume I had, was a more technically descriptive one which had more details about the specific tasks I did. When I got the calls I realised that they are looking for just the keywords nothing more. The initial telephonic screening would actually look in detail about what you actually did. You are there to explain that. I changed my resume to a more visually impressive one and included more domain specific keywords. Ended up getting me more calls.</p><p><strong>On the day of interview</strong></p><p>You have to be genuine and should have learned to think under pressure. Ofcourse they have the consideration, but if you do well under pressure that is a plus point. For the question “If you have any more questions” ask a genuine question not anything that you saw on the internet.</p><p><strong>And you</strong></p><p>One of the bigger problems I had to tackle was my self. I was a poor performer when it comes to interview despite being active and academically good. So the first thing I did was not to hesitate whenever I was asked to interview someone. It did great. First thing I understood is that most of the candidates that I had to interview was really pathetic. Only 1 out of 10 is my estimate of passed candidates in the initial screening test. I grew confident that I was better than I thought. I used to think that the interviewers knew in and out of what they asked. Except for really really good companies or some interviewers who make their own questions(evenif they make their own. It might be a varient of what you have seen already), yea almost all of them refer internet to compile their question list. At least few of the questions in the list. If the interviewer and you are working in the same domain its very likely that the questions that he finds relevant will be missed by you.So its an open book test, with the most important questions marked and sorted for you. This understanding immensely boosted my confidence. So I kept going through my text book, everyday atleast one question.</p><p>Some my ask out of text book questions from the syllabus, the above said things will be there for your rescue.</p><h4>The end note.</h4><p>It takes time. Have to be patient. It took me 3 moths to find a job that I was happy with, after a year long preparation. And remember to perform responsibly in the current organization even if you are looking out for a job. When you leave, make sure that they leave their doors open for you.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a4acf7438061" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Kexec and Kdump on arm64]]></title>
            <link>https://medium.com/@christina.jacob.koikara/kexec-and-kdump-on-arm64-e456132d410f?source=rss-54f3e174cfea------2</link>
            <guid isPermaLink="false">https://medium.com/p/e456132d410f</guid>
            <category><![CDATA[core-dump]]></category>
            <category><![CDATA[kdump]]></category>
            <category><![CDATA[kexec]]></category>
            <category><![CDATA[kernel-panic]]></category>
            <category><![CDATA[linux-kernel]]></category>
            <dc:creator><![CDATA[Christina Jacob]]></dc:creator>
            <pubDate>Tue, 17 Sep 2019 10:00:06 GMT</pubDate>
            <atom:updated>2020-04-02T05:16:36.979Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4XadGUVPqOKREOU4DD82PA.png" /><figcaption>Kexec and kdump howto mindmap</figcaption></figure><p><strong>Kexec</strong> is a tool to boot another kernel image from the current one. So that you can have a faster system reboot without having to do any of the hardware initialization. This can be used in case of a system crash as well.</p><p><strong>Kdump </strong>is a dump capturing tool. kexec can be used to effectively to dump the kernel and core states in case of a system crash.</p><p><strong>Version information</strong></p><p><strong>verified</strong> with version 2.0.17.</p><p><strong>getting the sources:</strong></p><pre>wget <a href="https://mirrors.edge.kernel.org/pub/linux/utils/kernel/kexec/kexec-tools-2.0.17.tar.gz">https://mirrors.edge.kernel.org/pub/linux/utils/kernel/kexec/kexec-tools-2.0.17.tar.gz</a></pre><p>The kexec sources have kdump sources also. So don’t have to download kdump sources.</p><p>Note: The versions 2.0.10 and below don’t have arm64 support.</p><p><strong>Compiling the sources</strong></p><p>Native compilation did not work for me. Below are the steps for cross compilation.</p><pre>tar xvzf kexec-tools-2.0.17.tar.gz<br>cd kexec-tools-2.0.17<br>./configure --build=x86_64-linux --host=aarch64-unknown-linux-gnu --target=aarch64-unknown-linux-gnu<br>make ARCH=arm64 clean all<br>make install</pre><p><strong>Run the binaries</strong></p><p><em>system kernel configuration</em></p><p>in make menuconfig while compiling the kernel, enable the below listed items</p><pre>CONFIG_KEXEC=y<br>CONFIG_SYSFS=y<br>CONFIG_DEBUG_INFO=Y<br>Add crashkernel=0M-2G:128M,2G-6G:256M,6G-8G:512M,8G-:768M to bootargs</pre><p>The crashkernel bootargs has to be supplied based on the amount of ram available. Can find more details about crashkernel bootargs in the below link</p><p><a href="https://access.redhat.com/solutions/59432">How should the crashkernel parameter be configured for using kdump on RHEL6? - Red Hat Customer Portal</a></p><p><em>crash kernel/dump-capture kernel configuration</em></p><pre>CONFIG_CRASH_DUMP=y<br>CONFIG_PROC_VMCORE=y</pre><p><em>Load the Dump-capture Kernel</em></p><pre>kexec -p &lt;dump capture kernel path&gt; — append=”`cat /proc/cmdline` reset_devices”</pre><p>The kernel image gets booted on crash. For testing purpose you can create a crash with the following command.</p><pre>echo c &gt; /proc/sysrq-trigger</pre><p><em>Write Out to the Dump File</em></p><p>After the dump-capture kernel is booted, write out the dump file with the following command:</p><pre>cp /proc/vmcore &lt;dump-file&gt;</pre><p><em>Misc</em></p><p>You can place the kexec command in the do_stop function of script /etc/init.d/reboot so that the secondary kernel boots in on reboot.</p><p><a href="https://wiki.ubuntu.com/RapidReboot">Ubuntu Wiki</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e456132d410f" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>