aboutsummaryrefslogtreecommitdiff
path: root/lib/libprocstat
Commit message (Collapse)AuthorAgeFilesLines
...
* procstat: read lo_name instead of now removed v_tagMateusz Guzik2020-01-071-3/+3
| | | | Notes: svn path=/head/; revision=356437
* Update Makefile.depend filesSimon J. Gerraty2019-12-111-1/+0
| | | | | | | | | | | | | Update a bunch of Makefile.depend files as a result of adding Makefile.depend.options files Reviewed by: bdrewery MFC after: 1 week Sponsored by: Juniper Networks Differential Revision: https://reviews.freebsd.org/D22494 Notes: svn path=/head/; revision=355617
* Define a vm_map method for user-space for advancing from a map entryDoug Moore2019-12-081-12/+16
| | | | | | | | | | | | | | to its successor in cases where examining a map entry requires a helper like kvm_read_all. Use that method, with kvm_read_all, to fix procstat_getfiles_kvm, which tries to find the successor now without using such a helper. This addresses a problem introduced by r355491. Reviewed by: markj (previous version) Discussed with: kib Differential Revision: https://reviews.freebsd.org/D22728 Notes: svn path=/head/; revision=355538
* Fix a type error in fixing libprocstat to be compatible with vm_map changes.Doug Moore2019-12-071-1/+1
| | | | | | | | Approved by: markj Differential Revision: https://reviews.freebsd.org/D22726 Notes: svn path=/head/; revision=355502
* r355491 broke compilation of libprocstat.c. Change that code to useDoug Moore2019-12-071-2/+2
| | | | | | | | | | new methods for accessing first, next map entries. Approved by: kib Differential Revision: https://reviews.freebsd.org/D22725 Notes: svn path=/head/; revision=355501
* pkgbase: Create a FreeBSD-utilities package and make it the default oneEmmanuel Vadot2019-09-051-1/+0
| | | | | | | | | | | | | The default package use to be FreeBSD-runtime but it should only contain binaries and libs enough to boot to single user and repair the system, it is also very handy to have a package that can be tranform to a small mfsroot. So create a new package named FreeBSD-utilities and make it the default one. Also move a few binaries and lib into this package when it make sense. Reviewed by: bapt, gjb Differential Revision: https://reviews.freebsd.org/D21506 Notes: svn path=/head/; revision=351858
* Bump SPECNAMELEN to MAXNAMLEN.Konstantin Belousov2019-01-272-7/+86
| | | | | | | | | | | | | | | | | This includes the bump for cdevsw d_version. Otherwise, the impact on the ABI (not KBI) is surprisingly low. The most important affected interface is devname(3) and ttyname(3) which already correctly handle long names (and ttyname(3) should not be affected at all). Still, due to the d_version bump, I argue that the change is not MFC-able. Requested by: mmacy Reviewed by: jhb Sponsored by: The FreeBSD Foundation Differential revision: https://reviews.freebsd.org/D18932 Notes: svn path=/head/; revision=343485
* Print type designator 'D' for the KF_TYPE_DEV files.Konstantin Belousov2018-12-032-0/+6
| | | | | | | | | | No type-specific data is provided by the kernel. Sponsored by: Mellanox Technologies MFC after: 1 week Notes: svn path=/head/; revision=341448
* Do not blindly include illumos kernel headers instead of user-space.Alexander Motin2018-08-021-1/+0
| | | | | | | | It is not needed now, and I doubt it much helped at all, creating more confusions then good. Notes: svn path=/head/; revision=337160
* libprocstat: fix memory leakEric van Gyzen2018-05-281-0/+1
| | | | | | | | | | | Free the rlimits array on the happy path in procstat_getrlimit_core(). Reported by: Coverity CID: 1373328 Sponsored by: Dell EMC Notes: svn path=/head/; revision=334267
* lib: further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-268-0/+16
| | | | | | | | | | | | | | | Mainly focus on files that use BSD 2-Clause license, however the tool I was using mis-identified many licenses so this was mostly a manual - error prone - task. 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. Notes: svn path=/head/; revision=326219
* spdx: initial adoption of licensing ID tags.Pedro F. Giffuni2017-11-184-1/+9
| | | | | | | | | | | | | | | | | | | | 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. Initially, only tag files that use BSD 4-Clause "Original" license. RelNotes: yes Differential Revision: https://reviews.freebsd.org/D13133 Notes: svn path=/head/; revision=325966
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-311-1/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Make procstat(1) recognize process descriptors, so that it showsEdward Tomasz Napierala2017-10-032-0/+6
| | | | | | | | | | | | | "P" instead of "?" in "procstat -af" output. Note that there are still a few more DTYPE_* kinds we don't decode yet. Reported by: rwatson MFC after: 2 weeks Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D12426 Notes: svn path=/head/; revision=324237
* Hide struct socket and struct unpcb from the userland.Gleb Smirnoff2017-10-021-0/+2
| | | | | | | | | | | | | | | | | | | Violators may define _WANT_SOCKET and _WANT_UNPCB respectively and are not guaranteed for stability of the structures. The violators list is the the usual one: libprocstat(3) and netstat(1) internally and lsof in ports. In struct xunpcb remove the inclusion of kernel structure and add a bunch of spare fields. The xsocket already has socket not included, but add there spares as well. Embed xsockbuf into xsocket. Sort declarations in sys/socketvar.h to separate kernel only from userland available ones. PR: 221820 (exp-run) Notes: svn path=/head/; revision=324227
* libprocstat(3): fix arguments list for procstat_getargv(3) and ↵Enji Cooper2017-07-291-2/+0
| | | | | | | | | | | | | procstat_getenvv(3) Neither libcall takes a fourth argument (`char *errbuf`). PR: 217884 Submitted by: tobik MFC after: 1 month Notes: svn path=/head/; revision=321706
* libprocstat(3): fix reference (typo) to procstat_freeenvv in description forEnji Cooper2017-07-291-1/+1
| | | | | | | | | | | procstat_getargv(3) PR: 217884 MFC after: 1 month Submitted by: tobik Notes: svn path=/head/; revision=321705
* Add sys/socket.h to SYNOPSIS for libprocstat(3)Enji Cooper2017-07-291-1/+2
| | | | | | | | | | | | sys/socket.h is required for procstat_get_socket_info(3), added in r221807. MFC after: 1 month PR: 217884 Submitted by: tobik Notes: svn path=/head/; revision=321704
* Add initial documentation for procstat_freeptlwpinfo and procstat_getptlwpinfoEnji Cooper2017-06-271-1/+27
| | | | | | | | MFC after: 1 month MFC with: r316286 Notes: svn path=/head/; revision=320400
* procstat_getptlwpinfo(..): clarify the fact that KVM/SYSCTL supportEnji Cooper2017-06-271-0/+6
| | | | | | | | | | | | | | | isn't supported This will make the error message reported in bug 220023 a bit more intuitive for end-users that don't have access to the source code to decode the procstat->type argument. MFC after: 1 month MFC with: r316286 PR: 220023 Notes: svn path=/head/; revision=320399
* procstat(1): Add TCP socket send/recv buffer sizeConrad Meyer2017-05-264-8/+63
| | | | | | | | | | | Add TCP socket send and receive buffer size to procstat -f output. Reviewed by: kib, markj Sponsored by: Dell EMC Isilon Differential Revision: https://reviews.freebsd.org/D10689 Notes: svn path=/head/; revision=318969
* Commit the 64-bit inode project.Konstantin Belousov2017-05-235-12/+162
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend the ino_t, dev_t, nlink_t types to 64-bit ints. Modify struct dirent layout to add d_off, increase the size of d_fileno to 64-bits, increase the size of d_namlen to 16-bits, and change the required alignment. Increase struct statfs f_mntfromname[] and f_mntonname[] array length MNAMELEN to 1024. ABI breakage is mitigated by providing compatibility using versioned symbols, ingenious use of the existing padding in structures, and by employing other tricks. Unfortunately, not everything can be fixed, especially outside the base system. For instance, third-party APIs which pass struct stat around are broken in backward and forward incompatible ways. Kinfo sysctl MIBs ABI is changed in backward-compatible way, but there is no general mechanism to handle other sysctl MIBS which return structures where the layout has changed. It was considered that the breakage is either in the management interfaces, where we usually allow ABI slip, or is not important. Struct xvnode changed layout, no compat shims are provided. For struct xtty, dev_t tty device member was reduced to uint32_t. It was decided that keeping ABI compat in this case is more useful than reporting 64-bit dev_t, for the sake of pstat. Update note: strictly follow the instructions in UPDATING. Build and install the new kernel with COMPAT_FREEBSD11 option enabled, then reboot, and only then install new world. Credits: The 64-bit inode project, also known as ino64, started life many years ago as a project by Gleb Kurtsou (gleb). Kirk McKusick (mckusick) then picked up and updated the patch, and acted as a flag-waver. Feedback, suggestions, and discussions were carried by Ed Maste (emaste), John Baldwin (jhb), Jilles Tjoelker (jilles), and Rick Macklem (rmacklem). Kris Moore (kris) performed an initial ports investigation followed by an exp-run by Antoine Brodin (antoine). Essential and all-embracing testing was done by Peter Holm (pho). The heavy lifting of coordinating all these efforts and bringing the project to completion were done by Konstantin Belousov (kib). Sponsored by: The FreeBSD Foundation (emaste, kib) Differential revision: https://reviews.freebsd.org/D10439 Notes: svn path=/head/; revision=318736
* Reorder includes to placate MIPS build.Tycho Nightingale2017-03-301-1/+1
| | | | | | | | Reported by: markj Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316304
* Add support for capturing 'struct ptrace_lwpinfo' for signalsTycho Nightingale2017-03-305-46/+149
| | | | | | | | | | | | resulting in a process dumping core in the corefile. Also extend procstat to view select members of 'struct ptrace_lwpinfo' from the contents of the note. Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=316286
* Hide struct inpcb, struct tcpcb from the userland.Gleb Smirnoff2017-03-211-0/+1
| | | | | | | | | | | | | | | | | | | | | | | This is a painful change, but it is needed. On the one hand, we avoid modifying them, and this slows down some ideas, on the other hand we still eventually modify them and tools like netstat(1) never work on next version of FreeBSD. We maintain a ton of spares in them, and we already got some ifdef hell at the end of tcpcb. Details: - Hide struct inpcb, struct tcpcb under _KERNEL || _WANT_FOO. - Make struct xinpcb, struct xtcpcb pure API structures, not including kernel structures inpcb and tcpcb inside. Export into these structures the fields from inpcb and tcpcb that are known to be used, and put there a ton of spare space. - Make kernel and userland utilities compilable after these changes. - Bump __FreeBSD_version. Reviewed by: rrs, gnn Differential Revision: D10018 Notes: svn path=/head/; revision=315662
* Use SRCTOP-relative paths and .CURDIR with :H instead of ".." specified pathsEnji Cooper2017-01-201-11/+11
| | | | | | | | | | This implifies pathing in make/displayed output MFC after: 3 weeks Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=312489
* Use standard Versions.def for libprocstat.Konstantin Belousov2017-01-092-11/+1
| | | | | | | | | | | | This makes the versions inheritance consistent for our versioned libraries. Extracted from: ino64 Discussed with: kan Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=311781
* Use tab for indent.Konstantin Belousov2017-01-091-1/+1
| | | | | | | | | Extracted from: ino64 work by gleb Sponsored by: The FreeBSD Foundation MFC after: 1 week Notes: svn path=/head/; revision=311780
* Use nitems({mib,name}) instead of hardcoding their valueEnji Cooper2017-01-091-13/+13
| | | | | | | MFC after: 3 days Notes: svn path=/head/; revision=311715
* libprocstat: Include cd9660 headers in the same order as the kernelConrad Meyer2017-01-081-1/+1
| | | | | | | Fix userspace build after r311665. Notes: svn path=/head/; revision=311671
* When MAKEOBJDIRPREFIX points to a case-insensitive file system, theMarcel Moolenaar2016-09-241-3/+3
| | | | | | | | | | | | | | | | | build can break when different source files create the same target files (case-insensitivity speaking). This is the case for object files compiled with -fpic and shared libraries. The former uses an extension of ".So", and the latter an extension ".so". Rename shared object files from *.So to *.pico to match what NetBSD does. See also r305855 MFC after: 1 month Sponsored by: Bracket Computing Differential Revision: https://reviews.freebsd.org/D7906 Notes: svn path=/head/; revision=306297
* Fix libprocstat build after r305902.Konstantin Belousov2016-09-171-1/+8
| | | | | | | | | | | | - Use _Bool to not require userspace to include stdbool.h. - Make extattr.h usable without vnode_if.h. - Follow i_ump to get cdev pointer. Sponsored by: The FreeBSD Foundation MFC after: 2 weeks Notes: svn path=/head/; revision=305903
* First pass through library packaging.Glen Barber2016-02-041-0/+1
| | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295278
* META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.Bryan Drewery2015-11-251-1/+0
| | | | | | | | | | | This both avoids some dependencies on xinstall.host and allows bootstrapping on older releases to work due to lack of at least 'install -l' support. Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=291307
* Fix core corruption caused by race in note_procstat_vmmapConrad Meyer2015-10-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fix is spiritually similar to r287442 and was discovered thanks to the KASSERT added in that revision. NT_PROCSTAT_VMMAP output length, when packing kinfo structs, is tied to the length of filenames corresponding to vnodes in the process' vm map via vn_fullpath. As vnodes may move during coredump, this is racy. We do not remove the race, only prevent it from causing coredump corruption. - Add a sysctl, kern.coredump_pack_vmmapinfo, to allow users to disable kinfo packing for PROCSTAT_VMMAP notes. This avoids VMMAP corruption and truncation, even if names change, at the cost of up to PATH_MAX bytes per mapped object. The new sysctl is documented in core.5. - Fix note_procstat_vmmap to self-limit in the second pass. This addresses corruption, at the cost of sometimes producing a truncated result. - Fix PROCSTAT_VMMAP consumers libutil (and libprocstat, via copy-paste) to grok the new zero padding. Reported by: pho (https://people.freebsd.org/~pho/stress/log/datamove4-2.txt) Relnotes: yes Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3824 Notes: svn path=/head/; revision=288944
* Detect badly behaved coredump note helpersConrad Meyer2015-09-031-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Coredump notes depend on being able to invoke dump routines twice; once in a dry-run mode to get the size of the note, and another to actually emit the note to the corefile. When a note helper emits a different length section the second time around than the length it requested the first time, the kernel produces a corrupt coredump. NT_PROCSTAT_FILES output length, when packing kinfo structs, is tied to the length of filenames corresponding to vnodes in the process' fd table via vn_fullpath. As vnodes may move around during dump, this is racy. So: - Detect badly behaved notes in putnote() and pad underfilled notes. - Add a fail point, debug.fail_point.fill_kinfo_vnode__random_path to exercise the NT_PROCSTAT_FILES corruption. It simply picks random lengths to expand or truncate paths to in fo_fill_kinfo_vnode(). - Add a sysctl, kern.coredump_pack_fileinfo, to allow users to disable kinfo packing for PROCSTAT_FILES notes. This should avoid both FILES note corruption and truncation, even if filenames change, at the cost of about 1 kiB in padding bloat per open fd. Document the new sysctl in core.5. - Fix note_procstat_files to self-limit in the 2nd pass. Since sometimes this will result in a short write, pad up to our advertised size. This addresses note corruption, at the risk of sometimes truncating the last several fd info entries. - Fix NT_PROCSTAT_FILES consumers libutil and libprocstat to grok the zero padding. With suggestions from: bjk, jhb, kib, wblock Approved by: markj (mentor) Relnotes: yes Sponsored by: EMC / Isilon Storage Division Differential Revision: https://reviews.freebsd.org/D3548 Notes: svn path=/head/; revision=287442
* Add META_MODE support.Simon J. Gerraty2015-06-132-0/+38
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | Off by default, build behaves normally. WITH_META_MODE we get auto objdir creation, the ability to start build from anywhere in the tree. Still need to add real targets under targets/ to build packages. Differential Revision: D2796 Reviewed by: brooks imp Notes: svn path=/head/; revision=284345
| * dirdeps.mk now sets DEP_RELDIRSimon J. Gerraty2015-06-082-4/+0
| | | | | | | | Notes: svn path=/projects/bmake/; revision=284172
| * Merge sync of headSimon J. Gerraty2015-05-273-29/+58
| |\ | | | | | | | | | Notes: svn path=/projects/bmake/; revision=283595
| * \ Merge head from 7/28Simon J. Gerraty2014-08-193-3/+3
| |\ \ | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=270164
| * | | Updated dependenciesSimon J. Gerraty2014-05-162-1/+2
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=266219
| * | | Updated dependenciesSimon J. Gerraty2014-05-101-0/+2
| | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265802
| * | | Merge from headSimon J. Gerraty2014-05-081-1/+1
| |\ \ \ | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265720
| * \ \ \ Merge headSimon J. Gerraty2014-04-272-2/+3
| |\ \ \ \ | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=265006
| * \ \ \ \ Merge head@256284Simon J. Gerraty2013-10-131-10/+14
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=256424
| * | | | | | Updated dependenciesSimon J. Gerraty2013-10-131-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=256419
| * | | | | | Merge from headSimon J. Gerraty2013-09-059-42/+2003
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=255263
| * \ \ \ \ \ \ sync from headSimon J. Gerraty2013-04-124-149/+0
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=249429
| * | | | | | | | Updated dependenciesSimon J. Gerraty2013-03-111-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=248169
| * | | | | | | | Updated dependenciesSimon J. Gerraty2013-02-162-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Notes: svn path=/projects/bmake/; revision=246868