History log of /src/lib/libprocstat/libprocstat.c (Results 1 – 25 of 435)
Revision Date Author Comments
# 11cbb7d1 28-Aug-2025 Olivier Certner <olce@FreeBSD.org>

libprocstat: procstat_getgroups_kvm(): Output again the effective GID

In particular, fixes 'procstat -s -M' (for processes with more than 16
groups).

Reviewed by: kib
Fixes: be1f7435ef2

libprocstat: procstat_getgroups_kvm(): Output again the effective GID

In particular, fixes 'procstat -s -M' (for processes with more than 16
groups).

Reviewed by: kib
Fixes: be1f7435ef218b1d ("kern: start tracking cr_gid outside of cr_groups[]")
MFC after: 5 days
MFC to: stable/15
Sponsored by: The FreeBSD Foundation
Differential Revision: https://reviews.freebsd.org/D52275

show more ...


# 567e6250 17-Aug-2025 Dag-Erling Smørgrav <des@FreeBSD.org>

vfs: Introduce VN_ISDEV() macro

We frequently need to check if a vnode refers to either a character or
block special, so we might as well have a macro for it.

We somewhat less frequently need to pe

vfs: Introduce VN_ISDEV() macro

We frequently need to check if a vnode refers to either a character or
block special, so we might as well have a macro for it.

We somewhat less frequently need to perform similar checks on things
that aren't vnodes (usually a struct vattr *), so add VATTR_ISDEV()
and a generic VTYPE_ISDEV() as well.

Sponsored by: Klara, Inc.
Sponsored by: NetApp, Inc.
Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D51947

show more ...


# 79102e10 09-Jun-2025 Mark Johnston <markj@FreeBSD.org>

libprocstat: Add handling for inotify descriptors

MFC after: 3 months
Sponsored by: Klara, Inc.


# 1c3d6532 13-Mar-2025 Konstantin Belousov <kib@FreeBSD.org>

libprocstat: add knowledge about NT_PROCSTAT_KQUEUES core file section

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D4

libprocstat: add knowledge about NT_PROCSTAT_KQUEUES core file section

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D49372

show more ...


# bf46aec4 24-Feb-2025 Konstantin Belousov <kib@FreeBSD.org>

libprocstat: add helper to query knotes for specific kqueue

Reviewed by: markj
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D49163


# fe5a6266 03-Feb-2025 Gleb Smirnoff <glebius@FreeBSD.org>

protosw: this is a kernel only header, put back #ifdef _KERNEL

The uncommented #ifdef _KERNEL originates from 1997 by wollman@ (see
57bf258e3dc9e) with no clear original reason. Since these old tim

protosw: this is a kernel only header, put back #ifdef _KERNEL

The uncommented #ifdef _KERNEL originates from 1997 by wollman@ (see
57bf258e3dc9e) with no clear original reason. Since these old times two
abusers of the header leak were created - libprocstat(3) and netstat(1).
These two already have a lot of _WANT_FOO hacks, so satisfy them with
_WANT_PROTOSW.

While here, cleanup and sort forward declaraions.

show more ...


# 6126f4ea 22-Sep-2024 Konstantin Belousov <kib@FreeBSD.org>

libprocstat: add procstat_getrlimitusage()

Reviewed by: markj, olce
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D46747


# 1a8d1764 29-Mar-2024 Gleb Smirnoff <glebius@FreeBSD.org>

inpcb: fully retire inp_ppcb pointer

Before a protocol specific control block started to embed inpcb in self
(see 0aa120d52f3c, e68b3792440c, 483fe96511ec) this pointer used to point
at it.

Retain

inpcb: fully retire inp_ppcb pointer

Before a protocol specific control block started to embed inpcb in self
(see 0aa120d52f3c, e68b3792440c, 483fe96511ec) this pointer used to point
at it.

Retain kf_sock_inpcb field in the struct kinfo_file in <sys/user.h>. The
exp-run detected a minimal use of the field in ports:
* sysutils/lsof - patched upstream
* net-mgmt/netdata - patch accepted upstream
* emulators/qemu-user-static - upstream master branch seems not using
the field anymore
We can keep the field around for some time, but eventually it may be
reused for something else.

PR: 277659 (exp-run)
Reviewed by: tuexen
Differential Revision: https://reviews.freebsd.org/D44491

show more ...


# a2f733ab 24-Nov-2023 Warner Losh <imp@FreeBSD.org>

lib: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remov

lib: Automated cleanup of cdefs and other formatting

Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+<sys/cdefs.h>.*\n/
Remove /\n+#include\s+<sys/cdefs.h>.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/types.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/param.h>/
Remove /\n+#include\s+<sys/cdefs.h>\n#include\s+<sys/capsicum.h>/

Sponsored by: Netflix

show more ...


# 248fe3d3 16-Oct-2023 Brooks Davis <brooks@FreeBSD.org>

libprocstat: improve conditional for 32-bit compat

Include support for translating 32-bit auxv vectors on non-64-bit
platforms that aren't riscv (which has no 32-bit ABI support and
probably never w

