summaryrefslogtreecommitdiffstats
path: root/usr.bin/truss
Commit message (Collapse)AuthorAgeFilesLines
* truss: recognize O_DIRECTORY, O_EXEC, O_TTY_INIT and O_CLOEXECmjg2013-06-301-1/+1
| | | | MFC after: 3 days
* Add arm bits to truss.cognet2013-03-073-0/+376
|
* Revert r247300 for now. I'll post a new changeset for review.delphij2013-02-263-11/+11
|
* Expose timespec and timeval macros when __BSD_VISIBLE is defined. Thisdelphij2013-02-263-11/+11
| | | | | | | | | | | allows userland application to use the following macros: timespecclear, timespecisset, timespeccmp, timespecadd, timespecsub; timevalclear, timevalisset, timevalcmp. MFC after: 1 month
* truss: use 'e' flag for fopen instead of fcntl(.., FD_CLOEXEC)mjg2013-01-271-7/+4
|
* truss: if file requested with -o flag could not be opened print the reasonmjg2013-01-271-1/+1
| | | | MFC after: 3 days
* - Make truss thread-aware.zont2012-09-1614-721/+804
| | | | | Approved by: kib (mentor) MFC after: 2 weeks
* - Fix detaching under some circumstances.zont2012-09-123-14/+37
| | | | | | | | | | | | | | | | | | | | | When truss is detaching from very active process it is possible to hang on waitpid(2) in restore_proc() forever, because ptrace(PT_SYSCALL) must be called before detaching, to allow the debugging process to continue execution. Also when truss called with '-c' argument, it does not print anything after detach, because it immediately exits from restore_proc(). To fix these two problems make detaching deferred, but then it is impossible to detach from a process which does not do any system call. To fix this issue use sigaction(2) instead of signal(3) to disable SA_RESTART flag for waitpid(2) that makes it non-restartable. Remove global variable child_pid, because now detaching is handled in context where child's pid is known. Reported by: mjg Tested by: mjg, swills Approved by: kib (mentor) MFC after: 2 weeks
* - Remove unused variables.zont2012-09-111-6/+3
| | | | | | - Remove redundant return after err(3) call. Approved by: kib (mentor)
* - Style(9) cleanup.zont2012-09-0215-2132/+2202
| | | | Approved by: kib (mentor)
* - Remove unused variables.zont2012-08-302-4/+2
| | | | | | - Fix warnings about comparing signed and unsigned ints. Approved by: kib (mentor)
* - Put arguments for print_syscall_ret() function in proper order.zont2012-08-231-1/+1
| | | | | | Bug was introduced in r192025. Approved by: kib (mentor)
* - Use pid_t type instead of just int.zont2012-08-214-7/+7
| | | | Approved by: kib (mentor)
* Since truss also uses kdump's mkioctls script, pass the value of ${CPP}dim2012-04-091-1/+1
| | | | | | there too, similar to r234058. MFC after: 1 week
* Add more static keywords to truss(1) source code.ed2011-12-104-5/+5
| | | | | | There are some tables in the source code that are only used by the individual source files themselves. Therefore there is no need to export them.
* Use explicit information from the kernel to detect the traps due tokib2011-12-041-3/+13
| | | | | | | syscall entry and leave. Based on submision by: Dan Nelson <dnelson allantgroup com> MFC after: 1 month
* It turns out that truss also used kdump's mkioctls script, and expecteddes2011-10-212-2/+3
| | | | | | | | | | | | ioctlname() to return a pointer to the name rather than print it. This did not show up in testing because truss had its own prototype for ioctlname(), so it would build fine and run fine as long as the program being traced did not issue an ioctl. Teach mkioctls to generate different versions of ioctlname() based on its first command-line argument. Pointed out by: Garrett Cooper <yanegomi@gmail.com>
* Fix typos in comments, no functional changes.bcr2011-05-198-8/+8
| | | | | | Found by: codespell Reviewed by: alfred MFC after: 1 week
* Simplify various code that allowed for sys_signame being lower case.jilles2011-03-061-4/+0
| | | | This was changed in r218285.
* Properly check for errors from waitpid().jhb2011-02-151-4/+4
| | | | | Submitted by: gcooper MFC after: 1 week
* Make sys_signame upper case.jilles2011-02-041-1/+1
| | | | | | | | | | | | This matches the constants from <signal.h> with 'SIG' removed, which POSIX requires kill and trap to accept and 'kill -l' to write. 'kill -l', 'trap', 'trap -l' output is now upper case. In Turkish locales, signal names with an upper case 'I' are now accepted, while signal names with a lower case 'i' are no longer accepted, and the output of 'killall -l' now contains proper capital 'I' without dot instead of a dotted capital 'I'.
* Don't write the terminating NUL past end of buffer.jh2010-12-061-1/+1
| | | | | PR: bin/152345 Submitted by: Mateusz Guzik
* Set FD_CLOEXEC for the output file only when the file has been specifiedjh2010-11-131-6/+7
| | | | | | | | | with the -o option. Setting the flag for stderr (the default) could cause the traced process to redirect stderr to a random file. PR: bin/152151 Submitted by: ashish MFC after: 5 days
* Remove setpgid() call before executing child process.ed2010-10-201-1/+0
| | | | | | | | | Using a separate process group here is bad, since (for example) job control in the TTY layer prevents interaction with the TTY, causing the child process to hang. Mentioned on: current@ MFC after: 2 weeks
* s/sytem/system in comments, no functional changes.bcr2010-10-138-8/+8
| | | | Reviewed by: alfred@
* Fix breakage introduced in r211725 and improve functionality of truss onnwhitehorn2010-08-285-3/+31
| | | | 64-bit powerpc by adding 32-bit compatibility features.
* MFtbemd:imp2010-08-231-3/+3
| | | | | Prefer MACHNE_CPUARCH to MACHINE_ARCH in most contexts where you want to test of all the CPUs of a given family conform.
* Teach truss and xlint how to operate on 64-bit PowerPC systems.nwhitehorn2010-07-121-0/+323
|
* Fix copyright spelling.imp2010-03-1014-15/+15
| | | | | PR: 139825 Submitted by: Ruslan Mahmatkhanov
* This fix makes it so the args are malloc'd beforerrs2010-02-031-1/+1
| | | | | | | | we use them (always a good idea ;-0) This was found and fixed by JC Obtained from: JC (c.jayachandran@gmail.com)
* Build usr.bin/ with WARNS=6 by default.ed2010-01-021-1/+0
| | | | Also add some missing $FreeBSD$ to keep svn happy.
* The devices that supported EVFILT_NETDEV kqueue filters were removed inbrooks2009-12-311-1/+1
| | | | | | | | | | | | r195175. Remove all definitions, documentation, and usage. fifo_misc.c: Remove all kqueue tests as fifo_io.c performs all those that would have remained. Reviewed by: rwatson MFC after: 3 weeks X-MFC note: don't change vlan_link_state() function signature
* Allow proper tracing of posix_openpt(2).ed2009-12-231-0/+2
|
* Cast time_t values to intmax_t and use %jd with printf.jh2009-12-211-5/+5
| | | | | OK'ed by: delphij Approved by: trasz (mentor)
* Remove non-working special case for pipe(2) from amd64-fbsd32.c andjh2009-12-213-26/+8
| | | | | | | | | i386-fbsd.c. Add pipe(2) to syscall table to decode it's pointer argument properly and re-add special handling for pipe(2) return value to print_syscall_ret(). PR: bin/120870 Approved by: trasz (mentor)
* Avoid sharing the file descriptor of the output file with tracedjh2009-12-201-0/+6
| | | | | | | | | processes by setting the FD_CLOEXEC flag for the output file. PR: bin/140493 Submitted by: Erik Lax OK'ed by: delphij Approved by: trasz (mentor)
* Add fork(2), getegid(2), geteuid(2), getgid(2), getpid(2), getpgid(2),jh2009-12-201-0/+12
| | | | | | | | getpgrp(2), getppid(2), getsid(2) and getuid(2) to syscall table to decode their arguments correctly. OK'ed by: delphij Approved by: trasz (mentor)
* Revert most part of 200420 as requested, as more review and polish isdelphij2009-12-132-0/+6
| | | | needed.
* Remove unneeded header includes from usr.bin/ except contributed code.delphij2009-12-112-6/+0
| | | | Tested with: make universe
* Correct off-by-one issue in truss(1) which happens when system call numberdelphij2009-05-289-9/+9
| | | | | | | | is nsyscalls. PR: bin/134916 Submitted by: Steven Hartland <steven hartland multiplay co uk> MFC after: 2 weeks
* Reduce diff against my local version: replace malloc+memset() cases to calloc().delphij2009-05-1510-22/+12
|
* Fix print_syscall_ret parameter order.dds2009-05-131-1/+1
|
* Fix compilation error introduced in r192025.dds2009-05-131-1/+2
|
* Add -c option to summarize number of calls, errors, and system time.dds2009-05-1213-145/+247
| | | | Reviewed by: alfred
* Don't exit until all truss children were exit.delphij2009-04-131-4/+10
|
* Correct a bug where pr_data should have been assigned.delphij2009-04-131-4/+4
|
* Add preliminary support for truss on MIPS. It compiles, but has notimp2009-02-153-0/+354
| | | | | | | | been extensively tested. And the ELF64 stuff likely is not quite right... # There's a lot of cut-n-paste code here that could easily be # refactored, at least for FreeBSD syscalls.
* Attaching to the init process returns EINVAL,trhodes2009-01-231-2/+2
| | | | | | | | so give an example that is more likely to work. Stolen from the ktrace(1) manual page. PR: 128222 Submitted by: Mateusz Guzik <mjguzik@gmail.com>
* Try to make this code slightly less painful to read.des2008-07-312-690/+673
|
* Retire some stale alpha references.jhb2008-05-162-7/+0
|
OpenPOWER on IntegriCloud