libc/gen/err.c: remove 'extended error' herald from extended error output exterror: add support for the format specifiers in the extended error msg Note that we trust kernel code to only request the printout of integer types, and use the 'j' modifier always. exterror: Add EXTERROR_VERBOSE env variable to control verbosity If the variable is set and the process is not suid, __uexterr_format(), used by err(3), prints errno/category/source line/pX always, not only when there is no kernel message provided. vm/vm_mmap.c: inline erronous argument values for extended errors
Details
- Reviewers
mckusick emaste - Commits
- rG3088263177da: man pages: provide some description for extended errors
rG3ef25acf3600: Add a script to auto-generate mapping from exterr category to source file
rG874cdf6af695: exterr: in verbose mode, print the source file name
rG54b52f655e0f: fs/fuse: use dedicated category per source file
rG543c86636f73: exterr_test: loosen the error string pattern
rG14bd57d0a78d: exterror.9: describe formatting of optional arguments
rG42210fe8dcd4: exterror: Add EXTERROR_VERBOSE env variable to control verbosity
rG2904edaf2f09: vm/vm_mmap.c: inline erronous argument values for extended errors
rG37ddbbe5535c: libc/gen/err.c: remove 'extended error' herald from extended error output
rG8bff95f3ce03: exterror: add support for the format specifiers in the extended error msg
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Skipped - Unit
Tests Skipped
Event Timeline
Much more useful output to the user.
| lib/libc/gen/uexterr_format.c | ||
|---|---|---|
| 69–70 | I should be able to request getting this information if I want to see it. I suggest a new err.3 function like setverbose(level) where level 0 is default but with level 1 also includes this information. Without an environment variable, I still have to add an option to call this function but at least it is easily possible and a documented way to do it. | |
| share/man/man9/exterror.9 | ||
| 99–103 | suggest wording as: | |
| lib/libc/gen/uexterr_format.c | ||
|---|---|---|
| 69–70 | Ok, I just added EXTERROR_VERBOSE env variable support for !setugid processes. | |
| tools/build/make_libc_exterr_cat_filenames.sh | ||
|---|---|---|
| 14 | To avoid phab falsely detecting this script as a generated file can use something like: atsymbol=@
echo " * Automatically ${atsymbol}generated, use" >>"${target}"or e.g. printf " * Automatically %sgenerated, use\n" @ | |
Providing the file names is a great improvement. I like the way you have automated their generation.
The EXTERROR_VERBOSE environment variable needs to be documented in environment.7 and err.3 and perhaps in exterror.9.
| lib/libc/gen/uexterr_format.c | ||
|---|---|---|
| 84 | I suggest making the pathname complete by adding sys/, i.e. (src sys/%s:%u) | |
| sys/sys/exterr_cat.h | ||
| 17 | extra / between build and make in pathname | |
Remove extra slash in comment.
Add some documentation to err.3 and environment.7.
| lib/libc/gen/uexterr_format.c | ||
|---|---|---|
| 84 | I specifically removed the sys/ from the path, since I do not see it useful: we already know that the reported path is from the kernel. If you insist, I will remove the sub() call from the script' awk invocation. But IMO it would only consume the screen space in the already cluttered line. | |
Coming down the home stretch. Just three more comments.
| lib/libc/gen/err.3 | ||
|---|---|---|
| 116–117 ↗ | (On Diff #168666) | If the kernel returned an extended error string in addition to the |
| 127–128 ↗ | (On Diff #168666) | environment variable is present, an additional report is printed. |
| lib/libc/gen/uexterr_format.c | ||
| 84 | People like you and me know that these are subdirectories of sys, but someone less knowledgeable about the kernel see something like net/if_bridge.c and have no idea where to look for that file. If it says sys/net/if_bridge.c then it is much more obvious where to find the file. I recommend leaving the sub() call in the script. There is no need to have a huge number of "sys/" strings in exterr_cat_filenames.h wasting memory. Just add the sys/ in the snprintf above | |