Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 20 Oct 2001 11:24:51 -0700 (PDT)
From:      Arun Sharma <arun@sharma-home.net>
To:        des@ofug.org
Cc:        hackers@freebsd.org
Subject:   Re: truss vs ktrace
Message-ID:  <20011020182451.EC4E95E594@sharmas.dhs.org>
In-Reply-To: <xzpofn7vxbg.fsf@flood.ping.uio.no>
References:  <3BCCCF74.75B7F36C@disney.com> <xzpofn7vxbg.fsf@flood.ping.uio.no>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, 17 Oct 2001 02:02:07 +0000 (UTC), Dag-Erling Smorgrav <des@ofug.org> wrote:
> Jim Pirzyk <Jim.Pirzyk@disney.com> writes:
> > So which should I use? Why is there two around?  I see that truss has
> > less command line switches than ktrace, but it is a little bit more
> > standard.
> 
>  - truss slows down the slave process a *lot* as the slave process
>    stops at every syscall and waits for truss to notice, obtain and
>    process information (a task which in itself requires a bunch of
>    additional context switches and syscalls) and print its output.
>    This also means that if you pipe truss through less and don't page
>    down fast enough, the slave process will hang waiting for truss
>    which is waitig for less to absorb its output.

True, the choice depends on which one meets your debugging needs better.
I find the performance of truss usually adequate for my purposes.

> 
>  - truss currently can't follow forks and trace children of the
>    original process.  This should be fixable, though.
> 

This has been taken care of:

http://www.sharma-home.net/~adsharma/projects/freebsd/truss.diff.gz
http://www.sharma-home.net/~adsharma/projects/freebsd/truss.tar.gz

The above patch supports fork as well as rfork, so can be used with
libraries using rfork for pthread implementations.

Another advantage of truss is that the output is "online" and interactive. 
ktrace requires you to use kdump to view the trace.

	-Arun

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20011020182451.EC4E95E594>