]> git.baikalelectronics.ru Git - kernel.git/commit
recordmcount: Rewrite error/success handling
authorMatt Helsley <mhelsley@vmware.com>
Wed, 31 Jul 2019 18:24:12 +0000 (11:24 -0700)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Sat, 31 Aug 2019 16:19:39 +0000 (12:19 -0400)
commitd8e9442d2554dd8ad9089cf312db9ac75237ff1c
treebd81e94a57bb644dc05a6763a0ebc1f8c059a09f
parentee1ca31fd9ff4f01b60c3a0826c0bf50bda01ba2
recordmcount: Rewrite error/success handling

Recordmcount uses setjmp/longjmp to manage control flow as
it reads and then writes the ELF file. This unusual control
flow is hard to follow and check in addition to being unlike
kernel coding style.

So we rewrite these paths to use regular return values to
indicate error/success. When an error or previously-completed object
file is found we return an error code following kernel
coding conventions -- negative error values and 0 for success when
we're not returning a pointer. We return NULL for those that fail
and return non-NULL pointers otherwise.

One oddity is already_has_rel_mcount -- there we use pointer comparison
rather than string comparison to differentiate between
previously-processed object files and returning the name of a text
section.

Link: http://lkml.kernel.org/r/8ba8633d4afe444931f363c8d924bf9565b89a86.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
scripts/recordmcount.h