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)
Sun, Jul 26, 3:38 PM
Unknown Object (File)
Sat, Jul 25, 5:00 AM
Unknown Object (File)
Fri, Jul 24, 2:46 PM
Unknown Object (File)
Thu, Jul 23, 5:24 PM
Unknown Object (File)
Thu, Jul 23, 4:56 PM
Unknown Object (File)
Thu, Jul 23, 4:23 PM
Unknown Object (File)
Thu, Jul 23, 3:54 PM
Unknown Object (File)
Thu, Jul 23, 3:21 PM
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 Not Applicable
Unit
Tests Not Applicable

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.Fri, Jul 10, 4:19 AM
This revision was automatically updated to reflect the committed changes.