libprocstat: improve conditional for 32-bit compat

Include support for translating 32-bit auxv vectors on non-64-bit
platforms that aren't riscv (which has no 32-bit ABI support and
probably never will).

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42201

show more ...


# 8f06fabe 16-Oct-2023 Brooks Davis <brooks@FreeBSD.org>

libprocstat: copy all the 32-bit auxv entries

Use source struct size not the destination struct size so we copy all
the auxv entries, not just the first half of them.

Fix a style issue on an adjace

libprocstat: copy all the 32-bit auxv entries

Use source struct size not the destination struct size so we copy all
the auxv entries, not just the first half of them.

Fix a style issue on an adjacent line.

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42200

show more ...


# 72a4ee26 16-Oct-2023 Brooks Davis <brooks@FreeBSD.org>

libprocstat: make sv_name not static

Making this variable static makes is_elf32_sysctl() and callers thread
unsafe.

Use a less absurd length for sv_name. The longest name in the system is
"FreeBSD

libprocstat: make sv_name not static

Making this variable static makes is_elf32_sysctl() and callers thread
unsafe.

Use a less absurd length for sv_name. The longest name in the system is
"FreeBSD ELF64 V2" which tips the scales at 16+1 bytes. We'll almost
certainly have other problems if we exceed 32 characters.

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42199

show more ...


# 9735cc0e 16-Oct-2023 Brooks Davis <brooks@FreeBSD.org>

libprocstat: simplify auxv value conversion

Avoid a weird dance through the union and treat all 32-bit values as
unsigned integers. This avoids sign extension of flags and userspace
pointers.

Revi

libprocstat: simplify auxv value conversion

Avoid a weird dance through the union and treat all 32-bit values as
unsigned integers. This avoids sign extension of flags and userspace
pointers.

Reviewed by: markj
Sponsored by: DARPA
Differential Revision: https://reviews.freebsd.org/D42198

show more ...


# ccac440f 02-Oct-2023 Brooks Davis <brooks@FreeBSD.org>

libprocstat: style: space after switch

Style demands a space after the switch keyword.

Noticed reviewing code in CheriBSD that propagated the style bug.

Reported by: markj
Sponsored by: DARPA
Revi

libprocstat: style: space after switch

Style demands a space after the switch keyword.

Noticed reviewing code in CheriBSD that propagated the style bug.

Reported by: markj
Sponsored by: DARPA
Reviewed by: kib, markj
Differential Revision: https://reviews.freebsd.org/D42041

show more ...


# 1d386b48 16-Aug-2023 Warner Losh <imp@FreeBSD.org>

Remove $FreeBSD$: one-line .c pattern

Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/


# 039d1496 03-Apr-2022 Konstantin Belousov <kib@FreeBSD.org>

libprocstat: add procstat_getadvlock(3)

For now, only for sysctl target. This is not a new situation, for
instance kstacks also work for sysctl only.

Reviewed by: markj, rmacklem
Sponsored by: The

libprocstat: add procstat_getadvlock(3)

For now, only for sysctl target. This is not a new situation, for
instance kstacks also work for sysctl only.

Reviewed by: markj, rmacklem
Sponsored by: The FreeBSD Foundation
MFC after: 1 week
Differential revision: https://reviews.freebsd.org/D34756

show more ...


# 7a9423d6 02-Dec-2021 Konstantin Belousov <kib@FreeBSD.org>

procstat_getfiles_sysctl: do not require non-null ki_fd

ki_fd is legitimately NULL when 32bit process requests process data
from 64bit host kernel. The field is not used by the code for sysctl
case

procstat_getfiles_sysctl: do not require non-null ki_fd

ki_fd is legitimately NULL when 32bit process requests process data
from 64bit host kernel. The field is not used by the code for sysctl
case; procstat_getfiles_kvm() checks ki_fd.

PR: 260174
Reported by: Damjan Jovanovic <damjan.jov@gmail.com>
Sponsored by: The FreeBSD Foundation
MFC after: 1 week

show more ...


# 0ea3e4a2 02-Dec-2021 Konstantin Belousov <kib@FreeBSD.org>

Style

Sponsored by: The FreeBSD Foundation
MFC after: 1 week


# 427f12f1 27-May-2021 Eric van Gyzen <vangyzen@FreeBSD.org>

libprocstat kstack: fix race with thread creation

When collecting kernel stacks for a target process, if the process
adds a thread between the two calls to sysctl, ignore the additional
threads. Pr

libprocstat kstack: fix race with thread creation

When collecting kernel stacks for a target process, if the process
adds a thread between the two calls to sysctl, ignore the additional
threads. Previously, procstat would print only a useless error
message. Now, it prints a consistent snapshot of the stacks.
We know that snapshot is already stale, but it could still be stale
even with a more complex fix to reallocate and retry, so such a fix
is hardly worth the effort.

Reported by: Daniel.Mitchell@emc.com
MFC after: 1 week
Sponsored by: Dell EMC Isilon

show more ...


