mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-01-22 07:53:11 -05:00
No description
c0e75905ca
The sorttable.c was a copy from recordmcount.c which is very hard to maintain. That's because it uses macro helpers and places the code in a header file sorttable.h to handle both the 64 bit and 32 bit version of the Elf structures. It also uses _r()/r()/r2() wrappers around accessing the data which will read the 64 bit or 32 bit version of the data as well as handle endianess. If the wrong wrapper is used, an invalid value will result, and this has been a cause for bugs in the past. In fact the new ORC code doesn't even use it. That's fine because ORC is only for 64 bit x86 which is the default parsing. Instead of having a bunch of macros defined and then include the code twice from a header, the Elf structures are each wrapped in a union. The union holds the 64 bit and 32 bit version of the needed structure. Then a structure of function pointers is used, along with helper macros to access the ELF types appropriately for their byte size and endianess. How to reference the data fields is moved from the code that implements the sorting to the helper functions where all accesses to a field will use he same helper function. As long as the helper functions access the fields correctly, the code will also access the fields. This is an improvement over having to code implementing the sorting having to make sure it always uses the right accessor function when reading an ELF field. This is a clean up only, the functionality of the scripts/sorttable.c does not change. -----BEGIN PGP SIGNATURE----- iIoEABYIADIWIQRRSw7ePDh/lE+zeZMp5XQQmuv6qgUCZ5AO2RQccm9zdGVkdEBn b29kbWlzLm9yZwAKCRAp5XQQmuv6qj6pAQDAHA3mtawVYgq/Kw8OAc6r2NLP5Q58 8nptwPVoATomLgEA2HO38cu1N8Fxg+zMgQ4L9eYfa0QdE3XKD0WNbG4x7wE= =go8s -----END PGP SIGNATURE----- Merge tag 'trace-sorttable-v6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace Pull scipts/sorttable updates from Steven Rostedt: "The sorttable.c was a copy from recordmcount.c which is very hard to maintain. That's because it uses macro helpers and places the code in a header file sorttable.h to handle both the 64 bit and 32 bit version of the Elf structures. It also uses _r()/r()/r2() wrappers around accessing the data which will read the 64 bit or 32 bit version of the data as well as handle endianess. If the wrong wrapper is used, an invalid value will result, and this has been a cause for bugs in the past. In fact the new ORC code doesn't even use it. That's fine because ORC is only for 64 bit x86 which is the default parsing. Instead of having a bunch of macros defined and then include the code twice from a header, the Elf structures are each wrapped in a union. The union holds the 64 bit and 32 bit version of the needed structure. Then a structure of function pointers is used, along with helper macros to access the ELF types appropriately for their byte size and endianess. How to reference the data fields is moved from the code that implements the sorting to the helper functions where all accesses to a field will use he same helper function. As long as the helper functions access the fields correctly, the code will also access the fields. This is an improvement over having to code implementing the sorting having to make sure it always uses the right accessor function when reading an ELF field. This is a clean up only, the functionality of the scripts/sorttable.c does not change" * tag 'trace-sorttable-v6.14' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace: scripts/sorttable: Use a structure of function pointers for elf helpers scripts/sorttable: Get start/stop_mcount_loc from ELF file directly scripts/sorttable: Move code from sorttable.h into sorttable.c scripts/sorttable: Use uint64_t for mcount sorting scripts/sorttable: Add helper functions for Elf_Sym scripts/sorttable: Add helper functions for Elf_Shdr scripts/sorttable: Add helper functions for Elf_Ehdr scripts/sorttable: Convert Elf_Sym MACRO over to a union scripts/sorttable: Replace Elf_Shdr Macro with a union scripts/sorttable: Convert Elf_Ehdr to union scripts/sorttable: Make compare_extable() into two functions scripts/sorttable: Have the ORC code use the _r() functions to read scripts/sorttable: Remove unneeded Elf_Rel scripts/sorttable: Remove unused write functions scripts/sorttable: Remove unused macro defines |
||
---|---|---|
arch | ||
block | ||
certs | ||
crypto | ||
Documentation | ||
drivers | ||
fs | ||
include | ||
init | ||
io_uring | ||
ipc | ||
kernel | ||
lib | ||
LICENSES | ||
mm | ||
net | ||
rust | ||
samples | ||
scripts | ||
security | ||
sound | ||
tools | ||
usr | ||
virt | ||
.clang-format | ||
.clippy.toml | ||
.cocciconfig | ||
.editorconfig | ||
.get_maintainer.ignore | ||
.gitattributes | ||
.gitignore | ||
.mailmap | ||
.rustfmt.toml | ||
COPYING | ||
CREDITS | ||
Kbuild | ||
Kconfig | ||
MAINTAINERS | ||
Makefile | ||
README |
Linux kernel ============ There are several guides for kernel developers and users. These guides can be rendered in a number of formats, like HTML and PDF. Please read Documentation/admin-guide/README.rst first. In order to build the documentation, use ``make htmldocs`` or ``make pdfdocs``. The formatted documentation can also be read online at: https://www.kernel.org/doc/html/latest/ There are various text files in the Documentation/ subdirectory, several of them using the reStructuredText markup notation. Please read the Documentation/process/changes.rst file, as it contains the requirements for building and running the kernel, and information about the problems which may result by upgrading your kernel.