How To Install dwarves on Fedora 36
Introduction
In this tutorial we learn how to install dwarves
on Fedora 36.
What is dwarves
dwarves is a set of tools that use the debugging information inserted in ELF binaries by compilers such as GCC, used by well known debuggers such as GDB, and more recent ones such as systemtap. Utilities in the dwarves suite include pahole, that can be used to find alignment holes in structs and classes in languages such as C, C++, but not limited to these. It also extracts other information such as CPU cacheline alignment, helping pack those structures to achieve more cache hits. These tools can also be used to encode and read the BTF type information format used with the Linux kernel bpf syscall, using ‘pahole -J’ and ‘pahole -F btf’. A diff like tool, codiff can be used to compare the effects changes in source code generate on the resulting binaries. Another tool is pfunct, that can be used to find all sorts of information about functions, inlines, decisions made by the compiler about inlining, etc. One example of pfunct usage is in the fullcircle tool, a shell that drivers pfunct to generate compileable code out of a .o file and then build it using gcc, with the same compiler flags, and then use codiff to make sure the original .o file and the new one generated from debug info produces the same debug info. Pahole also can be used to use all this type information to pretty print raw data according to command line directions. Headers can have its data format described from debugging info and offsets from it can be used to further format a number of records. The btfdiff utility compares the output of pahole from BTF and DWARF to make sure they produce the same results.
We can use yum
or dnf
to install dwarves
on Fedora 36. In this tutorial we discuss both methods but you only need to choose one of method to install dwarves.
Install dwarves on Fedora 36 Using dnf
Update yum database with dnf
using the following command.
sudo dnf makecache --refresh
After updating yum database, We can install dwarves
using dnf
by running the following command:
sudo dnf -y install dwarves
Install dwarves on Fedora 36 Using yum
Update yum database with yum
using the following command.
sudo yum makecache --refresh
After updating yum database, We can install dwarves
using yum
by running the following command:
sudo yum -y install dwarves
How To Uninstall dwarves on Fedora 36
To uninstall only the dwarves
package we can use the following command:
sudo dnf remove dwarves
dwarves Package Contents on Fedora 36
/usr/bin/btfdiff
/usr/bin/codiff
/usr/bin/ctracer
/usr/bin/dtagnames
/usr/bin/fullcircle
/usr/bin/ostra-cg
/usr/bin/pahole
/usr/bin/pdwtags
/usr/bin/pfunct
/usr/bin/pglobal
/usr/bin/prefcnt
/usr/bin/scncopy
/usr/bin/syscse
/usr/lib/.build-id
/usr/lib/.build-id/01
/usr/lib/.build-id/01/456f680c12b95fed65b5dc47a30ee2ee239e81
/usr/lib/.build-id/05
/usr/lib/.build-id/05/8dbe5a10b4d0d438c5bdb63541b6310938a62e
/usr/lib/.build-id/0a
/usr/lib/.build-id/0a/7f2e44cba87b8594d6fed2cbc5ba43d6ac868f
/usr/lib/.build-id/4b
/usr/lib/.build-id/4b/c3681734ff1c56e4bdaac8f09e2958f4782a96
/usr/lib/.build-id/56
/usr/lib/.build-id/56/dcc85c8829071436be4afff2d029123ad122a4
/usr/lib/.build-id/6d
/usr/lib/.build-id/6d/78bdf765077887226dfefa541f67ea530919ee
/usr/lib/.build-id/70
/usr/lib/.build-id/70/b0c001f3c03bc17cd80b05ed48400a67cc39cd
/usr/lib/.build-id/72
/usr/lib/.build-id/72/75d49a0e9adf7e9a503cb9e51946704432dce6
/usr/lib/.build-id/ac
/usr/lib/.build-id/ac/973547da4d625e86f42dc32871ff2fbdd7178a
/usr/lib/.build-id/de
/usr/lib/.build-id/de/4272fc9600fc4d12dee214172216310e97bb12
/usr/share/doc/dwarves
/usr/share/doc/dwarves/NEWS
/usr/share/doc/dwarves/README.btf
/usr/share/doc/dwarves/README.ctracer
/usr/share/doc/dwarves/changes-v1.23
/usr/share/dwarves
/usr/share/dwarves/runtime
/usr/share/dwarves/runtime/Makefile
/usr/share/dwarves/runtime/ctracer_relay.c
/usr/share/dwarves/runtime/ctracer_relay.h
/usr/share/dwarves/runtime/linux.blacklist.cu
/usr/share/dwarves/runtime/python
/usr/share/dwarves/runtime/python/ostra.py
/usr/share/man/man1/pahole.1.gz
References
Summary
In this tutorial we learn how to install dwarves
on Fedora 36 using yum and [dnf]((/fedora/36/dnf/).