summaryrefslogtreecommitdiffstats
path: root/usr.bin/truss/main.c
Commit message (Collapse)AuthorAgeFilesLines
* When doing the initial open of the proc via procfs, complain if we arealfred2005-03-271-4/+10
| | | | | | 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-271-218/+231
| | | | parts I'm touching to be as style(9) compliant as I can.
* When reporting reciept of a signal, print the signal's name.alfred2004-07-171-1/+23
|
* A first stab at truss support for amd64, basically cogged from i386.dwmalone2004-06-121-0/+3
| | | | It seems to work in my limited tests.
* 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:
* Port truss(1) to 64-bit architectures:marcel2003-11-091-1/+1
| | | | | | | | | | | | | | | | | | 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.
* Add FBSDID. Do not \n terminate warnx() argument. fprint() -> warnx().charnier2003-09-071-5/+3
|
* Port to ia64. It builds, but usability is very limited.marcel2002-11-101-0/+3
|
* Don't depend on <signal.h> to include <sys/time.h>, instead includemike2002-10-061-0/+1
| | | | | <sys/time.h> directly. This is mostly bogus since CLOCK_REALTIME should be defined in <time.h>, which these files already include.
* - Use time.h not sys/time.h.mdodd2002-08-061-1/+1
| | | | | | - Fix printf format errors. Submitted by: bde
* Use timespec not timeval.mdodd2002-08-051-3/+3
|
* Ported to sparc64.jake2002-08-041-0/+3
|
* Include <sys/time.h> for the declaration of struct timeval. Do notbde2002-08-041-0/+1
| | | | | | 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-041-3/+9
| | | | | | | | | execve(). This could be done in a more general manner but it still wouldn't be very pretty. MFC after: 3 weeks
* Add a "FreeBSD ELF32" entry to ex_types[].mdodd2002-08-041-0/+1
|
* Add options to print absolute and relative timestamps.mdodd2002-08-041-3/+13
| | | | | PR: bin/25587 (in part) MFC after: 3 weeks
* Allow tracking fork()ed children.mdodd2002-08-041-4/+26
| | | | | PR: bin/25587 (in part) MFC after: 3 weeks
* Parameterize globals.mdodd2002-08-041-27/+33
| | | | | PR: bin/25587 (in part) MFC after: 3 weeks
* s/inline/__inline/markm2002-07-191-1/+1
|
* OOPS! rev 1.16 accidently changed the default outfile from stderr topeter2002-05-161-1/+1
| | | | | | | | stdout. Unfortunately, DES mfc'ed this change in 1.15.2.1 (this part probably should not have been) so it is broken there too. truss is documented to use stderr, and other implementations use stderr. Submitted by: Arne Dag Fidjestøl <adf@idi.ntnu.no>
* Fix the code that selects the default binary type if the actual type can'tdes2002-02-081-3/+3
| | | | | | | | be determined. PR: bin/34698 Submitted by: (in part) Stefan Farfeleder <e0026813@stud3.tuwien.ac.at> MFC after: 1 weeks
* Partial WARNS=1 fizes with NO_WERROR set to prevent world breakage.markm2001-12-111-22/+9
| | | | Use __FBSDID().
* Back out part of previous commit: remove #include <sys/proc.h>.des2001-10-221-1/+0
|
* #include <sys/proc.h> where needed (for the stop event definitions) anddes2001-10-221-2/+5
| | | | reorder includes everywhere to conform to style(9).
* Initialize outfile in main()peter2001-08-131-1/+2
|
* Handle the case where we truss an SUGID program -- in particular, we needsef2000-01-101-2/+9
| | | | | | | | to wake up any processes waiting via PIOCWAIT on process exit, and truss needs to be more aware that a process may actually disappear while it's waiting. Reviewed by: Paul Saab <ps@yahoo-inc.com>
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Flush the output file before exiting; short-lived programs don't even fillmsmith1998-12-211-1/+2
| | | | the stdio buffer.
* Alpha support for truss. I tested this on both bento and beast (thanks,sef1998-10-031-1/+12
| | | | | Jordan, for pointing me at beast!). There should be no change for the i386 version.
* Use a default execution type if none of the listed ones match. Thissef1998-09-071-1/+10
| | | | | uses the first type listed in the array as the default type. This isn't perfect, but I thought it would be better than nothing.
* When exiting on SIGINT, exit with signal statuscracauer1998-08-241-1/+9
|
* Fixed printf format errors.bde1998-07-061-3/+3
|
* include sys so it builds on 2.2.xjmg1998-01-071-2/+2
| | | | also, fix misspelling of -1 (as EOF for getopt)
* Sort Xrefs. Use err(3). Remove uneeded #include.charnier1998-01-051-23/+24
| | | | | | Correct usage: one of {-p pid, command} is required. Open output file when command line is fully analyzed: incorrect `truss -o f' command does not create an empty file anymore.
* Add some copyright and license terms, at Jordan's request. Note thatsef1997-12-201-1/+33
| | | | syscall.h just refers to another file for the copyright notice.
* Change the ioctls for procfs around a bit; in particular, whever possible,sef1997-12-131-2/+2
| | | | | | | | | | | | | | change from ioctl(fd, PIOC<foo>, &i); to ioctl(fd, PIOC<foo>, i); This is going from the _IOW to _IO ioctl macro. The kernel, procctl, and truss must be in synch for it all to work (not doing so will get errors about inappropriate ioctl's, fortunately). Hopefully I didn't forget anything :).
* Complain about empty command lines.sef1997-12-061-2/+2
|
* recognize "FreeBSD ELF" as an executable typepeter1997-12-061-2/+3
| | | | close() takes a fd, not a char * :-)
* #include <unistd.h> to get it to compilepeter1997-12-061-1/+2
| | | | Submitted by: Andreas Klemm <andreas@klemm.gtn.com>
* Truss program. Requires procfs.sef1997-12-061-0/+201
OpenPOWER on IntegriCloud