*BSD News Article 98029


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.carno.net.au!harbinger.cc.monash.edu.au!munnari.OZ.AU!spool.mu.edu!uwm.edu!vixen.cso.uiuc.edu!howland.erols.net!feed1.news.erols.com!news.nl.innet.net!INnl.net!feed1.news.innet.be!INbe.net!blue.news.pipex.net!pipex!stns.news.pipex.net!warm.news.pipex.net!pipex!tank.news.pipex.net!pipex!news.utell.co.uk!usenet
From: brian@shift.utell.net (Brian Somers)
Newsgroups: comp.unix.bsd.freebsd.misc
Subject: Re: kernel traces
Date: 19 Jun 1997 11:01:53 GMT
Organization: Awfulhak Ltd.
Lines: 24
Message-ID: <5ob3j1$2ro@ui-gate.utell.co.uk>
References: <5o9e5r$1ar@delphi.cs.ucla.edu>
Reply-To: brian@awfulhak.org, brian@utell.co.uk
NNTP-Posting-Host: shift.utell.net
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
X-Newsreader: knews 0.9.8
Xref: euryale.cc.adfa.oz.au comp.unix.bsd.freebsd.misc:43149

In article <5o9e5r$1ar@delphi.cs.ucla.edu>,
	Renaud Bruyeron <bruyeron@cs.ucla.edu> writes:
> I am working on TCP, and I need to plot some state variables from the TCP code on FreeBSD 2.1.6. Those variables are not available through netstat, therefore I try to 'print' these variables, since I was told printf defaults to /var/log/message within the kernel.
> Even though I don't like the idea to use printf within this kind of code, I tried to, but was enable to find the result of the output anywhere:
> 
> if( (tp->t_inpcb->inp_socket->so_options & SO_DEBUG)  )
>   printf(";TCP_VARS: cwnd=%d",tp->snd_cwnd);
> 
> I inserted this piece of code at some intereting points in tcp_input.c, and I tried to enable SO_DEBUG with a setsockopt() call, but it does not work.
> 
> Is there any kernel guru out there who could help me ? Is printf the normal way to go for this purpose (what about klog and log ?)
> 
> 
> Thanks for your help,

I use printf() - stuff comes out on the console.  I've never needed to
find out how this is driven, but I suspect it routes through klog().

>  - Renaud

-- 
Brian <brian@awfulhak.org> <brian@freebsd.org>
      <http://www.awfulhak.org>
Don't _EVER_ lose your sense of humour !