aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/gcore/gcore.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove copyright strings ifdef'd outWarner Losh2023-11-271-9/+0
| | | | | | | | | | | We've ifdef'd out the copyright strings for some time now. Go ahead and remove the ifdefs. Plus whatever other detritis was left over from other recent removals. These copyright strings are present in the comments and are largely from CSRG's attempt at adding their copyright to every binary file (which modern interpretations of the license doesn't require). Sponsored by: Netflix
* usr.bin: Remove ancient SCCS tags.Warner Losh2023-11-271-3/+0
| | | | | | | | Remove ancient SCCS tags from the tree, automated scripting, with two minor fixup to keep things compiling. All the common forms in the tree were removed with a perl script. Sponsored by: Netflix
* Remove $FreeBSD$: one-line .c patternWarner Losh2023-08-161-2/+0
| | | | Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
* gcore: add option to dump core using kernel facilityKonstantin Belousov2021-05-031-9/+66
| | | | | | | | | | | -k switch causes gcore to use ptrace(PT_COREDUMP) instead of manually reading process memory and constructing the core. Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D29955
* gcore: split code to open core file into helperKonstantin Belousov2021-05-031-8/+17
| | | | | | | | Reviewed by: markj Tested by: pho Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D29955
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-201-0/+2
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* Renumber copyright clause 4Warner Losh2017-02-281-1/+1
| | | | | | | | | | | | Renumber cluase 4 to 3, per what everybody else did when BSD granted them permission to remove clause 3. My insistance on keeping the same numbering for legal reasons is too pedantic, so give up on that point. Submitted by: Jan Schaumann <jschauma@stevens.edu> Pull Request: https://github.com/freebsd/freebsd/pull/96 Notes: svn path=/head/; revision=314436
* Cleanup some leftovers from '-s' removal in r302792.Bryan Drewery2016-11-171-16/+1
| | | | | | | | MFC after: 2 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=308788
* Remove gcore's -s option.Mark Johnston2016-07-141-4/+1
| | | | | | | | It has no effect and is always implicitly set since ptrace(2) stops the target process. Notes: svn path=/head/; revision=302792
* Remove the advertising clause from UCB copyrighted files in usr.bin. ThisJoel Dahl2010-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 Notes: svn path=/head/; revision=216370
* Fix the way the segments are included in the gcore outputs (with theAttilio Rao2010-07-141-4/+7
| | | | | | | | | | | | | | | | | | | | | | default invokation): - Right now if segments are not writable are not included. Remove this. - Right now if a segment is mapped with NOCORE the check is not honoured. Change this by checking the newly added flag, from libutil, KVME_FLAG_NOCOREDUMP. Besides that, add a new flag (-f) that forces a 'full' dump of all the segments excluding just the malformed ones. This might be used very carefully as, among the reported segments, there could be memory mapped areas that could be vital to program execution. Sponsored by: Sandvine Incorporated Discussed with: kib Reviewed by: emaste Tested by: Sandvine Incorporated MFC after: 2 weeks Notes: svn path=/head/; revision=210063
* Fix gcore so that it can have the '-s' flag without hanging.Matt Jacob2010-02-051-27/+18
| | | | Notes: svn path=/head/; revision=203532
* Revert most part of 200420 as requested, as more review and polish isXin LI2009-12-131-0/+1
| | | | | | | needed. Notes: svn path=/head/; revision=200462
* Remove unneeded header includes from usr.bin/ except contributed code.Xin LI2009-12-111-1/+0
| | | | | | | Tested with: make universe Notes: svn path=/head/; revision=200420
* Change gcore in order to get rid of the procfs accesses and use FreeBSD'sAttilio Rao2009-11-251-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | specific sysctls and ptrace interfaces. This change switches a bit gcore POLA that is summarized here: - now gcore can recognize threads within the process and handle dumps on thread-scope - the process to be analyzed will be stopped during its gcore run - gcore may not work with processes which are actively being analyzed by gdb or truss - the ptrace interface may cause syscalls to return EINTR, thus interferring with signals handling within the process Side note: <janitor task> the interface can be further lifted in order to get rid of the very last procfs interfaces remnants and made more suitable for copying with sysctl/ptrace interface </janitor task>. Obtained from: Sandvine Incorporated Reviewed by: emaste, rwatson Sponsored by: Sandvine Incorporated MFC: 1 month Notes: svn path=/head/; revision=199805
* Fix some WARNS:David Malone2004-02-151-1/+1
| | | | | | | | | 1) Remove some unused variables. 2) Mark some things aas static or __unused. 3) Cast to make sure we're comparing the same types. Notes: svn path=/head/; revision=125859
* Use a crowbar to move the a.out code out of gcore.c and into its ownPeter Wemm2002-09-131-193/+23
| | | | | | | | | file so that we have a chance of using gcore on non-i386 platforms. Use linker sets to reduce the registration glue. Remove md-sparc.c, we do not have an a.out sparc32 port. aoutcore.c was repocopied from gcore.c. Notes: svn path=/head/; revision=103299
* ANSIify function definitions.David Malone2002-09-041-1/+3
| | | | | | | | | | | | Add some constness to avoid some warnings. Remove use register keyword. Deal with missing/unneeded extern/prototypes. Some minor type changes/casts to avoid warnings. Reviewed by: md5 Notes: svn path=/head/; revision=102944
* Consistently wrap CSRG SCM ID.David E. O'Brien2002-06-301-1/+2
| | | | | | | Requested by: bde Notes: svn path=/head/; revision=99130
* Consistently use FBSDIDDavid E. O'Brien2002-06-301-2/+0
| | | | Notes: svn path=/head/; revision=99112
* Do not print error message twice.Philippe Charnier2002-04-121-3/+5
| | | | Notes: svn path=/head/; revision=94560
* remove __PWarner Losh2002-03-221-6/+6
| | | | Notes: svn path=/head/; revision=92920
* Compensate for "Compensate for header dethreading" by backing it out.Bruce Evans2001-10-101-1/+0
| | | | Notes: svn path=/head/; revision=84768
* KSE Milestone 2Julian Elischer2001-09-121-4/+14
| | | | | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha Notes: svn path=/head/; revision=83366
* Fix usage message, the executable is optional.Mike Heffner2001-08-151-1/+1
| | | | | | | | PR: bin/29735 MFC after: 2 weeks Notes: svn path=/head/; revision=81735
* Fix minor style issue from previous commit.David E. O'Brien2001-05-031-1/+1
| | | | Notes: svn path=/head/; revision=76228
* * include/elf.h has been repo copied to include/elf-hints.h, and it noDavid E. O'Brien2001-05-021-1/+1
| | | | | | | | | | | longer includes machine/elf.h. * consumers of elf.h now use the minimalist elf header possible. This change is motivated by Binutils 2.11.0 and too much clashing over our base elf headers and the Binutils elf headers. Notes: svn path=/head/; revision=76224
* Compensate for header dethreading.Mark Murray2001-05-011-0/+1
| | | | Notes: svn path=/head/; revision=76169
* MAXPATHLEN contains the trailing NUL.Warner Losh2001-03-011-1/+1
| | | | Notes: svn path=/head/; revision=73261
* Change the proc information returned from the kernel so that itKirk McKusick2000-12-121-25/+20
| | | | | | | | | | | | | | | no longer contains kernel specific data structures, but rather only scalar values and structures that are already part of the kernel/user interface, specifically rusage and rtprio. It no longer contains proc, session, pcred, ucred, procsig, vmspace, pstats, mtx, sigiolst, klist, callout, pasleep, or mdproc. If any of these changed in size, ps, w, fstat, gcore, systat, and top would all stop working. The new structure has over 200 bytes of unassigned space for future values to be added, yet is nearly 100 bytes smaller per entry than the structure that it replaced. Notes: svn path=/head/; revision=69896
* $Id$ -> $FreeBSD$Peter Wemm1999-08-281-1/+1
| | | | Notes: svn path=/head/; revision=50477
* Add braces to appease the egcs -Wall mom.John Polstra1999-07-171-2/+3
| | | | Notes: svn path=/head/; revision=48861
* Fix errors detected by -Wformat.John Polstra1998-11-011-2/+2
| | | | Notes: svn path=/head/; revision=40803
* When the "-s" option is given, try to ensure that we restart theJohn Polstra1998-10-221-12/+32
| | | | | | | target process even if we are killed or die due to an error. Notes: svn path=/head/; revision=40562
* Make gcore work for ELF.John Polstra1998-10-191-49/+53
| | | | Notes: svn path=/head/; revision=40525
* Check the executable's header to make sure it is a valid executable.John Polstra1998-10-141-1/+9
| | | | | | | | | | If it is ELF, print a diagnostic saying that it is not supported yet by this program. This is a stop-gap anti-bug-report measure because it looks like there won't be time to implement gcore's ELF support before 3.0 is released. Notes: svn path=/head/; revision=40350
* Don't require an executable file name. If no executable image isDag-Erling Smørgrav1998-09-141-8/+21
| | | | | | | | | | specified, use /proc/<pid>/file. Document it. PR: bin/7915 Suggested-By: Wolfram Schneider <wosch@panke.de.freebsd.org> Notes: svn path=/head/; revision=39164
* Check the text segment size of the executable and the process. IfWolfram Schneider1998-08-241-1/+9
| | | | | | | | | | | | | not equal, the command line arguments are wrong. E.g.: $./gcore /bin/sh 1761 $ ./gcore /usr/tmp/chroot/bin/sh 1761 gcore: The executable /usr/tmp/chroot/bin/sh does not belong to process 1761! Text segment size (in bytes): executable 303104, process 294912 Notes: svn path=/head/; revision=38522
* Add missing argument detected by "-Wformat". Make messages moreJohn Polstra1997-11-181-3/+3
| | | | | | | consistent. Notes: svn path=/head/; revision=31218
* Use err(3) instead of local redefinition.Philippe Charnier1997-07-081-48/+22
| | | | Notes: svn path=/head/; revision=27273
* compare return value from getopt against -1 rather than EOF, per the finalWarner Losh1997-03-291-1/+1
| | | | | | | posix standard on the topic. Notes: svn path=/head/; revision=24360
* General -Wall warning cleanup, part I.Jordan K. Hubbard1996-07-121-1/+2
| | | | | | | Submitted-By: Kent Vander Velden <graphix@iastate.edu> Notes: svn path=/head/; revision=17142
* NBPG -> PAGE_SIZEPoul-Henning Kamp1996-05-021-13/+13
| | | | Notes: svn path=/head/; revision=15531
* Remove trailing whitespace.Rodney W. Grimes1995-05-301-3/+3
| | | | Notes: svn path=/head/; revision=8874
* BSD 4.4 Lite Usr.bin SourcesRodney W. Grimes1994-05-271-0/+313
Notes: svn path=/cvs2svn/branches/CHRISTOS/; revision=1590