Introducing smblog-mode for emacs

Ralph Boehme rb at sernet.de
Mon Mar 14 13:46:33 UTC 2016


On Mon, Mar 14, 2016 at 11:33:52AM +0100, Aurélien Aptel wrote:
> On Mon, 14 Mar 2016 10:03:07 +0100 Ralph Boehme <rb at sernet.de> wrote:
> > Feature request time: another thing that would be very helpful would
> > be smbd log grouping at SMB packet requests/responses boundaries, at
> > least for SMB2. Combined with the possibilty to collapse/expand the
> > log part of a SMB request/respone with TAB. :)
> 
> I've just added the TAB expand/collapse thing. Could you describe more
> precisely what the grouping feature is (with an example maybe?).

in a level 10 smbd log SMB2 requests begin with the lines:

[2016/03/14 14:34:17.196314, 10, pid=26844, effective(1000, 1000), real(1000, 0)] ../source3/smbd/smb2_server.c:3686(smbd_smb2_io_handler)
  smbd_smb2_request idx[1] of 5 vectors
[2016/03/14 14:34:17.196350, 10, pid=26844, effective(1000, 1000), real(1000, 0)] ../source3/smbd/smb2_server.c:656(smb2_validate_sequence_number)
  smb2_validate_sequence_number: clearing id 290 (position 290) from bitmap
[2016/03/14 14:34:17.196361, 10, pid=26844, effective(1000, 1000), real(1000, 0)] ../source3/smbd/smb2_server.c:2139(smbd_smb2_request_dispatch)
  smbd_smb2_request_dispatch: opcode[SMB2_OP_CREATE] mid = 290

The SMB2 request opcode is in the last line, SMB2_OP_CREATE in this
case.

The last lines of a SMB2 request processing will always be:

[2016/03/14 14:34:17.194698, 10, pid=26844, effective(1000, 1000), real(1000, 0)] ../source3/smbd/smb2_server.c:2826(smbd_smb2_request_done_ex)
  smbd_smb2_request_done_ex: idx[1] status[NT_STATUS_OK] body[60] dyn[no:0] at ../source3/smbd/smb2_close.c:144
[2016/03/14 14:34:17.194707, 10, pid=26844, effective(1000, 1000), real(1000, 0)] ../source3/smbd/smb2_server.c:908(smb2_set_operation_credit)
  smb2_set_operation_credit: requested 256, charge 1, granted 1, current possible/max 1/512, total granted/max/low/range 512/8192/290/512

This contains the returned status code.

It would be awesome if emacs could display this collapsed as

SMB2 request: SMB2_OP_CREATE, response: NT_STATUS_OK
SMB2 request: ...           , response: ...

Then when selecting a line and pressing TAB it would expand and show
all log lines for that request.

Don't know if that's possible, but if you would implement that, I'll
owe you a bar at SambaXP. :)

-Ralph

-- 
SerNet GmbH, Bahnhofsallee 1b, 37081 Göttingen
phone: +49-551-370000-0, fax: +49-551-370000-9
AG Göttingen, HRB 2816, GF: Dr. Johannes Loxen
http://www.sernet.de,mailto:kontakt@sernet.de



More information about the samba-technical mailing list