Move from using a linker set to a constructor function that's
called. This simplifies the code and is slightly more obvious. We now
keep a list of page decoders rather than having an array we managed
before. Commands will move to something similar in the future.
Details
- Reviewers
jhb - Commits
- rS344469: Rework logpage extensibility.
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 22631 Build 21740: arc lint + arc unit
Event Timeline
I know the linkerset for commands is also ultimately my fault (I used it mfiutil and then mptutil and this looks like it was copied from there), but those should perhaps register in the same way. That is a bit harder because of the tree of lists though.
I invented them independently for nvmecontrol.
I have another, somewhat more extensive patch in the works that does what you suggest. It also abstracts out the parsing so most code can just call the parser and it's all table driven. For commands with only a few options, this is about a wash. For commands with lots of options, this is a big win. I'm also adding a linux-compatible passthrough command, which has lots of options, and lots of long options. So that's in there too. Maybe we should make that thing I'm working on a private library and spread it around to the different FreeBSD utilities...
Thanks for the review.