Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 21 May 2000 00:29:53 -0700
From:      Arun Sharma <adsharma@sharmas.dhs.org>
To:        FreeBSD Hackers <freebsd-hackers@freebsd.org>
Subject:   truss -f, updated patch
Message-ID:  <20000521002953.A5031@sharmas.dhs.org>

next in thread | raw e-mail | index | archive | help
Before I go to sleep, I've shortened the diff by about 50%. The new diff
is at:

http://sharmas.dhs.org/~adsharma/projects/freebsd/truss-diff.gz
http://sharmas.dhs.org/~adsharma/projects/freebsd/truss.tar.gz

To be applied as:

cd truss
gzcat -dc truss-diff.gz | patch -p1

The real 100 lines of changes are:

1. Line 306 in i386-fbsd.c (where all the action starts)
2. Last few lines of main
3. Some changes in syscalls.c:print_syscall

It now prints syscalls one per line, like linux and solaris equivalents.
The Makefile changes can be completely ignored. They are there so that
truss can be compiled in a directory other than /usr/src.

        -Arun

$ truss -f -o foo sh -c ls 
$ cat foo
62898: getpid()	= 62898 (0xf5b2)
62898: geteuid()	= 500 (0x1f4)
62898: readlink("/etc/malloc.conf",0xbfbff79c,63)	= errno 2 'No such file or directory'
62898: mmap(0x0,4096,0x3,0x1002,-1,0x0)	= 671793152 (0x280ac000)
62898: break(0x80bd000)	= 0 (0x0)
62898: break(0x80be000)	= 0 (0x0)
62898: getuid()	= 500 (0x1f4)
62898: geteuid()	= 500 (0x1f4)
62898: getgid()	= 100 (0x64)
62898: getegid()	= 100 (0x64)
62898: sigaction(SIGINT,0x0,0xbfbff7c4)	= 0 (0x0)
62898: sigaction(SIGINT,0xbfbff7c4,0xbfbff7ac)	= 0 (0x0)
62898: sigaction(SIGINT,0x0,0xbfbff7c4)	= 0 (0x0)
62898: sigaction(SIGINT,0xbfbff7c4,0x0)	= 0 (0x0)
62898: sigaction(SIGQUIT,0x0,0xbfbff7b4)	= 0 (0x0)
62898: sigaction(SIGQUIT,0xbfbff7b4,0xbfbff79c)	= 0 (0x0)
62898: sigaction(SIGQUIT,0x0,0xbfbff7b4)	= 0 (0x0)
62898: sigaction(SIGQUIT,0xbfbff7b4,0x0)	= 0 (0x0)
62898: sigaction(SIGTERM,0x0,0xbfbff7c4)	= 0 (0x0)
62898: sigaction(SIGTERM,0xbfbff7c4,0xbfbff7ac)	= 0 (0x0)
62898: sigaction(SIGSYS,0xbfbff634,0xbfbff61c)	= 0 (0x0)
62898: __getcwd(0xbfbff79c,0x100)	= 0 (0x0)
62898: sigaction(SIGSYS,0xbfbff61c,0x0)	= 0 (0x0)
62898: break(0x80bf000)	= 0 (0x0)
62898: stat("/home/adsharma/kde/bin/ls",0xbfbff6fc)	= errno 2 'No such file or directory'
62898: stat("/home/adsharma/bin/ls",0xbfbff6fc)	= errno 2 'No such file or directory'
62898: stat("/home/adsharma/kde/bin/ls",0xbfbff6fc)	= errno 2 'No such file or directory'
62898: stat("/bin/ls",0xbfbff6fc)	= 0 (0x0)
62898: break(0x80c0000)	= 0 (0x0)
62898: fork()	= 62899 (0xf5b3)
62898: getpgrp()	= 62897 (0xf5b1)
62899: ... Returning from fork ?()	= 0 (0x0)
62899: open(".",0,00)	= 5 (0x5)
62899: stat(".",0xbfbff798)	= 0 (0x0)
62899: open(".",4,00)	= 6 (0x6)
62899: fstat(6,0xbfbff798)	= 0 (0x0)
62899: fcntl(0x6,0x2,0x1)	= 0 (0x0)
62899: __sysctl(0xbfbff650,0x2,0x807ad98,0xbfbff64c,0x0,0x0)	= 0 (0x0)
62899: fstatfs(0x6,0xbfbff698)	= 0 (0x0)
62899: break(0x8083000)	= 0 (0x0)
62899: getdirentries(0x6,0x8082000,0x1000,0x807e0b4)	= 3072 (0xc00)
62899: break(0x8084000)	= 0 (0x0)
62899: break(0x8085000)	= 0 (0x0)
62899: break(0x8086000)	= 0 (0x0)
62899: break(0x8087000)	= 0 (0x0)
62899: getdirentries(0x6,0x8082000,0x1000,0x807e0b4)	= 0 (0x0)
62899: lseek(6,0x0,0)	= 0 (0x0)
62899: close(6)	= 0 (0x0)
62899: fchdir(0x5)	= 0 (0x0)
62899: close(5)	= 0 (0x0)
62899: break(0x8088000)	= 0 (0x0)
62899: fstat(1,0xbfbff3b8)	= 0 (0x0)
62899: ioctl(1,TIOCGETA,0xbfbff3ec)	= 0 (0x0)
62899: write(1,0x8082400,31)	= 31 (0x1f)
62899: write(1,0x8082400,23)	= 23 (0x17)
62899: write(1,0x8082400,32)	= 32 (0x20)
62899: write(1,0x8082400,33)	= 33 (0x21)
62899: write(1,0x8082400,19)	= 19 (0x13)
62899: write(1,0x8082400,29)	= 29 (0x1d)
62899: write(1,0x8082400,20)	= 20 (0x14)
62899: write(1,0x8082400,28)	= 28 (0x1c)
62899: write(1,0x8082400,20)	= 20 (0x14)
62899: write(1,0x8082400,25)	= 25 (0x19)
62899: write(1,0x8082400,21)	= 21 (0x15)
62899: write(1,0x8082400,22)	= 22 (0x16)
62899: write(1,0x8082400,21)	= 21 (0x15)
62899: write(1,0x8082400,29)	= 29 (0x1d)
62899: write(1,0x8082400,27)	= 27 (0x1b)
62899: write(1,0x8082400,26)	= 26 (0x1a)
62899: write(1,0x8082400,25)	= 25 (0x19)
62899: write(1,0x8082400,24)	= 24 (0x18)
62899: write(1,0x8082400,30)	= 30 (0x1e)
62899: write(1,0x8082400,24)	= 24 (0x18)
62899: exit(0x0)	 = 0(8048e82)
SIGNAL 20
62898: wait4(0xffffffff,0xbfbff728,0x2,0x0)	= 62899 (0xf5b3)
62898: exit(0x0)	 = 0(8048e82)


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?20000521002953.A5031>