mbox series

[v2,0/9] dump: Cleanup and consolidation

Message ID 20220310110854.2701-1-frankja@linux.ibm.com (mailing list archive)
Headers show
Series dump: Cleanup and consolidation | expand

Message

Janosch Frank March 10, 2022, 11:08 a.m. UTC
The dump/dump.c file has lots of duplicated code for handling 64 and
32 bit elf files. Additionally there are many instances where code can
be improved by adding a variable to avoid having to specify the same
calculation or check over and over.

This series is the cleanup step onto which my series that adds custom
section support and finally the series that introduces PV dump support
are based on.

Personal comments:
It's taken me quite a while to understand how the code works and I
expect that this patch might improve that but it won't fix every
issue. Going forward it might make sense to split kdump and elf dump
code into separate files and also cleanup the kdump code.

v2:
	* Added the ERRP_GUARD() patch which converts dump.c to the
          new error handling methods
	* Switched patches #2 and #3 around
	* Added a patch that removes the section if/else
	* Moved dump_is_64bit() to dump.c


Janosch Frank (9):
  dump: Use ERRP_GUARD()
  dump: Remove the sh_info variable
  dump: Introduce shdr_num to decrease complexity
  dump: Remove the section if when calculating the memory offset
  dump: Add more offset variables
  dump: Introduce dump_is_64bit() helper function
  dump: Consolidate phdr note writes
  dump: Cleanup dump_begin write functions
  dump: Consolidate elf note function

 dump/dump.c           | 361 ++++++++++++++++++------------------------
 include/sysemu/dump.h |   9 +-
 2 files changed, 164 insertions(+), 206 deletions(-)