From owner-freebsd-questions Thu Feb 24 7:46:24 2000 Delivered-To: freebsd-questions@freebsd.org Received: from enterweb.enterit.com (enterweb.enterit.com [209.45.199.22]) by hub.freebsd.org (Postfix) with ESMTP id E864237BBB2 for ; Thu, 24 Feb 2000 07:46:20 -0800 (PST) (envelope-from jconner@enterit.com) Received: from KWAN [209.45.199.38] by enterweb.enterit.com with ESMTP (SMTPD32-5.04) id A24F1210146; Thu, 24 Feb 2000 10:46:23 DT Message-Id: <4.2.0.58.20000224104248.00a84dc0@mail.enterit.com> X-Sender: notjames@mail.pseudonet.org X-Mailer: QUALCOMM Windows Eudora Pro Version 4.2.0.58 Date: Thu, 24 Feb 2000 10:53:57 -0500 To: Roman Shterenzon From: Jim C Subject: Re: truss Cc: freebsd-questions@FreeBSD.ORG In-Reply-To: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; format=flowed Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG I will take a stab at this: AFAIK there are a lot of programs that start children processes and the parent dies (or goes bg - not sure how to splain that one, lucy). Truss won't follow this and won't give you a good trace of the program being executed unless you tell it to follow the child processes. My best example of this is the Channel Services Bot for Othernet. If you edit $SOURCE_ROOT/bot.c there is some code: if (fork()) exit(0); load_cfg(); . . . To my knowledge this is forking (or executing) a child process. If you were to leave this piece of code here and compile the program, then truss it, you would only see the truss to this point of the execution and then truss would exit (exit(0)) (which needless to say this is toward the beginning of the execution of this program). So, in short, -f allows you to follow the fork. I know this isn't the greatest explanation. I am not a full blown programmer or anything. I tinker. But I hope this helps a little bit. Anyone interested in correcting me (I know there is some correction that needs to be made) please correct me. I need to learn as much as I can. At 17.09 24.02.00 +0200, you wrote: >I miss the -f functionality in freebsd truss.. > > -f Follow all children created by fork() or > vfork() and include their signals, faults, > and system calls in the trace output. Nor- > mally, only the first-level command or pro- > cess is traced. When -f is specified, the > process-id is included with each line of > trace output to indicate which process exe- > cuted the system call or received the signal. > > >--Roman Shterenzon, UNIX System Administrator and Consultant >[ Xpert UNIX Systems Ltd., Herzlia, Israel. Tel: +972-9-9522361 ] > > > >To Unsubscribe: send mail to majordomo@FreeBSD.org >with "unsubscribe freebsd-questions" in the body of the message To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message