Developers' Tips and Tools

Network Captures

Problem diagnosis (aside from core dumps) usually starts with a network capture.  Solaris provides the program snoop(1M) that can be used to capture SMB traffic as follows:

        snoop -o mycapture1.snoop host myserver

This assumes you're running snoop on the CIFS client, and "myserver" is the name of your CIFS server.

The most convenient tool for analyzing such capture files is Wireshark. There is an effort underway to add Wireshark to OpenSolaris, but until that's completed, you'll have to get it from blastwave.

Debug Messages

There are lots of debug messages in the CIFS client code, and you can see them only by attaching DTrace probes to some internal functions that exist only for this purpose.

Here is a very simple DTrace script to let you see debug messages:

        #!/usr/sbin/dtrace -s
       / This shows internal debug messages. /
        sdt:nsmb::debugmsg2
        {
          printf("\n\t %s: %s", stringof(arg0), stringof(arg1));
        }
       / This shows internal error messages. /
        sdt:nsmb::debugmsg3
        {
          printf("\n\t %s: %s", stringof(arg0), stringof(arg1));
          tracemem(arg2, 16);
        }

This, and some other DTrace scripts may be downloaded from the Files area.

Digging in to the Code

The Internals presentation
is a good place to start. It describes the high-level design of the CIFS client modules, data structures, functions, and code organization. It also has some examples of how to use the mdb(1M) modules provided with the CIFS client kernel objects.

The sources may be found in the onnv-gate

Here are the locations of CIFS client components:

Testing the Code

Vilas Deshpande of the Solaris NAS Quality Engineering group has released the CIFS client test suite.

last modified by creiher on 2009/10/28 23:16
Collectives
Project


© Sun Microsystems Inc. 2009
XWiki Enterprise 1.8.2.19075 - Documentation
Terms Of Use | Privacy | Trademarks | Copyright Policy | Site Guidelines | Site map | Help
Your use of this web site or any of its content or software indicates your agreement to be bound by these Terms of Use.