Page MenuHomeFreeBSD

uexterr_gettext(3): support dynamic kernel categories
Needs ReviewPublic

Authored by brooks on Tue, Jul 14, 8:08 PM.
Tags
None
Referenced Files
F162994533: D58238.diff
Sun, Jul 19, 12:24 AM
Unknown Object (File)
Sat, Jul 18, 11:14 AM
Unknown Object (File)
Sat, Jul 18, 11:12 AM
Unknown Object (File)
Sat, Jul 18, 5:57 AM
Unknown Object (File)
Sat, Jul 18, 2:21 AM
Unknown Object (File)
Fri, Jul 17, 10:45 PM
Unknown Object (File)
Fri, Jul 17, 2:07 AM
Subscribers

Details

Reviewers
kib
mckusick
Summary

Add a rather hackish implementation of kernel categories intended
to demostrate that the mechanism works. A refactor is required
to fill a caller provided buffer and to move adding "sys/" inside.

Sponsored by: Innovate UK

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 74810
Build 71693: arc lint + arc unit

Event Timeline

I think I want to refactor cat_to_filename() to take a buffer and to handle the selective prepending of sys/, perhaps bumping the uexterr_gettext ABI. It's fine for in-tree code, but definitely wrong for out of tree modules.

tests/sys/kern/exterr_test.c
103

This test belongs in D58237. I seem to have botched a rebase.

Having just hit submit... I wonder if we want to spend the available bit in EXTERR_CAT_SRC_MASK on in-tree vs out of tree or maybe just make pre-pending sys/ a legacy category source thing.

This adds two syscalls to each dynamic syscall failure path. I understand that calling the sysctl is the easiest way to handle dynamically loaded modules. But I already got some negative comments due to exterrors adding some nanoseconds to the failing syscalls timings.
Although I do not object in principle, can we have some smarter way to avoid the sysctl if we already queried the specific module? E.g. we can make each module to register 'range' for dynamic errors' pathes, and memoize the range with the values in libc.
This is esp. sorrow because the display of the source line is really a niche feature.