Language Selection

English French German Italian Portuguese Spanish

Kernel Debugging Techniques

Filed under
HowTos

Often the pivotal factor in achieving development timetables comes down to one's efficiency in finding and fixing bugs. Debugging inside the Linux kernel can be quite challenging. No matter how you approach it, kernel debugging will always be complex. This chapter examines some of the complexities and presents ideas and methods to improve your debugging skills inside the kernel and device drivers.

Debugging Optimized Kernel Code

At the start of this chapter, we said that one of the challenges identified in debugging kernel code results from compiler optimization. We noted that the Linux kernel is compiled by default with optimization level -O2. In the examples up to this point, we used -O1 optimization to simplify the debugging task. Here we illustrate one of the many ways optimization can complicate debugging.

The related Internet mail lists are strewn with questions related to what appear to be broken tools. Sometimes the poster reports that his debugger is singlestepping backward or that his line numbers do not line up with his source code. Here we present an example to illustrate the complexities that optimizing compilers bring to source-level debugging. In this example, the line numbers that gdb reports when a breakpoint is hit do not match up with the line numbers in our source file due to function inlining.

Full Story.

More in Tux Machines

Nvidia 361.45.11 Graphics Driver Released for Linux, FreeBSD and Solaris Systems

Today, May 24, 2016, Nvidia released a new long-lived graphics drivers for Unix users, version 361.45.11, available now for GNU/Linux, FreeBSD, and Solaris operating systems. Read more Also: New NVIDIA 361 Linux Driver Released

Android Leftovers

NVIDIA vs. AMD OpenGL & Vulkan Benchmarks With Valve's Dota 2

Yesterday marked the public availability of Dota 2 with a Vulkan renderer after Valve had been showing it off for months. This is the second commercial Linux game (after The Talos Principle) to sport a Vulkan renderer and thus we were quite excited to see how this Dota 2 Vulkan DLC is performing for both NVIDIA GeForce and AMD Radeon graphics cards. Here are our initial Dota 2 benchmarks with Vulkan as well as OpenGL for reference when using the latest Linux graphics drivers on Ubuntu. Read more

Why Hyperledger wants to be the ‘Linux of blockchain’

Blockchain technology offers many different benefits to enterprise developers — but there’s no cross-industry open standard for how to develop it. That makes it difficult for vendors and CIO customers to place their bets and begin building it into their technology architecture. Hyperledger, a Linux Foundation project to produce a standard open-source blockchain, wants to solve that problem, and it just got an executive director, Brian Behlendorf, to help it on its way. He founded the Apache Software Foundation, was previously on the board of the Mozilla Foundation and the Electronic Frontier Foundation, and managed tech VC firm Mithril Capital Management. Read more