Petr Machata

Recent Posts

Querying DWARF For Fun And Profit

Querying DWARF For Fun And Profit

dwarfDebugging information provides a view into the source code of an application. It’s by no means exhaustive, but many features present in the source code are present in the debugging information as well: translation units, functions, scopes, types, variables, etc. It is essential to a range of tools: GDB, SystemTap, OProfile, as well as various developer aids (such as pahole or libabigail).

So clearly this data can be a useful source of information (hence the name, after all). But the only way to access it is through a dumping tool—such as dwarfdump or {eu-,}readelf -w. Deriving any sort of relationship from a dump is a very clumsy undertaking that usually requires nontrivial amounts of scripting to glue the disparate pieces together.

A new tool that Red Hat has been working on lately addresses the need to query debugging information in a structured manner. It is called dwgrep (DWARF grep). As the name indicates, it’s aimed particularly at DWARF, which is the name of the format that’s generally used in Linux for representing debugging information.

There are two major families of use cases. The first is automated checking of generated DWARF. This comprises looking for instances of a known bug when trying to gauge its impact, discovery of an obscure DWARF construct to check a DWARF consumer that you are writing, or testing DWARF for structural soundness.

Continue reading “Querying DWARF For Fun And Profit”

Share

Intelⓡ Threading Building Blocks in Red Hat Enterprise Linux 7

That the “free lunch is over” may have become something of a cliche in the IT industry, but the fact is that lately, the increase in cycles per second has been mostly realized by adding more processing units rather than by other techniques. While multiprocessor mainframes and supercomputers existed essentially since the dawn of computing, this may be the first time ever that the only machines without multicore processors may be those in USB fridges and electric toothbrushes.

parallel curves evolvent
Involute of a circle – parallel curves.

This changes the way that even ordinary programs need to be written. The parallelism inherent in the computation can no longer be extracted automatically from the instruction stream, but the programmer herself needs to make it explicit.

To that end, there were historically several approaches.

Continue reading “Intelⓡ Threading Building Blocks in Red Hat Enterprise Linux 7”

Share

ltrace for RHEL 6 and 7

Debugging software is something akin to an art form but, regardless of the approach you prefer, having good information on what’s happening in your application is key. ltrace is one tool you may wish to add to your belt – a debugging tool that attaches to a running process, and prints to the terminal or a log file the library calls and/or system calls made by that process. In both its mode of operation and command line interface, ltrace is similar to strace. While strace only works for system calls, however, ltrace has no such restriction.

Continue reading “ltrace for RHEL 6 and 7”

Share