nhorman / dropwatch

user space utility to interface to kernel dropwatch facility
GNU General Public License v2.0
633 stars 92 forks source link

Meaningless error message? #36

Closed holmanb closed 3 years ago

holmanb commented 3 years ago

Perhaps this is a non-issue (if so, sorry for the noise), but I wanted to point out that if attempting to look up kernel symbols as a non-privileged user, error messages (which are arguably useless) are interleaved with the output. It looks like we could just add a check to see if errno is non-zero before doing that which would lead to cleaner output. I'll submit a pull request in case that approach is acceptable.

[bholman@coffee src]$ ./dropwatch -l kas
Initializing kallsyms db
dropwatch> start
Enabling monitoring...
Kernel monitoring activated.
Issue Ctrl-C to stop monitoring
Error Scanning File: : Success
2 drops at location 0xffffffff96a76d79 [software]
nhorman commented 3 years ago

Yeah, I think thats a bug in how I'm handling feof/ferror there. Try this: https://github.com/nhorman/dropwatch/tree/issue36 if you would please, and I'll commit it if the problem is rectified for you.

Thanks!

holmanb commented 3 years ago

Thanks for the quick reply! I just tested your changes @nhorman. That works for me and is cleaner than my errno approach. I'll close my pull request.

nhorman commented 3 years ago

copy that, thank you for the quick turn around, I'll merge my change asap

nhorman commented 3 years ago

fixed in https://github.com/nhorman/dropwatch/pull/38