aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/subr_stats.c
Commit message (Collapse)AuthorAgeFilesLines
* Mark more nodes as CTLFLAG_MPSAFE or CTLFLAG_NEEDGIANT (17 of many)Pawel Biernacki2020-02-261-3/+4
| | | | | | | | | | | | | | | | | | | r357614 added CTLFLAG_NEEDGIANT to make it easier to find nodes that are still not MPSAFE (or already are but aren’t properly marked). Use it in preparation for a general review of all nodes. This is non-functional change that adds annotations to SYSCTL_NODE and SYSCTL_PROC nodes using one of the soon-to-be-required flags. Mark all obvious cases as MPSAFE. All entries that haven't been marked as MPSAFE before are by default marked as NEEDGIANT Approved by: kib (mentor, blanket) Commented by: kib, gallatin, melifaro Differential Revision: https://reviews.freebsd.org/D23718 Notes: svn path=/head/; revision=358333
* Remove duplicated empty lines from kern/*.cMateusz Guzik2020-01-301-1/+0
| | | | | | | No functional changes. Notes: svn path=/head/; revision=357312
* Fix use of an uninitialized variable.John Baldwin2020-01-301-3/+1
| | | | | | | | | | | | | ctx (and thus ctx.flags) is stack garbage at the start of this function, so initialize ctx.flags to an explicit value instead of using binary operations on the garbage. Reported by: gcc9 Reviewed by: imp Differential Revision: https://reviews.freebsd.org/D23368 Notes: svn path=/head/; revision=357302
* Revert accidental change from r357146.John Baldwin2020-01-261-1/+3
| | | | Notes: svn path=/head/; revision=357147
* Fix some misleading indentation warnings reported by recent clang.John Baldwin2020-01-261-3/+1
| | | | | | | | | | | | | These should not be any functional change. While the change in emul10kx-pcm.c looks like a real bug fix (as opposed to inconsistent whitespace), the extra statements were not harmful. Reviewed by: kib Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D23363 Notes: svn path=/head/; revision=357146
* random(9): Deprecate random(9), remove meaningless srandom(9)Conrad Meyer2019-12-261-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | srandom(9) is meaningless on SMP systems or any system with, say, interrupts. One could never rely on random(9) to produce a reproducible sequence of outputs on the basis of a specific srandom() seed because the global state was shared by all kernel contexts. As such, removing it is literally indistinguishable to random(9) consumers (as compared with retaining it). Mark random(9) as deprecated and slated for quick removal. This is not to say we intend to remove all fast, non-cryptographic PRNG(s) in the kernel. It/they just won't be random(9), as it exists today, in either name or implementation. Before random(9) is removed, a replacement will be provided and in-tree consumers will be converted. Note that despite the name, the random(9) interface does not bear any resemblance to random(3). Instead, it is the same crummy 1988 Park-Miller LCG used in libc rand(3). Notes: svn path=/head/; revision=356097
* libstats: Improve ABI assertion.Brooks Davis2019-11-061-1/+2
| | | | | | | | | | | | | | | | On platforms where pointers are larger than 64-bits, struct statsblob may be harmlessly padded out such that opaque[] always has some included space. Make the assertion more general by comparing to the offset of opaque rather than the size of struct statsblob. Discussed with: jhb, James Clarke Reviewed by: trasz, lstewart Obtained from: CheriBSD Sponsored by: DARPA, AFRL Differential Revision: https://reviews.freebsd.org/D22188 Notes: svn path=/head/; revision=354409
* Introduce stats(3), a flexible statistics gathering API.Edward Tomasz Napierala2019-10-071-0/+3912
This provides a framework to define a template describing a set of "variables of interest" and the intended way for the framework to maintain them (for example the maximum, sum, t-digest, or a combination thereof). Afterwards the user code feeds in the raw data, and the framework maintains these variables inside a user-provided, opaque stats blobs. The framework also provides a way to selectively extract the stats from the blobs. The stats(3) framework can be used in both userspace and the kernel. See the stats(3) manual page for details. This will be used by the upcoming TCP statistics gathering code, https://reviews.freebsd.org/D20655. The stats(3) framework is disabled by default for now, except in the NOTES kernel (for QA); it is expected to be enabled in amd64 GENERIC after a cool down period. Reviewed by: sef (earlier version) Obtained from: Netflix Relnotes: yes Sponsored by: Klara Inc, Netflix Differential Revision: https://reviews.freebsd.org/D20477 Notes: svn path=/head/; revision=353283