Feature #13178
closed::msgbuf could see more than 8KB of logs
100%
Description
The ::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 Nick Ewins over 2 years ago
Tested by using ::msgbuf dcmd in MDB. Generated and read crash dumps, before and after the change.
Updated by Joshua M. Clulow over 2 years 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 almost 2 years 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 almost 2 years ago
- Status changed from In Progress to Closed
- % Done changed from 0 to 100
git commit 64b8fdd9a26cb9749e154c721f0688932b5e0094
commit 64b8fdd9a26cb9749e154c721f0688932b5e0094 Author: Nick Ewins <nick@krypton.computer> 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 <tsoome@me.com> Approved by: Dan McDonald <danmcd@joyent.com>