::msgbuf could see more than 8KB of logs
::msgbuf dcmd in MDB can be very useful for debugging the state of a machine leading up to a crash dump. The messages it reads are stored in a STREAMS data queue,
log_recentq, with a high water mark of
LOG_RECENTSIZE -- presently 8KB.
At this stage, the budget for memory here probably extends to at least, say, 64KB. This would provide eight times more kernel log context in a crash dump.
Updated by Joshua M. Clulow over 1 year ago
Might be worth confirming that roughly the expected number of bytes come out, as well as just that it still works; e.g., via, say:
odin # mdb -k Loading modules: [ unix genunix ... ] > ::msgbuf ! wc -c 7947
(NB: this system has been up for months, and has thus generated a bunch of log messages already. You might need to induce some to be generated for testing!)
Updated by Nick Ewins 9 months ago
- Status changed from New to In Progress
The correct number of bytes are reported. Thanks to Joshua's help using this dtrace script and also able to confirm using mdb.
# echo "::msgbuf ! wc -c" | mdb -k 67225
dtrace example below
# ./qtrace.d cnt 89337 hiw 65536 (136%) FULL cnt 89337 hiw 65536 (136%) FULL cnt 89337 hiw 65536 (136%) FULL cnt 89337 hiw 65536 (136%) FULL cnt 89337 hiw 65536 (136%) FULL
Updated by Electric Monk 9 months ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
commit 64b8fdd9a26cb9749e154c721f0688932b5e0094 Author: Nick Ewins <firstname.lastname@example.org> Date: 2021-04-19T20:22:44.000Z 13178 ::msgbuf could see more than 8KB of logs Reviewed by: Andy Fiddaman <Andy@omniosce.org> Reviewed by: Toomas Soome <email@example.com> Approved by: Dan McDonald <firstname.lastname@example.org>