# d485c77f 18-Feb-2021 Konstantin Belousov <kib@FreeBSD.org>

Remove #define _KERNEL hacks from libprocstat

Make sys/buf.h, sys/pipe.h, sys/fs/devfs/devfs*.h headers usable in
userspace, assuming that the consumer has an idea what it is for.
Unhide more materi

Remove #define _KERNEL hacks from libprocstat

Make sys/buf.h, sys/pipe.h, sys/fs/devfs/devfs*.h headers usable in
userspace, assuming that the consumer has an idea what it is for.
Unhide more material from sys/mount.h and sys/ufs/ufs/inode.h,
sys/ufs/ufs/ufsmount.h for consumption of userspace tools, with the
same caveat.

Remove unacceptable hack from usr.sbin/makefs which relied on sys/buf.h
being unusable in userspace, where it override struct buf with its own
definition. Instead, provide struct m_buf and struct m_vnode and adapt
code to use local variants.

Reviewed by: mckusick
Tested by: pho
Sponsored by: The FreeBSD Foundation
Differential revision: https://reviews.freebsd.org/D28679

show more ...


# 67af9aba 23-Dec-2020 Konstantin Belousov <kib@FreeBSD.org>

Decode and report native eventfd descriptors from libprocstat and procstat.

Submitted by: greg@unrelenting.technology
Reviewed by: markj (previous version)
MFC after: 2 weeks
Differential

Decode and report native eventfd descriptors from libprocstat and procstat.

Submitted by: greg@unrelenting.technology
Reviewed by: markj (previous version)
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D26668

show more ...


# 688f8b82 25-Nov-2020 John Baldwin <jhb@FreeBSD.org>

Remove the cloned file descriptors for /dev/crypto.

Crypto file descriptors were added in the original OCF import as a way
to provide per-open data (specifically the list of symmetric
sessions). Ho

Remove the cloned file descriptors for /dev/crypto.

Crypto file descriptors were added in the original OCF import as a way
to provide per-open data (specifically the list of symmetric
sessions). However, this gives a bit of a confusing API where one has
to open /dev/crypto and then invoke an ioctl to obtain a second file
descriptor. This also does not match the API used with /dev/crypto on
other BSDs or with Linux's /dev/crypto driver.

Character devices have gained support for per-open data via cdevpriv
since OCF was imported, so use cdevpriv to simplify the userland API
by permitting ioctls directly on /dev/crypto descriptors.

To provide backwards compatibility, CRIOGET now opens another
/dev/crypto descriptor via kern_openat() rather than dup'ing the
existing file descriptor. This preserves prior semantics in case
CRIOGET is invoked multiple times on a single file descriptor.

Reviewed by: markj
Relnotes: yes
Sponsored by: Chelsio Communications
Differential Revision: https://reviews.freebsd.org/D27302

show more ...


# 85078b85 17-Nov-2020 Conrad Meyer <cem@FreeBSD.org>

Split out cwd/root/jail, cmask state from filedesc table

No functional change intended.

Tracking these structures separately for each proc enables future work to
correctly emulate clone(2) in linux

Split out cwd/root/jail, cmask state from filedesc table

No functional change intended.

Tracking these structures separately for each proc enables future work to
correctly emulate clone(2) in linux(4).

__FreeBSD_version is bumped (to 1300130) for consumption by, e.g., lsof.

Reviewed by: kib
Discussed with: markj, mjg
Differential Revision: https://reviews.freebsd.org/D27037

show more ...


# e2515283 27-Aug-2020 Glen Barber <gjb@FreeBSD.org>

MFH

Sponsored by: Rubicon Communications, LLC (netgate.com)


# 9e5787d2 25-Aug-2020 Matt Macy <mmacy@FreeBSD.org>

Merge OpenZFS support in to HEAD.

The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.

I would a

Merge OpenZFS support in to HEAD.

The primary benefit is maintaining a completely shared
code base with the community allowing FreeBSD to receive
new features sooner and with less effort.

I would advise against doing 'zpool upgrade'
or creating indispensable pools using new
features until this change has had a month+
to soak.

Work on merging FreeBSD support in to what was
at the time "ZFS on Linux" began in August 2018.
I first publicly proposed transitioning FreeBSD
to (new) OpenZFS on December 18th, 2018. FreeBSD
support in OpenZFS was finally completed in December
2019. A CFT for downstreaming OpenZFS support in
to FreeBSD was first issued on July 8th. All issues
that were reported have been addressed or, for
a couple of less critical matters there are
pull requests in progress with OpenZFS. iXsystems
has tested and dogfooded extensively internally.
The TrueNAS 12 release is based on OpenZFS with
some additional features that have not yet made
it upstream.

Improvements include:
project quotas, encrypted datasets,
allocation classes, vectorized raidz,
vectorized checksums, various command line
improvements, zstd compression.

Thanks to those who have helped along the way:
Ryan Moeller, Allan Jude, Zack Welch, and many
others.

Sponsored by: iXsystems, Inc.
Differential Revision: https://reviews.freebsd.org/D25872

show more ...


12345678910>>...18