]> git.baikalelectronics.ru Git - kernel.git/commit
recordmcount: Clarify what cleanup() does
authorMatt Helsley <mhelsley@vmware.com>
Wed, 31 Jul 2019 18:24:16 +0000 (11:24 -0700)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Sat, 31 Aug 2019 16:19:40 +0000 (12:19 -0400)
commit51e9da981ff5f87b1c8790b138b0a134cff1731c
treef7756cb891050d01290851512e2ca26549c6b3d6
parent4666bf2106f2f48c1cc51cdc17c17f91e793853d
recordmcount: Clarify what cleanup() does

cleanup() mostly frees/unmaps the malloc'd/privately-mapped
copy of the ELF file recordmcount is working on, which is
set up in mmap_file(). It also deals with positioning within
the pseduo prive-mapping of the file and appending to the ELF
file.

Split into two steps:
mmap_cleanup() for the mapping itself
file_append_cleanup() for allocations storing the
appended ELF data.

Also, move the global variable initializations out of the main,
per-object-file loop and nearer to the alloc/init (mmap_file())
and two cleanup functions so we can more clearly see how they're
related.

Link: http://lkml.kernel.org/r/2a387ac86d133d22c68f57b9933c32bab1d09a2d.1564596289.git.mhelsley@vmware.com
Signed-off-by: Matt Helsley <mhelsley@vmware.com>
Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
scripts/recordmcount.c