summaryrefslogtreecommitdiffstats
path: root/usr.bin/kdump/kdump.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 1) Some of the #defines or enums for which we auto-generate namingdes2011-10-081-1/+0
| | | | | | | | | | | | | functions may be wider than int, so use intmax_t throughout. Also add missing casts in printf() calls. 2) Clean up some of the auto-generated code to improve readability. 3) Auto-generate kdump_subr.h. Note that this requires a semi-ugly hack in the Makefile to make sure it is generated before make(1) tries to build kdump.c, or preprocess it for 'make depend'. MFC after: 3 weeks
* kdump: Show code for signals where the default action was taken.jilles2011-04-171-1/+1
| | | | | | | This information is available as of kernel r220740. Trace files from older kernels will always have 0. MFC after: 1 week
* Teach kdump to decode linux syscalls names too.dchagin2011-03-011-18/+112
| | | | | | | | Fix bug introduced in my previous commit: the kernel always dump native signal numbers, so no need to check the ABI in ktrpsig(). Suggested by: jhb MFC after: 1 Month.
* Teach kdump to understand sv_flags records in the trace files.dchagin2011-02-251-16/+123
| | | | MFC after: 1 Month.
* Remove the advertising clause from UCB copyrighted files in usr.bin. Thisjoel2010-12-111-4/+0
| | | | | | | | | is in accordance with the information provided at ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change Also add $FreeBSD$ to a few files to keep svn happy. Discussed with: imp, rwatson
* Change all our own code to use st_*tim instead of st_*timespec.ed2010-03-281-16/+16
| | | | Also remove some local patches to diff(1) which are now unneeded.
* The kdump data stream is an unaligned data stream for stat andimp2010-02-181-3/+9
| | | | | | | | | | sockaddr structures. As such, we have top copy the data structure into a local buffer before we can reference it, otherwise we have unaligned references (these are fixed up automatically on some CPUs, but not on others). We do this unconditionally to make the code easier to read and understand. Submitted by: Grzegorz Bernacki
* - Cast intptr_t, pid_t and time_t values to intmax_t and use %jd withjh2010-02-061-16/+19
| | | | | | | | | printf. - Cast the system call return value to long and use %ld in a printf in ktrsysret(). PR: bin/123774 MFC after: 2 weeks
* Update malloc utrace structure parsing to reflect the change (r199265)cperciva2009-11-141-11/+8
| | | | | | | | in how malloc_init is logged from (0, 0, 0) to (-1, 0, 0). While we're here, simplify the logic. Reviewed by: jhb (earlier version)
* Use a safety belt for cases where corrupted narg can be passed to theattilio2009-11-071-1/+1
| | | | | | | | | | | ktrsyscall(). print_number() does decrement the number of arguments, leading to infinite loops for negative values. Reported by: Patrick Lamaiziere <patpr at davenulle dot org>, Jonathan Pascal <jkpyvxmzsa at mailinator dot com> Submitted by: jh PR: bin/120055, kern/119564 MFC: 1 week
* Add two missing include files and prototype for sockfamilyname()delphij2009-03-201-0/+3
| | | | which is generated by mksubr.
* Add a new type of KTRACE record for sysctl(3) invocations. It uses thejhb2009-03-111-0/+4
| | | | | | | | internal sysctl_sysctl_name() handler to map the MIB array to a string name and logs this name in the trace log. This can be useful to see exactly which sysctls a thread is invoking. MFC after: 1 month
* Remove netatm from HEAD as it is not MPSAFE and relies on the now removedrwatson2008-05-251-2/+0
| | | | | | | | | | | | | | | | | | | NET_NEEDS_GIANT. netatm has been disconnected from the build for ten months in HEAD/RELENG_7. Specifics: - netatm include files - netatm command line management tools - libatm - ATM parts in rescue and sysinstall - sample configuration files and documents - kernel support as a module or in NOTES - netgraph wrapper nodes for netatm - ctags data for netatm. - netatm-specific device drivers. MFC after: 3 weeks Reviewed by: bz Discussed with: bms, bz, harti
* Spell -t option's argument by name.ru2008-04-021-1/+1
|
* - Remove ksethrcmdname.jeff2008-03-121-6/+0
|
* This patch adds a new ktrace(2) record type, KTR_STRUCT, whose payloaddes2008-02-231-4/+239
| | | | | | | | | | | | | | | | | | | | | | | consists of the null-terminated name and the contents of any structure you wish to record. A new ktrstruct() function constructs and emits a KTR_STRUCT record. It is accompanied by convenience macros for struct stat and struct sockaddr. In kdump(1), KTR_STRUCT records are handled by a dispatcher function that runs stringent sanity checks on its contents before handing it over to individual decoding funtions for each type of structure. Currently supported structures are struct stat and struct sockaddr for the AF_INET, AF_INET6 and AF_UNIX families; support for AF_APPLETALK and AF_IPX is present but disabled, as I am unable to test it properly. Since 's' was already taken, the letter 't' is used by ktrace(1) to enable KTR_STRUCT trace points, and in kdump(1) to enable their decoding. Derived from patches by Andrew Li <andrew2.li@citi.com>. PR: kern/117836 MFC after: 3 weeks
* Only use sockoptname() to parse socket option names for SOL_SOCKETjhb2008-01-071-4/+6
| | | | | | | requests. MFC after: 3 days Reported by: Michiel Boland michiel boland.org
* Add several missing comma's in the fancy syscall parsing case beforejhb2007-12-061-0/+12
| | | | | | some arguments that are parsed (e.g., semctl command names). MFC after: 3 days
* Fix alignment of context switch traces.jhb2007-07-101-1/+1
| | | | | MFC after: 1 week Approved by: re (rwatson: "I like simple patches.")
* kdump has knowledge of lseek() and mmap() arg decoding. Teach it aboutpeter2007-07-041-1/+25
| | | | | | the new mmap and lseek syscalls. Approved by: re (kensmith)
* Remove static ptrace_ops array and extract ptrace op names fromemaste2007-04-091-36/+2
| | | | sys/ptrace.h with mksubr.
* Add various utrace's for use with ktrace to the ELF runtime linker. Tojhb2007-01-091-0/+107
| | | | | | | | activate the traces, set the LD_UTRACE (or LD_32_UTRACE) environment variable. This also includes code in kdump(8) to parse the traces. Reviewed by: kan, jdp MFC after: 2 weeks
* Add code to parse the utrace(2) entries generated by malloc(3) in a morejhb2007-01-051-1/+30
| | | | | | | | human-readable format. Note that we report 'realloc(p, 0)' as 'free(p)' since both cases are encoded the same way and 'free()' is more common than a realloc() to 0. MFC after: 1 week
* Add sockipprotoname() function. Decode the third parameter (protocol)rodrigc2007-01-041-1/+11
| | | | | | | | | | | of a socket() call with sockipprotoname() if the first parameter (domain) is PF_INET or PF_INET6. Old parsing behavior before this change: ping6 CALL socket(PF_INET6,SOCK_RAW,0x3a) New behavior after this change: ping6 CALL socket(PF_INET6,SOCK_RAW,IPPROTO_ICMPV6)
* o Fix some printf(3) format nits in my patch I submitted to kib@.maxim2006-07-121-2/+2
| | | | Submitted by: ru
* Check that the signal number is in range.kib2006-07-121-1/+4
| | | | | | Submitted by: maxim MFC after: 1 week Approved by: pjd (mentor)
* Change kdump to print more useful information, i.e. it changes fromnetchild2006-05-201-13/+388
| | | | | | | | | | | | | | | | | | 32229 telnet CALL mmap(0,0x8000,0x3,0x1002,0xffffffff,0,0,0) 32229 telnet CALL open(0x2807bc28,0,0x1b6) 32229 telnet CALL socket(0x2,0x2,0) to 32229 telnet CALL mmap(0,0x8000,PROT_READ|PROT_WRITE,MAP_PRIVATE|MAP_ANON,0xffffffff,0,0,0) 32229 telnet CALL open(0x2807bc28,O_RDONLY,<unused>0x1b6) 32229 telnet CALL socket(PF_INET,SOCK_DGRAM,0) David wanted to implement the suggestions which came up at the review from arch@ too, but real life rejected this proposal. So I commit what we already got and let another volunteer pick the remaining work from the ideas list. Submitted by: "David Kirchner" <dpk@dpk.net> Suggested by: FreeBSD ideas list page Reviewed by: arch
* Add "-s" argument to kdump to suppress the display of I/O data.rwatson2005-11-121-3/+8
| | | | MFC after: 1 week
* Add a "-H" argument to kdump, which causes kdump to print an additionalrwatson2005-11-011-5/+27
| | | | | | | | | | | | | | field holding the threadid. This is more useful for libthr than libpthread, but still quite useful in libpthread as it can be used to process interlaced records from multiple threads over the course of a system call. Detect old ktr_buffer values using the heuristic "if it's negative, then it must not be a valid threadid". This may leave something to be desired. MFC after: 1 month Reviewed by: davidxu
* Place a function prototype correctly.ru2004-09-191-1/+1
| | | | Submitted by: Divacky Roman
* Respect decimal flag when dumping USER type records.phk2004-03-251-1/+4
|
* First pass at attempted debrucification:peter2003-12-081-2/+2
| | | | | | | | | | - sort the -E switch into the right place. - add previously missing -p pid in usage (from the last few commits). - add -E to usage. - consistently use trfile in the man page. I knew I shouldn't have touched the man page. If I commit to a man page, it just makes people suspicious. :-)
* Add a -E (elapsed time) flag to kdump. This is like -T, except it ispeter2003-12-071-1/+9
| | | | | | relative to start of the dump. Approved by: re (scottl)
* Two enhancements for kdump.peter2003-06-031-21/+95
| | | | | | 1) add a "-p pid", which is rather useful for selecting a single pid in a combined trace file (eg: with ktrace -i). 2) display binary genio data in a more precise format.
* Add a default case that just outputs a new line for the case of anjhb2003-03-131-0/+3
| | | | unknown header type.
* Teach kdump(8) to handle events marked with KTR_DROP. If a record hasjhb2003-03-131-0/+12
| | | | | | | | | | | | | | KTR_DROP set in its header, then we output an extra line to stdout to indicate that events were dropped between the previous record and this record. It is a bit trickier because we need to always notify the user if events are dropped even if KTR_DROP is set on a record of a type that we aren't interested in since kdump(8) doesn't know if the dropped events were of the types that the user has requested. To avoid outputting multiple events dropped notices in between actual event logs, a state variable is set whenever a drop is logged and cleared whenever an actual record is output. Requested by: phk
* Improve WARNS situation for kdump:dwmalone2002-07-281-45/+58
| | | | | | | | | | | | | 1) Define _KERNEL while including sys/time.h to get some function prototypes. 2) Add prototypes and ANSIify definitions. 3) Constness changes. 4) Remove register keyword. 5) Actually return a sensible value from main. 6) Make fread_tail take a void * instead of a char *. 7) Avoid a signedness warning by casting to a size_t. Should be safe enough 'cos we also check for nonnegativity. 8) Be extra chummy with sigset_t rather than passing a struct to printf and pretending it is an int.
* Consistently use FBSDIDobrien2002-06-301-2/+2
|
* Change #ifdef KERNEL to #ifdef _KERNEL in the public headers. "KERNEL"peter1999-12-291-2/+2
| | | | | | is an application space macro and the applications are supposed to be free to use it as they please (but cannot). This is consistant with the other BSD's who made this change quite some time ago. More commits to come.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Decode new ptrace requests PT_GETDBREGS and PT_SETDBREGS.bde1999-07-171-1/+9
|
* Decode all currently supported values of the ptrace `request' arg.bde1999-06-261-3/+20
|
* Syscall arguments are now properly aligned. Print them, and syscall returndt1999-06-161-16/+16
| | | | values, as longs, instead of int.
* FIx the output of long command names.jmz1999-05-211-2/+2
| | | | | PR: bin/10027 Submitted by: Arne Henrik Juul <arnej@math.ntnu.no>
* Use err(3). Correct incomplete man page.charnier1997-07-161-34/+21
|
* Spelling correction (`1 bytes' is now printed `1 byte')charnier1997-05-221-2/+3
| | | | | PR: bin/3376 Submitted by: me
* compare return value from getopt against -1 rather than EOF, per the finalimp1997-03-291-1/+1
| | | | posix standard on the topic.
* Fix arg parsing. kdump used to allow a single argument, which itfenner1996-11-181-3/+1
| | | | silently ignored.
* Remove length field from utrace entries.phk1996-09-221-6/+6
|
* For now we just hexdump the stuff in USER records.phk1996-09-191-1/+18
|
OpenPOWER on IntegriCloud