• Home
Name Date Size #Lines LOC

..--

.gitignoreD03-May-202428 43

README.mdD03-May-20242.2 KiB4939

abitool.pyD03-May-20242.4 KiB7243

bootstrapD03-May-20241.7 KiB6635

diff_abiD03-May-20241.6 KiB5127

dump_abiD03-May-20241.5 KiB4824

README.md

1ABI Monitoring Utilities
2========================
3
4This directory contains scripts and utilities to compare, track and mitigate
5changes to the kernel ABI. The comparison framework used is
6[libabigail](https://sourceware.org/libabigail/), but this might change in the
7future. Follow the instructions below to set up the current prerequisites.
8
9Set up the prerequisites
10------------------------
11The script `bootstrap` will install the system prerequisites
12 - libxml2-dev
13 - elfutils
14
15It will then acquire the libabigail sources and build the required binaries.
16At the very end the script will print instructions how to add the binaries to
17the local `${PATH}` to be used by the remaining utilities.
18
19You can skip this step if your host system provides a suitable version of the
20libabigail tooling including the binaries `abidw` and `abidiff`.
21
22
23Creating ABI dumps from kernel trees
24------------------------------------
25Provided a linux kernel tree with built vmlinux and kernel modules, the tool
26`dump_abi` creates an ABI representation using the selected abi tool. As of now
27there is only one option: 'libabigail' (default). A sample invocation looks as
28follows:
29  $ dump_abi --linux-tree path/to/out --out-file /path/to/abidump.out
30
31To ensure a consistent environment and stable toolchain, a wrapper script is
32provided at the topmost directory of this project: `build_abi.sh`. It builds
33the kernel using `build.sh` and therefore accepts the same environment
34variables to customize the build, such as BUILD_CONFIG, CC and the various
35SKIP_* variables to speed up incremental builds. Following a successful build,
36`build_abi.sh` will create an ABI dump in the DIST_DIR of the build. A sample
37invocation from the top of the repo tree looks as follows:
38  $ BUILD_CONFIG=path/to/build.config build/build_abi.sh
39
40Comparing ABI dumps
41-------------------
42ABI dumps created by `dump_abi` can be compared with `diff_abi`. Ensure to use
43the same abi-tool for `dump_abi` and `diff_abi`. A sample invocation looks as
44follows:
45  $ diff_abi --baseline dump1.out --new dump2.out --report report.out
46
47The report created is tool specific, but generally lists ABI changes detected
48that affect the Kernel's module interface.
49