From owner-freebsd-current Sun Jun 16 17:38:12 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id RAA01569 for current-outgoing; Sun, 16 Jun 1996 17:38:12 -0700 (PDT) Received: from jraynard.demon.co.uk (jraynard.demon.co.uk [158.152.42.77]) by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id RAA01558 for ; Sun, 16 Jun 1996 17:38:02 -0700 (PDT) Received: (from fcurrent@localhost) by jraynard.demon.co.uk (8.7.5/8.6.12) id AAA10445; Mon, 17 Jun 1996 00:30:38 GMT Date: Mon, 17 Jun 1996 00:30:38 GMT Message-Id: <199606170030.AAA10445@jraynard.demon.co.uk> From: James Raynard To: bde@zeta.org.au CC: freebsd-current@freebsd.org, j@uriah.heep.sax.de, nate@sri.MT.net In-reply-to: <199606160211.MAA00203@godzilla.zeta.org.au> (message from Bruce Evans on Sun, 16 Jun 1996 12:11:38 +1000) Subject: Re: ktrace [Was: 2.2-960612-SNAP resolver problems] Sender: owner-current@freebsd.org X-Loop: FreeBSD.org Precedence: bulk >>>>> Bruce Evans writes: > > >> > Does anybody seriously object against putting it into GENERIC? > >> > >> Yes. It's un-necessary bloat that 95% of the users don't know how to > >> use and the other 5% know how to add it. > > >That's not true. It's relatively easy to teach people about running > >their program with a prepended `ktrace'. It's much harder to demand > >from them to first recompile a new kernel. (And i can't answer their > >questions then why it's not in the default kernel. :) Many other > >systems around ship with it enabled and ready to run by default, > >including all SysV's (truss) and Linux (strace). > > Strace seems to be more in the library. Its output is much better. Indeed. Apart from volume of output, is there any particular reason why ktrace writes to a file which kdump reads in, as opposed to using a pipe? Particularly as the first thing kdump does is freopen(tracefile, "r", stdin)! The error message is not particularly informative, either:- ktrace -f foobar ls ktrace: Ù¿ïÙ¿ï"Ù¿ï)Ù¿ï: Function not implemented. but this at least can easily be fixed:- --- ktrace.c.orig Sun Jun 16 23:59:12 1996 +++ ktrace.c Sun Jun 16 23:59:58 1996 @@ -174,7 +174,10 @@ error(name) char *name; { - (void)fprintf(stderr, "ktrace: %s: %s.\n", name, strerror(errno)); + if (errno == ENOSYS) + noktrace(); + else + (void)fprintf(stderr, "ktrace: %s: %s.\n", name, strerror(errno)); exit(1); } Not to mention the mkioctls horrors which were discussed recently... -- James Raynard, Edinburgh, Scotland james@jraynard.demon.co.uk