Skip to content

recordmcount cleanups

Matt Helsley linux-arm-kernel lkml 4 versions – Applied

Status from this message: I applied these patches to my queue.

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v4 Latest8 patches 6 repliesApplied
  2. v313 patches 11 repliesSuperseded
  3. v213 patches 5 repliesSuperseded
Earlier versions · 1
VersionPostedPatchesRepliesStatus
v1 RFC13 patches7 repliesSuperseded

Changes in v4 from the cover letter

Addressed feedback on v3 from Steven Rostedt:
Moved already_has_mcount into recordmcount.c to avoid
unnecessary multiple definitions.
Changed return semantics of find_secsym_ndx() to avoid
need for missing_sym (and multiple definitions) and to separate the returned symbol info (value, index) from success/failure indication.
Fixed up local variable declaration to follow inverted
christmas tree style.

Patches in v4 Applied

#Subject and filesSizeRepliesApplied
1/8recordmcount: Remove redundant strcmpscripts/recordmcount.c+1 -20 replies
2/8recordmcount: Remove uread()scripts/recordmcount.c+5 -130 replies
3/8recordmcount: Remove unused fd from uwrite() and ulseek()scripts/recordmcount.c scripts/recordmcount.h+21 -210 replies
4/8recordmcount: Rewrite error/success handlingscripts/recordmcount.c scripts/recordmcount.h+184 -1195 replies
5/8recordmcount: Kernel style function signature formattingscripts/recordmcount.c scripts/recordmcount.h+13 -210 replies
6/8recordmcount: Kernel style formattingscripts/recordmcount.c+25 -220 replies
7/8recordmcount: Remove redundant cleanup() callsscripts/recordmcount.c scripts/recordmcount.h+0 -150 replies
8/8recordmcount: Clarify what cleanup() doesscripts/recordmcount.c+81 -700 replies

Reviews trailers per patch

None of the 8 patches has a Reviewed-by or Acked-by.

PatchUwe Kleine-König
1/8
2/8
3/8
4/8T-b
5/8
6/8
7/8
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v4 thread

Cover letter [PATCH v4 0/8] recordmcount cleanups

recordmcount presents unnecessary challenges to reviewers:

It pretends to wrap access to the ELF file in uread/uwrite/ulseek functions which aren't related the way you might think (i.e. not the way read, write, and lseek are releated to each other).

It uses setjmp/longjmp to handle errors (and success) during processing of the object files. This makes it hard to review what functions are doing, how globals change over time, etc.

There are some kernel style nits.

This series addresses all of those by removing un-helper functions, unused parameters, and rewriting the error/success handling to better resemble regular kernel C code.

--

This series was formerly part of a v3 posted under the subject "Cleanup recordmcount and begin objtool conversion". I am reposting it split into two series: these cleanups of recordmcount and a second series that begins the conversion of the cleaned-up recordmcount into an objtool subcommand called mcount.

v4:
Addressed feedback on v3 from Steven Rostedt:
Moved already_has_mcount into recordmcount.c to avoid
unnecessary multiple definitions.
Changed return semantics of find_secsym_ndx() to avoid
need for missing_sym (and multiple definitions) and to separate the returned symbol info (value, index) from success/failure indication.
Fixed up local variable declaration to follow inverted
christmas tree style.

Matt Helsley (8):
recordmcount: Remove redundant strcmp
recordmcount: Remove uread()
recordmcount: Remove unused fd from uwrite() and ulseek()
recordmcount: Rewrite error/success handling
recordmcount: Kernel style function signature formatting
recordmcount: Kernel style formatting
recordmcount: Remove redundant cleanup() calls
recordmcount: Clarify what cleanup() does

 scripts/recordmcount.c | 321 ++++++++++++++++++++---------------------
 scripts/recordmcount.h | 150 +++++++++++++------
 2 files changed, 259 insertions(+), 212 deletions(-)
Signature · 1 line
2.20.1