summaryrefslogtreecommitdiff
path: root/Documentation/abi-checker.txt
blob: 57caa2119e50ad125da2e3e0e51f1de57eb6d4c0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132

                       Linux kernel ABI/API checker
--------------------------------------------------------------------------

I. Introduction
===============

   "abi-checker" is a simple set of tools to:
- test changes in Linux kernel API/ABI.
- test compatibility kernel module wth kernel
- creates dump for external kernel modules with list of kernel symbols
  used by the module.


II. Application/scripts
=======================

1. abi-checker

   The application can be run in the following modes:
   - "test-kernel" - in the mode compares two Module.symvers files.
                   In case if some changes have been detected the
                   application creates report containg list of changed symbols
                   (added/changed/removed). Additionally summary ireport with
                   total number symbols, itotal number changed/modified/removed
                   symbols is created.

                   Usage:
                     abi-checker test-kernel file1 file2

                   Return values:
                     0 - if Module.symvers are identical
                     1 - if some changes have been detected.

   - "build-list" - in the mode the applications creates file containing linux kernel
                   symbols uses by the module.
                   As input the application expect:
                   - kernel Module.symvers file
                   - module symbols file - each line of the file has
                     name of the module symbol.

                   As output the application creates file in format like "Modules.symvers".

                   Usage:
                     abi-checker build-list Module.symvers kernel_symbols_file output_file

                   Return:
                     0 - success
                     1 - any error

   - "dump-module" - in the mode the application directly extracts from *.ko file
                   symbols and creates file in format like Module.symvers containing list
                   of kernel symbols used by the module.

                   Usage:
                     abi-checker dump-module Module.symvers module_ko_file output_file

                   Return:
                     0 - success
                     1 - any error

   - "test-module" - in the mode the application compares kernel "Module.symvers" file
                   with external module "Module.symvers" file. In case of any differences
                   list of changed/removed symbols is reported. Additionally summary info
                   with numer total number symbols, total number changed/modified/removed
                   symbols is created also.

                   Usage:
                     abi-checker test-module kernel_Module.symvers module_Module.symvers

                   Return:
                     0 - if all module symbols are identical with kernel symbols
                     1 - if some changes have been detected.

2. abi-module-checker - helper script. It simplify API/API checks for kernel module. Internally
                  the script call abi-checker in "test-module" mode. The script assumes that in
                  /boot/abi directory is present ABI/API repository for linux kernel.

                  Usage:
                    abi-module-checker kernel_module_abi_file

                  Return:
                    0 - if module API/ABI file is compatible with current kernel
                    1 - in case if module is not compatible with current kernel or error

3. abi-module-dumper - helper script. It simplify ABI/API module dump file creation. The script
                  assumes that in /boot/abi directory is present ABI/API repository for linux kernel.

                  Usage:
                    abi-module-dumper _module_ko_file_ _output_file_

                  Return:
                    0 - success
                    1 - any error

4. abi-module-kernels-list - helper script. The script reporst all kernel version compatible
                  with the given kernel module. The script assumes that in /boot/abi directory
                  is present ABI/API repository for linux kernel.

                  Usage:
                    abi-module-kernels-list _module_abi_file_

                  Return:
                    0 - success
                    1 - any error

III. Module.symvers file format
===============================

   Each line of the Module.symvers file has the folloing format:

	symbol_name<tab>symbol_crc<tab>module_name<tab>additiona_info

Example:
	...
	0x27e1a049      printk  vmlinux EXPORT_SYMBOL
	0xf85bebf9      dev_printk_emit vmlinux EXPORT_SYMBOL
	...

IV. Kernel ABI/API repository
=============================

   The ABI/API repository is located in /boot/abi direcotry. The repository contains list of all
ABI/API versions (also for historical kernel versions).
   The repository contains list of files which names are in format abi_${KERNELVERSION}_${ABIVERSION}.
ABI/API file for current kernel version is marked by current symbolic link.

V. Kernel ABI/API repository
============================

   Directory tools/abi-checker/data ABI/API Module.symvers for current and older kernel version.
Module.symvers for current kernel version is indicated by current symbolic link.