Page MenuHomeFreeBSD

kldxref: Add -m filag to print info about modules in one file
ClosedPublic

Authored by imp on Jun 27 2026, 1:28 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Aug 14, 2:12 PM
Unknown Object (File)
Thu, Aug 13, 1:53 PM
Unknown Object (File)
Wed, Aug 12, 11:38 PM
Unknown Object (File)
Tue, Aug 11, 11:39 PM
Unknown Object (File)
Mon, Aug 10, 11:10 AM
Unknown Object (File)
Sun, Aug 9, 11:58 AM
Unknown Object (File)
Tue, Aug 4, 4:52 AM
Unknown Object (File)
Tue, Aug 4, 2:43 AM
Subscribers

Details

Summary

kldxref -m <file> will print the same data that the '-d' flag produces,
except restrict the output to one file. This should be the full path to
the file, and the directory name to process is omitted.

Sponsored by: Netflix

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74323
Build 71206: arc lint + arc unit

Event Timeline

imp requested review of this revision.Jun 27 2026, 1:28 PM
jrtc27 added inline comments.
usr.sbin/kldxref/kldxref.c
796

Isn't < 0 impossible, as that would imply getopt ran off the end of argv? And don't you want to check that no extra arguments were passed for -m, given we skip the fts_open(argv)? That is:

if ((module != NULL && argc - optind > 0) || (module == NULL && argc - optind < 1))

or, if you want to be sneaky:

if ((module == NULL) == (argc - optind < 1))
This revision was not accepted when it landed; it landed in state Needs Review.Jul 10 2026, 4:19 AM
This revision was automatically updated to reflect the committed changes.