From owner-freebsd-hackers Wed Dec 21 06:30:04 1994 Return-Path: hackers-owner Received: (from root@localhost) by freefall.cdrom.com (8.6.9/8.6.6) id GAA23248 for hackers-outgoing; Wed, 21 Dec 1994 06:30:04 -0800 Received: from csc.canberra.edu.au (csc.canberra.edu.au [137.92.1.1]) by freefall.cdrom.com (8.6.9/8.6.6) with SMTP id OAA23222 for ; Wed, 21 Dec 1994 14:29:53 GMT Received: from student.canberra.edu.au by csc.canberra.edu.au (5.65/1.35) id AA15212; Thu, 22 Dec 94 01:29:20 +1100 Received: by student.canberra.edu.au (5.0/SMI-SVR4) id AA25127; Thu, 22 Dec 94 01:29:03 EDT Date: Thu, 22 Dec 1994 01:29:02 +1100 (EDT) From: "Gasparovski / Daniel (ISE)" X-Sender: u923168@student To: freebsd-hackers@freebsd.org Subject: ktrace Message-Id: Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Content-Length: 1219 Sender: hackers-owner@freebsd.org Precedence: bulk Hi all. I have a problem: ktrace sucks :) When trying to debug apps (well, not really "debug", just figure out why they don't work) ktrace doesn't give enough info. For example, I want to know why XYZ doesn't want to connect to a host. ktrace gives me: ... 1764 xyz CALL connect(0x4,0xefbfd8fc,0x10) 1764 xyz RET connect -1 errno 61 Connection refused ... This tells me nothing that the error printed on the screen couldn't. Which address/port did it try to connect to? So, now I have to edit the sources and put a few printf's in, or whip out gdb etc. Sometimes, even these aren't an option. I'd like to see ktrace act little more like "strace", which is available on Sun's and Linux I beleive. strace in this case would have shown: ... connect(4, AF_INET(20480, 127.0.0.1), 16) = -1 (Connection refused) ... aha! It should be trying to connect to port 80, but this suggests a missing ntohs. Also, this has a nice "C code" feel to it, which although neat, isn't THAT important. So a few questions: 1) is there any reason that ktrace can't do this? (other than lack of time to implement) 2) Is there any reason strace can't be ported to FreeBSD? (ditto) Thanks. Dan ...