home *** CD-ROM | disk | FTP | other *** search
- Xref: sparky comp.unix.programmer:4287 comp.unix.internals:1687
- Newsgroups: comp.unix.programmer,comp.unix.internals
- Path: sparky!uunet!paladin.american.edu!darwin.sura.net!zaphod.mps.ohio-state.edu!pacific.mps.ohio-state.edu!linac!att!pacbell.com!decwrl!pa.dec.com!jrdzzz.jrd.dec.com!jrd.dec.com!doi
- From: doi@jrd.dec.com (Hitoshi Doi)
- Subject: Re: debugging streams
- Message-ID: <Bsy1An.HuM@jrd.dec.com>
- Sender: usenet@jrd.dec.com (USENET News System)
- Nntp-Posting-Host: usagi.jrd.dec.com
- Organization: DEC Japan Research and Development Center
- References: <35489@arctic.nprdc.navy.mil>
- Date: Thu, 13 Aug 1992 22:32:47 GMT
- Lines: 59
-
- In article <35489@arctic.nprdc.navy.mil>, stanonik@nprdc.navy.mil (Ron Stanonik) writes:
- # We're trying to track down a problem with a serial port.
-
- [..stuff deleted here and there..]
-
- # We'd like to "see" what's being passed between ldterm and fxm.
- # ldterm and fxm don't seem to be strlog'ing anything; ie, neither
- # strace nor sterr produce any output. Is there anything we can push
- # between ldterm and fxm to "see" what's being passed?
-
- It is very easy to write a filter module that you can push anywhere
- that will strlog (or printf) the messages that are going around.
- Something like the following. Please add details to suit your needs.
-
- mfilter_open(..) { return 0; }
- mfilter_close(..) { return 0; }
- mfilter_rput(queue_t *q, mblk_t *mp)
- {
- struct iocblk *iocp;
- switch (mp->b_datap->db_type) {
- case M_DATA:
- strlog(MID, SID, 0, 1, SL_ERROR, "READ: M_DATA: %d chars",
- mp->b_wptr - mp->b_rptr);
- break;
- case M_IOCNAK:
- iocp = (struct iocblk *)mp->b_rptr;
- strlog(MID, SID, 0, 1, SL_ERROR, "READ: M_IOCNAK: %x", iocp->ioc_cmd);
- break;
- case M_IOCACK:
- iocp = (struct iocblk *)mp->b_rptr;
- strlog(MID, SID, 0, 1, SL_ERROR, "READ: M_IOCACK: %x", iocp->ioc_cmd);
- break;
- ....
- }
- putnext(q, mp);
- return 0;
- }
- mfilter_wput(queue_t *q, mblk_t *mp)
- {
- struct iocblk *iocp;
- switch (mp->b_datap->db_type) {
- case M_DATA:
- strlog(MID, SID, 0, 1, SL_ERROR, "WRITE: M_DATA: %d chars",
- mp->b_wptr - mp->b_rptr);
- break;
- case M_IOCTL:
- iocp = (struct iocblk *)mp->b_rptr;
- strlog(MID, SID, 0, 1, SL_ERROR, "WRITE: M_IOCTL: %x", iocp->ioc_cmd);
- break;
- ....
- }
- putnext(q, mp);
- return 0;
- }
-
- --
- Hitoshi Doi, International Open Systems Engineering doi@jrd.dec.com
- Japan Research and Development Center decwrl!jrd.dec.com!doi
- Digital Equipment Corporation Japan [from Japan: doi@dec-j.co.jp]
-