summaryrefslogtreecommitdiffstats
path: root/usr.bin/truss
Commit message (Collapse)AuthorAgeFilesLines
* decode utimes, lutimes, futimes, chflags, lchflags.alfred2005-05-261-0/+10
|
* decode mkdir args.alfred2005-05-261-0/+2
|
* When doing the initial open of the proc via procfs, complain if we arealfred2005-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.
* I've been working on this somewhat so I'm moving thealfred2005-03-272-313/+329
| | | | parts I'm touching to be as style(9) compliant as I can.
* Change fix a bug where the length of data written by snprintf wasalfred2005-03-031-1/+1
| | | | | | | being mishandled by using accumulation (into an uninitialized variable) instead of direct assignment. Reviewed by: scottl
* For variables that are only checked with defined(), don't provideru2004-10-241-1/+1
| | | | any fake value.
* Improve markup and language.dd2004-09-071-1/+3
|
* Fix Quad handling on 64-bit architectures. On 64-bit machines, a Quadmarcel2004-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)
* Update doc dates.alfred2004-09-031-1/+1
| | | | Pointed out by: ru
* xref and give a hint as to what procctl can be used for.alfred2004-09-031-1/+7
|
* don't seg if the syscall is invalid for i386fbsd.alfred2004-08-083-2/+6
|
* Use the length modifier 'll' instead of 'q' to print long longs.stefanf2004-07-281-1/+1
|
* Support readlink(2) better. Readlink does not nul terminate thealfred2004-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.
* When reporting reciept of a signal, print the signal's name.alfred2004-07-173-7/+26
|
* Decode the "wence" arg to lseek and linux_lseek.alfred2004-07-102-2/+16
|
* Fix unterminated RCSID.bms2004-06-131-1/+1
| | | | Submitted by: Liam J. Foy
* A first stab at truss support for amd64, basically cogged from i386.dwmalone2004-06-123-0/+352
| | | | It seems to work in my limited tests.
* COMPAT_SUNOS is gone.phk2004-06-111-5/+3
|
* Add support for decoding Timespec, Timeval, Itimerval, Pollfd,dwmalone2004-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>
* Use pread to implement pread, rather than taking a detour throug stdio.dwmalone2004-03-231-16/+2
| | | | | PR: 52190 Submitted by: Dan Nelson <dnelson@allantgroup.com>
* decode mprotect args while i'm here.alfred2004-03-231-0/+2
|
* decode fcntl and mmap arguments.alfred2004-03-233-2/+66
|
* Move declarations of Procfd to a header file.dwmalone2004-01-079-8/+2
|
* Fix a printf format warning.dwmalone2004-01-071-1/+1
|
* Fix signal behaviour.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:
* Do not ignore any possible errors that fseeko() may have. The factmarcel2003-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...
* Port truss(1) to 64-bit architectures:marcel2003-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.
* Fix truss so that it doesn't abort/exit when a syscall has been givenmarcel2003-10-271-0/+5
| | | | a NULL-pointer for a sockaddr argument.
* Add FBSDID. Do not \n terminate warnx() argument. fprint() -> warnx().charnier2003-09-072-11/+6
|
* send() and recv() are just wrappers, not actual syscalls.des2003-08-051-4/+0
|
* Add recv(2), recvfrom(2), send(2) and sendfrom(2).des2003-08-051-2/+10
|
* Fix truss on ia64. The syscall arguments are written to the trapmarcel2003-08-021-17/+5
| | | | | | | | frame, occupying scratch registers r16 and up. We don't have to save any scratch registers for syscalls, so we have plenty of room there. Consequently, when we fetch the registers from the process, we automaticly have all the arguments and don't need to read them seperately.
* Use cat(1) instead of cp(1) so as not to break -DNOCLEAN buildsmarcel2003-06-061-2/+2
| | | | when the file permissions of source files don't allow writing.
* Revamp of the syscall path, exception and context handling. Themarcel2003-05-161-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | prime objectives are: o Implement a syscall path based on the epc inststruction (see sys/ia64/ia64/syscall.s). o Revisit the places were we need to save and restore registers and define those contexts in terms of the register sets (see sys/ia64/include/_regset.h). Secundairy objectives: o Remove the requirement to use contigmalloc for kernel stacks. o Better handling of the high FP registers for SMP systems. o Switch to the new cpu_switch() and cpu_throw() semantics. o Add a good unwinder to reconstruct contexts for the rare cases we need to (see sys/contrib/ia64/libuwx) Many files are affected by this change. Functionally it boils down to: o The EPC syscall doesn't preserve registers it does not need to preserve and places the arguments differently on the stack. This affects libc and truss. o The address of the kernel page directory (kptdir) had to be unstaticized for use by the nested TLB fault handler. The name has been changed to ia64_kptdir to avoid conflicts. The renaming affects libkvm. o The trapframe only contains the special registers and the scratch registers. For syscalls using the EPC syscall path no scratch registers are saved. This affects all places where the trapframe is accessed. Most notably the unaligned access handler, the signal delivery code and the debugger. o Context switching only partly saves the special registers and the preserved registers. This affects cpu_switch() and triggered the move to the new semantics, which additionally affects cpu_throw(). o The high FP registers are either in the PCB or on some CPU. context switching for them is done lazily. This affects trap(). o The mcontext has room for all registers, but not all of them have to be defined in all cases. This mostly affects signal delivery code now. The *context syscalls are as of yet still unimplemented. Many details went into the removal of the requirement to use contigmalloc for kernel stacks. The details are mostly CPU specific and limited to exception_save() and exception_restore(). The few places where we create, destroy or switch stacks were mostly simplified by not having to construct physical addresses and additionally saving the virtual addresses for later use. Besides more efficient context saving and restoring, which of course yields a noticable speedup, this also fixes the dreaded SMP bootup problem as a side-effect. The details of which are still not fully understood. This change includes all the necessary backward compatibility code to have it handle older userland binaries that use the break instruction for syscalls. Support for break-based syscalls has been pessimized in favor of a clean implementation. Due to the overall better performance of the kernel, this will still be notived as an improvement if it's noticed at all. Approved by: re@ (jhb)
* Decode a few more syscalls.mdodd2003-04-151-1/+24
|
* Removed extra parentheses.ru2003-02-201-1/+1
|
* Fixed comment.ru2003-02-203-3/+3
|
* mdoc(7) police: markup polishing.ru2002-11-261-4/+10
| | | | Approved by: re
* Port to ia64. It builds, but usability is very limited.marcel2002-11-103-0/+349
|
* Various cleanups of truss:dwmalone2002-11-096-97/+121
| | | | | | | | | | | 1) Missing include. 2) Constness. 3) ANSIfication. 4) Avoid some shadowing. 5) Add/clarify some error messages. 6) Some int functions were using return without a value. 7) Mark some parameters as unused. 8) Cast a value we know is non-negative to a size_t before comparing.
* Check if name is NULL before we strcmp the syscall name. This wasdwmalone2002-11-091-1/+1
| | | | | sometimes triggered if you began trussing a process while it was in a syscall, as the name is filled in when the syscall is made.
* Don't depend on <signal.h> to include <sys/time.h>, instead includemike2002-10-062-0/+2
| | | | | <sys/time.h> directly. This is mostly bogus since CLOCK_REALTIME should be defined in <time.h>, which these files already include.
* Remove an unnecessary cast.mdodd2002-08-071-2/+2
|
* - Use time.h not sys/time.h.mdodd2002-08-069-13/+13
| | | | | | - Fix printf format errors. Submitted by: bde
* Remove extra space in output.mdodd2002-08-051-1/+1
|
* Diff reduction.mdodd2002-08-056-140/+244
|
* Use timespec not timeval.mdodd2002-08-053-15/+24
|
* Ported to sparc64.jake2002-08-044-5/+372
|
* Include <sys/time.h> for the declaration of struct timeval. Do notbde2002-08-047-0/+7
| | | | | | depend on namespace pollution in <signal.h>. (truss shouldn't be using timevals anyway, since it was implemented long after timevals were obsoleted by timespecs.)
* Add options to print the argument and environment string parameters tomdodd2002-08-0410-6/+146
| | | | | | | | | execve(). This could be done in a more general manner but it still wouldn't be very pretty. MFC after: 3 weeks
OpenPOWER on IntegriCloud