aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/truss
Commit message (Collapse)AuthorAgeFilesLines
* Revert CLEANDEPFILES commit per ru@'s request; it does not really solveDag-Erling Smørgrav2008-02-051-2/+1
| | | | | | | the problem. The correct fix will follow. Notes: svn path=/head/; revision=175980
* Normally, when a header file is removed from the build (as i4b headersDag-Erling Smørgrav2008-02-031-2/+3
| | | | | | | | | | | | | | | | | | | | | | | were recently), a simple 'make cleandepend; make depend' is sufficient to keep the tree buildable after a cvs update when doing incremental builds. However, kdump and truss use a script which searches for header files that define ioctls, and generates C code that includes them. This script will usually not need updating when a header file is removed, so the normal dependency mechanism will not realize that it needs to be re-run. One is therefore left with code that references dead files but will only be removed by a full 'make clean', which defeats the purpose of incremental builds. To work around this, modify the cleandepend target in bsd.dep.mk to also remove any files listed in a new variable named CLEANDEPFILES, and modify kdump's and truss's Makefiles accordingly. MFC after: 2 weeks Notes: svn path=/head/; revision=175937
* The break() system call takes a pointer argument, not an integer. ThisJason Evans2008-01-031-1/+1
| | | | | | | change fixes output for break() on LP64 systems. Notes: svn path=/head/; revision=175062
* Print integer-typed arguments as integers. This makes sure thatMarcel Moolenaar2007-07-281-3/+3
| | | | | | | | | | on 64-bit platforms the result is more reliable. For example, -1 was previously printed as 0xffffffff. Approved by: re (kensmith) Notes: svn path=/head/; revision=171647
* Fix handling of Quad-type arguments. Previously, syscallsMarcel Moolenaar2007-07-284-12/+23
| | | | | | | | | | | | | | | | | | | | containing 64-bit arguments would have explicit padding. On 64-bit platforms there was no padding, so the dummy argument was not covering anything. On 32-bit platforms with weak alignment (i.e. i386) the 64-bit argument did not need to be aligned, so there too an aditional argument was introduced. On 32-bit platforms with strong alignment (i.e. PowerPC) the dummy argument in fact cover the padding. By elimininating the dummy argument, 64-bit platforms now have 1 argument less. This also applies to 32-bit platforms with weak alignment. On PowerPC this doesn't matter, because the padding is still there. We just don't "name" it. Deal with those 3 cases. Approved by: re (kensmith) Notes: svn path=/head/; revision=171646
* Syscalls have at most 6 argument, not 5. See mmap(2) for example.Marcel Moolenaar2007-07-281-1/+1
| | | | | | | | | | Previously the offset argument to mmap(2) would be bogus as we weren't reading it in. Approved by: re (kensmith) Notes: svn path=/head/; revision=171645
* MFp4: Bugfixes for truss(1):Xin LI2007-06-2610-91/+75
| | | | | | | | | | | | | | - Fix logic handling execve(). We will not be able to obtain information otherwise. - truss coredump [1]. - truss does not work against itself [2]. PR: bin/58970 [1], bin/45193 [2] Submitted by: Howard Su Approved by: re (kensmith) Notes: svn path=/head/; revision=171055
* Don't want a stray systrace_args.c in objdir.Ruslan Ermilov2007-05-222-2/+6
| | | | Notes: svn path=/head/; revision=169861
* Remove duplicate ' 2' manpage section number.Giorgos Keramidas2007-05-211-1/+1
| | | | | | | | Submitted by: Rui Paulo MFC after: 3 days Notes: svn path=/head/; revision=169845
* Make use of ptrace(2) instead of procfs in truss(1), eliminatingXin LI2007-04-1016-585/+452
| | | | | | | | | | | yet another need of an available /proc/ mount. Tested with: make universe Submitted by: howardsu Reviewed by: alfred Notes: svn path=/head/; revision=168569
* Add missing markup bits.Ruslan Ermilov2006-12-111-3/+2
| | | | Notes: svn path=/head/; revision=165100
* Markup fixes.Ruslan Ermilov2006-09-291-2/+2
| | | | Notes: svn path=/head/; revision=162792
* Remove alpha-specific stuff.Ruslan Ermilov2006-08-231-360/+0
| | | | Notes: svn path=/head/; revision=161547
* Make sure that the sc pointer gets initialized. No functional changeXin LI2006-07-262-2/+2
| | | | | | | should happen with this change. Notes: svn path=/head/; revision=160701
* - Fix warning when compiling with -DDEBUGPav Lucistnik2006-05-151-1/+1
| | | | | | | Approved by: alfred Notes: svn path=/head/; revision=158631
* - Add decoding of kse_release, kevent, sigprocmask, unmount, socket, getrusage,Pav Lucistnik2006-05-157-153/+578
| | | | | | | | | | | | | | | | | | | | | | rename, __getcwd, shutdown, getrlimit, setrlimit, _umtx_lock, _umtx_unlock, pathconf, truncate, ftruncate, kill - Decode more arguments of open, mprot, *stat, and fcntl. - Convert all constant-macro and bitfield decoding to lookup tables; much cleaner than previous code. - Print the timestamp of process exit and signal reception when -d or -D are in use - Try six times with 1/2 second delay to debug the child PR: bin/52190 (updated) Submitted by: Dan Nelson <dnelson@allantgroup.com> Approved by: alfred Notes: svn path=/head/; revision=158630
* - Fix crash when hitting unknown syscall. Copied from i386-fbsd.cPav Lucistnik2006-05-155-5/+10
| | | | | | | Approved by: alfred Notes: svn path=/head/; revision=158626
* Add powerpc support for truss.Peter Grehan2006-01-053-0/+358
| | | | | | | | Initial work by: Orlando Bassotto < orlando at break net > Modified by: grehan Notes: svn path=/head/; revision=154047
* Add a -s flag for the same functionality as strace. Introduce a NameBrian Somers2006-01-0213-54/+91
| | | | | | | | | | | | | | | | | | | type which is a String type that has no -s limitations applied to it. Change most Strings in the code to Names and add a few extra syscalls, namely munmap, read, rename and symlink. This was enough to facilitate following file descriptor allocations in the code more easily and getting a hint at what's being read/written from/to files. More syscalls should really be added. While here, fix an off-by-one bug in the buffer truncation code and add a fflush so that truss's output reflects the syscall that the program is stuck in. Sponsored by: Sophos/Activestate MFC after: 2 weeks Notes: svn path=/head/; revision=153963
* The kernel accepts sockaddrs with len set to zero for sockaddr_inAlfred Perlstein2005-10-151-9/+20
| | | | | | | types, so refactor the code here to grab them when length is zero. Notes: svn path=/head/; revision=151361
* Fix all the spelling mistakes I could find in the man pages for wordsGiorgos Keramidas2005-07-311-1/+1
| | | | | | | | | | | that have at least 3 characters. MFC after: 1 week Thanks to: Music band ``Chingon'' for keeping me company while searching for these. Notes: svn path=/head/; revision=148580
* Decode chroot(2) args.Alfred Perlstein2005-06-141-0/+2
| | | | | | | Approved by: re Notes: svn path=/head/; revision=147389
* decode utimes, lutimes, futimes, chflags, lchflags.Alfred Perlstein2005-05-261-0/+10
| | | | Notes: svn path=/head/; revision=146658
* decode mkdir args.Alfred Perlstein2005-05-261-0/+2
| | | | Notes: svn path=/head/; revision=146652
* When doing the initial open of the proc via procfs, complain if we areAlfred Perlstein2005-03-273-8/+14
| | | | | | | | | unable to open the /proc/pid/mem file. Otherwise doing a truss on a nonexistant pid makes us return success even though no such process exists. Notes: svn path=/head/; revision=144178
* I've been working on this somewhat so I'm moving theAlfred Perlstein2005-03-272-313/+329
| | | | | | | parts I'm touching to be as style(9) compliant as I can. Notes: svn path=/head/; revision=144177
* Change fix a bug where the length of data written by snprintf wasAlfred Perlstein2005-03-031-1/+1
| | | | | | | | | | being mishandled by using accumulation (into an uninitialized variable) instead of direct assignment. Reviewed by: scottl Notes: svn path=/head/; revision=143109
* For variables that are only checked with defined(), don't provideRuslan Ermilov2004-10-241-1/+1
| | | | | | | any fake value. Notes: svn path=/head/; revision=136910
* Improve markup and language.Dima Dorfman2004-09-071-1/+3
| | | | Notes: svn path=/head/; revision=134901
* Fix Quad handling on 64-bit architectures. On 64-bit machines, a QuadMarcel Moolenaar2004-09-051-22/+17
| | | | | | | | | | | | | | | also occupies a single slot. There's no need for any special handling of Quads. While here, remove the silly make_quad() function. We have the 2 longs on 32-bit machines already lined up in the argument array, so we can fetch the Quad with a simple cast. Before: lseek(1,0x123456789,0xd0d0d0d0d0d0d0d0) = 4886718345 (0x123456789) After: lseek(1,0x123456789,SEEK_SET) = 4886718345 (0x123456789) Notes: svn path=/head/; revision=134799
* Update doc dates.Alfred Perlstein2004-09-031-1/+1
| | | | | | | Pointed out by: ru Notes: svn path=/head/; revision=134718
* xref and give a hint as to what procctl can be used for.Alfred Perlstein2004-09-031-1/+7
| | | | Notes: svn path=/head/; revision=134714
* don't seg if the syscall is invalid for i386fbsd.Alfred Perlstein2004-08-083-2/+6
| | | | Notes: svn path=/head/; revision=133349
* Use the length modifier 'll' instead of 'q' to print long longs.Stefan Farfeleder2004-07-281-1/+1
| | | | Notes: svn path=/head/; revision=132799
* Support readlink(2) better. Readlink does not nul terminate theAlfred Perlstein2004-07-1710-20/+32
| | | | | | | | | | | result buffer, so we need to format it ourselves. The problem is that the length is stored as the return value from readlink, so we need to pass the return value from our syscall into print_arg. Motivated by: truss garbage on my screen from reading /etc/malloc.conf. Notes: svn path=/head/; revision=132308
* When reporting reciept of a signal, print the signal's name.Alfred Perlstein2004-07-173-7/+26
| | | | Notes: svn path=/head/; revision=132306
* Decode the "wence" arg to lseek and linux_lseek.Alfred Perlstein2004-07-102-2/+16
| | | | Notes: svn path=/head/; revision=131893
* Fix unterminated RCSID.Bruce M Simpson2004-06-131-1/+1
| | | | | | | Submitted by: Liam J. Foy Notes: svn path=/head/; revision=130421
* A first stab at truss support for amd64, basically cogged from i386.David Malone2004-06-123-0/+352
| | | | | | | It seems to work in my limited tests. Notes: svn path=/head/; revision=130394
* COMPAT_SUNOS is gone.Poul-Henning Kamp2004-06-111-5/+3
| | | | Notes: svn path=/head/; revision=130347
* Add support for decoding Timespec, Timeval, Itimerval, Pollfd,David Malone2004-03-232-3/+179
| | | | | | | | | | | | | | | | | | | | Fd_set and Sigaction structures. Use these for printing the arguments to sigaction(), nanosleep(), select(), poll(), gettimeofday(), clock_gettime(), recvfrom(), getitimer() and setitimer(). This is based on Dan's patch from the PR but I've hacked it for style and some other issues. While Dan has checked this patch, any goofs are probably my fault. (The PR also contains support for the dual return values of pipe(). These will follow once I've ported that support to platforms other than i386.) PR: 52190 Submitted by: Dan Nelson <dnelson@allantgroup.com> Notes: svn path=/head/; revision=127332
* Use pread to implement pread, rather than taking a detour throug stdio.David Malone2004-03-231-16/+2
| | | | | | | | PR: 52190 Submitted by: Dan Nelson <dnelson@allantgroup.com> Notes: svn path=/head/; revision=127331
* decode mprotect args while i'm here.Alfred Perlstein2004-03-231-0/+2
| | | | Notes: svn path=/head/; revision=127329
* decode fcntl and mmap arguments.Alfred Perlstein2004-03-233-2/+66
| | | | Notes: svn path=/head/; revision=127328
* Move declarations of Procfd to a header file.David Malone2004-01-079-8/+2
| | | | Notes: svn path=/head/; revision=124217
* Fix a printf format warning.David Malone2004-01-071-1/+1
| | | | Notes: svn path=/head/; revision=124216
* Fix signal behaviour.Martin Cracauer2003-12-281-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | In my last change I made sure that the signal as reported from a truss exit is the same as if truss wasn't between parent and trussed program. I was smart enough to not have it coredump on SIGQUIT but it didn't ocur to me SIGSEGV might cause a coredump, too :-) So get rid of SIGQUIT extra hack and limit coredumpsize to zero instead. Tested: still works, correct signal reported. No more codedumps from SIGSEGV in the trussed proces. This file compiles cleanly on AMD64 (sledge). PR: Submitted by: Reviewed by: Approved by: Obtained from: MFC after: Notes: svn path=/head/; revision=123916
* Do not ignore any possible errors that fseeko() may have. The factMarcel Moolenaar2003-11-131-22/+24
| | | | | | | | | | | | | | | | | | | | | | | | is that fseeko() fails in very predictable and frequent ways on ia64. This is because the offset is actually an address in the process' address space, which on ia64 can be larger than long (for lseek) or off_t (for fseeko). The crux is the signedness. The register stack and memory stack are in region 4 on ia64. This means that the sign bit is 1. The large positive virtual address is wrongly interpreted as a negative file offset. There's no quick fix. Even if you get around the API by using a SEEK_SET up to LONG_MAX and follow it up with a SEEK_CUR for the remainder, the kernel simply cannot deal with it. and the second seek will just fail. Therefore, this change does not actually fix the root cause. It just makes sure we're not spitting out all kinds of garbage or that the get_struct() function in particular does not cause truss(1) to exit. This, I might add, invariably happened way too soon for truss(1) to be of any use on ia64... Notes: svn path=/head/; revision=122606
* Port truss(1) to 64-bit architectures:Marcel Moolenaar2003-11-0911-113/+84
| | | | | | | | | | | | | | | | | | | | | o Syscall return values do not fit in int on 64-bit architectures. Change the type of retval in <arch>_syscall_exit() to long and change the prototype of said function to return a long as well. o Change the prototype of print_syscall_ret() to take a long for the return address and change the format string accordingly. o Replace the code sequence tmp = malloc(X); sprintf(tmp, format, ...); with X by definition too small on 64-bit platforms by asprintf(&tmp, format, ...); With these changes the output makes sense again, although it does mess up the tabulation on ia64. Go widescreen... Not tested on: alpha, sparc64. Notes: svn path=/head/; revision=122348
* Fix truss so that it doesn't abort/exit when a syscall has been givenMarcel Moolenaar2003-10-271-0/+5
| | | | | | | a NULL-pointer for a sockaddr argument. Notes: svn path=/head/; revision=121606