Make long ddb not suck

Julian Elischer julian at elischer.org
Thu Jul 31 11:26:36 PDT 2003



On Thu, 31 Jul 2003, John Baldwin wrote:

> 
> On 30-Jul-2003 Julian Elischer wrote:
> > 
> > 
> > On Wed, 30 Jul 2003, John Baldwin wrote:
> > 
> >> I have a patch that adds a simple paging facility to ddb at the
> >> db_printf() level using a one-shot callback mechanism.  It includes
> >> a simple paging callback that rearms itself based on the users
> >> input (space does another page, enter another line).  I've used this
> >> facility to replace the hand-rolled paging in 'ps', 'show pci', and
> >> 'show ktr'.  The patch is at http://www.FreeBSD.org/~jhb/patches/ddb.patch
> >> 
> >> Comments?
> >> 
> >> Also, I notice that we have a 'show threads' command commented out from
> >> the original Mach sources.  I think we should change 'ps' back to just
> >> showing simple process info (and hopefully back to 80 cols) and only
> >> print thread info for 'show threads'.  Maybe show threads should take a
> >> PID as the argument?
> > 
> > 
> > we do have "show thread (addr)"
> > that shows the stacktrace.
> > 
> > "show threads {pid}"
> >  would be good to identify the address
> > of the thread to examine..
> > 
> >> 
> >> Thus, one would have:
> >> 
> >> db> ps
> >> 1  blah blah sleeping on "foo"
> >> 2  blah blah threaded
> >> 
> >> db> show threads 2
> >> 0  blah blah sleeping on "bar"
> >> 1  blah blah running on cpuX
> >> 
> > 
> > currently ps shows the threads by default..
> > either way is ok I guess.
> 
> ps is hardly readable anymore because it is so cluttered now.  I would
> like ps to go back to something more like it was prior to KSE and
> then use a separate show threads when one needs info about threads
> within a process.

one thing it shows now is that there can be many "inhibitors set on a
thread/process at a time..
e.g. it can be:
suspended and sleeping and swapped out.

presently I enumerate them with [SWP][SLP][SUSP]

but having a single field

      S S S L I
      L W U C W
      P P S K T wmesg
----------------------
bla   - - 1 - -
      1 1 1 - - iowait
      1 1 - - - sbwait
      - - - 1 - Giant
      - - - - 1 int2


or even, in a more compact form:
      SSSLI
      LWUCW
      PPSKT wmesg
----------------------
bla   --S--
      ZXS-- iowait
      ZX--- sbwait
      ---W- Giant
      ----I int2



These would take a fixed size
and would show the combinatorial possibilities..

> 
> -- 
> 
> John Baldwin <jhb at FreeBSD.org>  <><  http://www.FreeBSD.org/~jhb/
> "Power Users Use the Power to Serve!"  -  http://www.FreeBSD.org/
> 



More information about the freebsd-arch mailing list