Subject: kern/18807: ktruss cannot keep up with some processes
To: None <>
From: Christian Biere <>
List: netbsd-bugs
Date: 10/26/2002 09:04:15
>Number:         18807
>Category:       kern
>Synopsis:       ktruss cannot keep up with some processes
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat Oct 26 00:05:00 PDT 2002
>Originator:     Christian Biere
>Release:        NetBSD 1.6J
System: NetBSD localhost 1.6J NetBSD 1.6J (GENERIC) #1: Sat Oct 26
07:22:10 CEST 2002    
root@localhost:/usr/src/sys/arch/i386/compile/GENERIC i386 
Architecture: i386 
Machine: i386


ktruss fails with some processes which produce many system-calls very
frequently. I've encountered this when I wanted to ktruss
/usr/pkgsrc/emulators/generator but I've seen this with other programs
before (I just cannot remember a good example, maybe "find /"?). I have
changed ktrwrite() so that it doesn't give up after 3 failures with
EWOULDBLOCK. I'm not sure whether this is a clever idea but I haven't
experienced problems with this so far.


ktruss find /

(This might depend on cpu and io speed.)

Content-Type: text/plain;
Content-Disposition: attachment;
Content-Transfer-Encoding: 7bit

Index: kern_ktrace.c
RCS file: /cvsroot/syssrc/sys/kern/kern_ktrace.c,v
retrieving revision 1.59
diff -u -b -r1.59 kern_ktrace.c
--- kern_ktrace.c	2002/10/23 09:14:18	1.59
+++ kern_ktrace.c	2002/10/26 06:55:01
@@ -618,7 +618,7 @@
 		if (error == EWOULDBLOCK) 
-	} while ((error == EWOULDBLOCK) && (tries < 3));
+	} while ((error == EWOULDBLOCK)/* && (tries < 3)*/);
 	if (__predict_true(error == 0))

 This is a multi-part message in MIME format.
 Content-Type: text/plain; charset=US-ASCII
 Content-Transfer-Encoding: 7bit