Project

General

Profile

Actions

Feature #13178

closed

::msgbuf could see more than 8KB of logs

Added by Joshua M. Clulow 11 months ago. Updated 4 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
kernel
Start date:
Due date:
% Done:

100%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

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.

Actions #1

Updated by Nick Ewins 11 months ago

  • Assignee set to Nick Ewins
Actions #2

Updated by Nick Ewins 11 months ago

Tested by using ::msgbuf dcmd in MDB. Generated and read crash dumps, before and after the change.

Actions #3

Updated by Joshua M. Clulow 10 months 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!)

Actions #4

Updated by Electric Monk 4 months ago

  • Gerrit CR set to 1427
Actions #5

Updated by Nick Ewins 4 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
Actions #6

Updated by Electric Monk 4 months 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>

Actions

Also available in: Atom PDF