abidw: Add a --kmi-stablelist option alongside existing --kmi-whitelist

* doc/manuals/abidw.rst: Update the documentation.
	* tools/abidw.cc (display_usage): Add a help string for the new
	--kmi-stablelist.
	(parse_command): Parse it.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
This commit is contained in:
Dodji Seketeli 2024-08-22 17:37:25 +02:00
parent 0a6ffe1169
commit 32be4dd23c
2 changed files with 11 additions and 8 deletions

View File

@ -134,20 +134,22 @@ Options
specifications are suppressed from the output of this tool. specifications are suppressed from the output of this tool.
* ``--kmi-whitelist | -kaw`` <*path-to-whitelist*> * ``--kmi-whitelist | --kmi-stablelist |-w`` <*path-to-stablelist*>
When analyzing a `Linux Kernel`_ binary, this option points to the When analyzing a `Linux Kernel`_ binary, this option points to the
white list of names of ELF symbols of functions and variables list of names of ELF symbols of functions and variables which ABI
which ABI must be written out. That white list is called a " must be written out. Any function or variable with a name that is
Kernel Module Interface white list". This is because for the not included in that list will not ignored. That list is called a
" Kernel Module Interface stable list". This is because for the
Kernel, we don't talk about the ABI; we rather talk about the Kernel, we don't talk about the ABI; we rather talk about the
interface between the Kernel and its module. Hence the term interface between the Kernel and its module. Hence the term
``KMI`` rather than ``ABI`` ``KMI`` rather than ``KABI``.
Any other function or variable which ELF symbol are not present in Any other function or variable which ELF symbol are not present in
that white list will not be considered by the KMI writing process. that stable list will not be considered by the KMI writing
process.
If this option is not provided -- thus if no white list is If this option is not provided -- thus if no stable list is
provided -- then the entire KMI, that is, all publicly defined and provided -- then the entire KMI, that is, all publicly defined and
exported functions and global variables by the `Linux Kernel`_ exported functions and global variables by the `Linux Kernel`_
binaries is emitted. binaries is emitted.

View File

@ -239,7 +239,7 @@ display_usage(const string& prog_name, ostream& out)
"interfaces from the binary" "interfaces from the binary"
<< " --no-linux-kernel-mode don't consider the input binary as " << " --no-linux-kernel-mode don't consider the input binary as "
"a Linux Kernel binary\n" "a Linux Kernel binary\n"
<< " --kmi-whitelist|-w path to a linux kernel " << " --kmi-whitelist|--kmi-stablelist|-w path to a linux kernel "
"abi whitelist\n" "abi whitelist\n"
<< " --linux-tree|--lt emit the ABI for the union of a " << " --linux-tree|--lt emit the ABI for the union of a "
"vmlinux and its modules\n" "vmlinux and its modules\n"
@ -356,6 +356,7 @@ parse_command_line(int argc, char* argv[], options& opts)
++i; ++i;
} }
else if (!strcmp(argv[i], "--kmi-whitelist") else if (!strcmp(argv[i], "--kmi-whitelist")
|| !strcmp(argv[i], "--kmi-stablelist")
|| !strcmp(argv[i], "-w")) || !strcmp(argv[i], "-w"))
{ {
int j = i + 1; int j = i + 1;