[GIT PULL] scripts/sorttable: Updates for 6.14

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Linus,

Updates to scripts/sorttable for 6.14:

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.


Please pull the latest trace-sorttable-v6.14 tree, which can be found at:


  git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git
trace-sorttable-v6.14

Tag SHA1: fabf1492e45892c215eff466f80b62284f50854f
Head SHA1: 1e5f6771c247b28135307058d2cfe3b0153733dc


Steven Rostedt (15):
      scripts/sorttable: Remove unused macro defines
      scripts/sorttable: Remove unused write functions
      scripts/sorttable: Remove unneeded Elf_Rel
      scripts/sorttable: Have the ORC code use the _r() functions to read
      scripts/sorttable: Make compare_extable() into two functions
      scripts/sorttable: Convert Elf_Ehdr to union
      scripts/sorttable: Replace Elf_Shdr Macro with a union
      scripts/sorttable: Convert Elf_Sym MACRO over to a union
      scripts/sorttable: Add helper functions for Elf_Ehdr
      scripts/sorttable: Add helper functions for Elf_Shdr
      scripts/sorttable: Add helper functions for Elf_Sym
      scripts/sorttable: Use uint64_t for mcount sorting
      scripts/sorttable: Move code from sorttable.h into sorttable.c
      scripts/sorttable: Get start/stop_mcount_loc from ELF file directly
      scripts/sorttable: Use a structure of function pointers for elf helpers

----
 scripts/sorttable.c | 740 ++++++++++++++++++++++++++++++++++++++++++++++++----
 scripts/sorttable.h | 500 -----------------------------------
 2 files changed, 685 insertions(+), 555 deletions(-)
 delete mode 100644 scripts/sorttable.h
---------------------------




[Index of Archives]     [Linux&nblp;USB Development]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite Secrets]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux