From owner-freebsd-questions Tue Nov 9 8:11:55 1999 Delivered-To: freebsd-questions@freebsd.org Received: from math.uic.edu (galois.math.uic.edu [131.193.178.114]) by hub.freebsd.org (Postfix) with SMTP id CC6B814EF4 for ; Tue, 9 Nov 1999 08:11:48 -0800 (PST) (envelope-from vladimir@math.uic.edu) Received: (qmail 2529 invoked by uid 31415); 9 Nov 1999 16:11:48 -0000 Date: 9 Nov 1999 16:11:48 -0000 Message-ID: <19991109161148.2528.qmail@math.uic.edu> From: vladimir@math.uic.edu To: freebsd-questions@FreeBSD.ORG, grog@lemis.com, vladimir-freebsd-questions@math.uic.edu Subject: Re: ktrace'ing a running process Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG >From grog@mojave.sitaranetworks.com Tue Nov 09 16:00:15 1999 >Delivered-To: vladimir-freebsd-questions@math.uic.edu >Date: Tue, 9 Nov 1999 10:59:34 -0500 >From: Greg Lehey >To: vladimir-freebsd-questions@math.uic.edu, freebsd-questions@FreeBSD.ORG >Subject: Re: ktrace'ing a running process >Mime-Version: 1.0 > >On Tuesday, 9 November 1999 at 15:53:00 -0000, vladimir-freebsd-questions@math.uic.edu wrote: >> I ran into a problem: ktrace -p PID produces >> a 0 length file ktrace.out, and ktrace exits >> immediately. The system is FBSD-3.3-STABLE. >> What am I doing wrong? > >Not much. You're probably just assuming that it's a bug for ktrace to >exit immediately, and in fact it's a feature. To stop the trace, >enter 'ktrace -p PID -C'. > >The real question is: why is your process not producing any ktrace >output? It may not be running, or it may be looping in user space. >Remember that ktrace shows only the transitions between user and >kernel space. If you don't have any such transitions, you won't get >any output. > >What does 'ps lp PID' say? > >Greg Ah, you are right. I wrote a c program that does stat on a file in a loop; this one produced the output. I assumed ktrace should just wait until it detects interaction with the kernel, but it looks like it just exits. Thanks! Vladimir To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message