Commit Graph

39 Commits

Author SHA1 Message Date
Gordon Bergling
bb0358d4d7 sysctl(9): Fix a few mandoc related issues
- missing comma before name: Nm SYSCTL_UQUAD
- bad NAME section content: text

MFC after:	1 week
2020-12-19 10:31:25 +00:00
John-Mark Gurney
df94ce0f90 add Xr to device_get_sysctl(9) to make this easier to find 2020-09-01 20:42:48 +00:00
Mateusz Piotrowski
f04020edc5 Sort UMA macros and create MLINKS for them
This patch is a follow-up to r344518.

Reported by:	ngie

Reviewed by:	hselasky
Differential Revision:	https://reviews.freebsd.org/D24165
2020-03-23 14:04:42 +00:00
John Baldwin
93a0379392 Trim a spurious blank line I added in r348969.
I did not bump .Dd since there is no content change.

MFC after:	3 days
2019-08-19 17:28:12 +00:00
John Baldwin
0f70218343 Make the warning intervals for deprecated crypto algorithms tunable.
New sysctl/tunables can now set the interval (in seconds) between
rate-limited crypto warnings.  The new sysctls are:
- kern.cryptodev_warn_interval for /dev/crypto
- net.inet.ipsec.crypto_warn_interval for IPsec
- kern.kgssapi_warn_interval for KGSSAPI

Reviewed by:	cem
MFC after:	1 month
Relnotes:	yes
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D20555
2019-06-11 23:00:55 +00:00
John Baldwin
574b98cbd9 Document sysctl nodes that translate their values.
This documents the behavior of sysctl_msec_to_ticks and
SYSCTL_{ADD,}_SBINTIME_[UM]SEC.

Reviewed by:	cem
MFC after:	1 week
Sponsored by:	Chelsio Communications
Differential Revision:	https://reviews.freebsd.org/D20596
2019-06-11 22:57:25 +00:00
Eric Joyner
10a1e981d4 iflib: mark isc_driver_version as constant
From Jake:
The iflib core never modifies the isc_driver_version string. Allow
drivers to safely assign pointers to constant buffers by marking this
parameter const.

Submitted by:	Jacob Keller <jacob.e.keller@intel.com>
Reviewed by:	erj@, gallatin@, jhb@
MFC after:	1 week
Sponsored by:	Intel Corporation
Differential Revision:	https://reviews.freebsd.org/D19577
2019-03-19 23:44:26 +00:00
Mateusz Piotrowski
9a593520b5 Add missing types to the sysctl(9) manual page
Update the diff to include other missing sysctl types found in sysctl.h.

Some of these sysctls are already documented in other pages (e.g counter(9)
and ZONE(9)), but they should at least be mentioned here for completeness.

This patch now documents all of the following:
- SYSCTL_BOOL/SYSCTL_ADD_BOOL
- SYSCTL_COUNTER_U64/SYSCTL_ADD_COUNTER_U64
- SYSCTL_COUNTER_U64_ARRAY/SYSCTL_ADD_COUNTER_U64_ARRAY
- SYSCTL_SBINTIME_MSEC/SYSCTL_ADD_SBINTIME_MSEC
- SYSCTL_SBINTIME_USEC/SYSCTL_ADD_SBINTIME_USEC
- SYSCTL_UMA_CUR/SYSCTL_ADD_UMA_CUR
- SYSCTL_UMA_MAX/SYSCTL_ADD_UMA_MAX

Submitted by:	mhorne063_gmail.com
Reviewed by:	bcr, hselasky
Approved by:	bcr (doc), hselasky (src)
Approved by:	krion (mentor, implicit), mat (mentor, implicit)
Differential Revision:	https://reviews.freebsd.org/D19272
2019-02-25 15:03:50 +00:00
Jonathan T. Looney
651a790808 Update the sysctl(9) manpage to indicate that <sys/param.h> is required
instead of <sys/types.h>.  (<sys/sysctl.h> includes NULL, which is defined
with <sys/param.h> and not <sys/types.h>.)

Sponsored by:	Netflix
2018-06-01 16:47:39 +00:00
Warner Losh
d132d4ca60 Mention that CTLFLAG_MPSAFE is only for _PROC entries. 2018-03-04 06:19:41 +00:00
Warner Losh
982a973ebe Add documentation for CTLFLAG_MPSAFE. 2018-03-04 03:13:13 +00:00
Ed Maste
e312709278 sysctl.9: document CTLFLAG_CAPRD and CTLFLAG_CAPWR
Reported by:	Shawn Webb
MFC after:	1 week
Sponsored by:	The FreeBSD Foundation
2017-10-10 23:54:25 +00:00
Ed Schouten
1e1f3941e4 Add support for attaching aggregation labels to sysctl objects.
I'm currently working on writing a metrics exporter for the Prometheus
monitoring system to provide access to sysctl metrics. Prometheus and
sysctl have some structural differences:

- sysctl is a tree of string component names.
- Prometheus uses a flat namespace for its metrics, but allows you to
  attach labels with values to them, so that you can do aggregation.

An initial version of my exporter simply translated

    hw.acpi.thermal.tz1.temperature

to

    sysctl_hw_acpi_thermal_tz1_temperature_celcius

while we should ideally have

    sysctl_hw_acpi_thermal_temperature_celcius{thermal_zone="tz1"}

allowing you to graph all thermal zones on a system in one go.

The change presented in this commit adds support for accomplishing this,
by providing the ability to attach labels to nodes. In the example I
gave above, the label "thermal_zone" would be attached to "tz1". As this
is a feature that will only be used very rarely, I decided to not change
the KPI too aggressively.

Discussed on:	hackers@
Reviewed by:	cem
Differential Revision:	https://reviews.freebsd.org/D8775
2016-12-14 12:47:34 +00:00
Andriy Voskoboinyk
ba9a5309c2 sysctl.9: add missing underscore (SYSCTL_HANDLERARGS -> SYSCTL_HANDLER_ARGS) 2016-09-29 14:14:39 +00:00
Edward Tomasz Napierala
7851d429a6 Fix a bunch of "sentence not on new line" warnings in section 9.
MFC after:	1 month
2016-06-08 09:19:47 +00:00
Warren Block
7c64ddd5b0 Spelling fixes supplied by pfg@, detected with codespell, plus
additional misspellings detected by igor.

MFC after:	1 week
2016-05-01 22:00:41 +00:00
Conrad Meyer
be87839e56 Round out SYSCTL macros to the full set of fixed-width types
Add S8, S16, S32, and U32 types;  add SYSCTL*() macros for them, as well
as for the existing 64-bit types.  (While SYSCTL*QUAD and UQUAD macros
already exist, they do not take the same sort of 'val' parameter that
the other macros do.)

Clean up the documented "types" in the sysctl.9 document.  (These are
macros and thus not real types, but the manual page documents intent.)

The sysctl_add_oid(9) arg2 has been bumped from intptr_t to intmax_t to
accommodate 64-bit types on 32-bit pointer architectures.

This is just the kernel support piece; the userspace sysctl(1) support
will follow in a later patch.

Submitted by:	Ravi Pokala <rpokala@panasas.com>
Reviewed by:	cem
Relnotes:	no
Sponsored by:	Panasas
Differential Revision:	https://reviews.freebsd.org/D4091
2015-11-07 01:43:01 +00:00
Conrad Meyer
fb61390c99 sysctl(9): Document U8/U16 types from r289773
Suggested by:	ngie
Sponsored by:	EMC / Isilon Storage Division
2015-10-23 15:08:16 +00:00
Warner Losh
aa255ef6dd Teach sysctl about the new optional suffix after IK to specify
precision. Update input as well. Add IK to the manual (it was missing
completely).

Differential Revision: https://reviews.freebsd.org/D3181
2015-07-29 02:34:25 +00:00
Hans Petter Selasky
f0188618f2 Fix multiple incorrect SYSCTL arguments in the kernel:
- Wrong integer type was specified.

- Wrong or missing "access" specifier. The "access" specifier
sometimes included the SYSCTL type, which it should not, except for
procedural SYSCTL nodes.

- Logical OR where binary OR was expected.

- Properly assert the "access" argument passed to all SYSCTL macros,
using the CTASSERT macro. This applies to both static- and dynamically
created SYSCTLs.

- Properly assert the the data type for both static and dynamic
SYSCTLs. In the case of static SYSCTLs we only assert that the data
pointed to by the SYSCTL data pointer has the correct size, hence
there is no easy way to assert types in the C language outside a
C-function.

- Rewrote some code which doesn't pass a constant "access" specifier
when creating dynamic SYSCTL nodes, which is now a requirement.

- Updated "EXAMPLES" section in SYSCTL manual page.

MFC after:	3 days
Sponsored by:	Mellanox Technologies
2014-10-21 07:31:21 +00:00
Gleb Smirnoff
56538e4af9 Add a brief description of CTLFLAG_VNET flag. Since the VIMAGE is
absolutely not documented, I see no reason in long descriptions
here.
2014-09-15 11:14:23 +00:00
Joel Dahl
3edc2b5331 - Add missing "
- Sort sections
2014-09-09 14:31:56 +00:00
Hans Petter Selasky
aa88ccab1b - Spelling corrections
Suggested by:	Garrett Cooper <yaneurabeya@gmail.com>
PR:		192101
2014-08-02 18:37:08 +00:00
Hans Petter Selasky
5eb1caa8c8 - Updated SYSCTL manual pages after recent changes to the kernel
SYSCTL code. Added description of new macros and functions.
- Merged dynamic and static SYSCTL related content into a single
manual page, hence parameters and functionality is very much the same.
- Uppercased all occurrences of "OID".
- Updated all SYSCTL examples.

PR:	192101
2014-07-31 17:18:40 +00:00
John Baldwin
60a774426c - Document the UQUAD sysctl variants.
- Clarify that exactly one of the "access" flags is required and
  list the optional flags in a separate list.  Prefer bundling
  CTLFLAG_TUN into the access flag by not documenting it as an
  optional flag to set.

Approved by:	re (glebius)
MFC after:	1 week
2013-09-12 20:49:20 +00:00
Glen Barber
73bbeaa529 Typo and mdoc(7) style fixes.
PR:		168117
Submitted by:	Nobuyuki Koganemaru (kogane&jp!freebsd!org)
MFC after:	3 days
2012-05-20 16:43:47 +00:00
Andrew Thompson
6b9597aac4 Correct the description for CTLFLAG_TUN and CTLFLAG_RDTUN, the declaring of a
system tunable has never been implemented. This flag is only used by sysctl(8)
to provide a helpful error message.

Discussed with:	dwhite, kan
2012-02-29 22:41:40 +00:00
Matthew D Fleming
cbc134ad03 Introduce signed and unsigned version of CTLTYPE_QUAD, renaming
existing uses.  Rename sysctl_handle_quad() to sysctl_handle_64().
2011-01-19 23:00:25 +00:00
Matthew D Fleming
f8e4b4ef49 sysctl(8) should use the CTLTYPE to determine the type of data when
reading.  (This was already done for writing to a sysctl).  This
requires all SYSCTL setups to specify a type.  Most of them are now
checked at compile-time.

Remove SYSCTL_*X* sysctl additions as the print being in hex should be
controlled by the -x flag to sysctl(8).

Succested by:	bde
2011-01-19 17:04:07 +00:00
Gavin Atkinson
f3066f2be7 Xref sysctl(3)
Approved by:	ed (mentor)
2010-01-16 14:31:01 +00:00
Pawel Jakub Dawidek
7f41115ef6 Implement the following macros for completeness:
SYSCTL_QUAD()
	SYSCTL_ADD_QUAD()
	TUNABLE_QUAD()
	TUNABLE_QUAD_FETCH()

Now we can use 64bit tunables on 32bit systems.
2008-07-21 15:05:25 +00:00
Mike Pritchard
9280e5fac2 Spelling fixes. 2006-12-14 14:33:13 +00:00
Yaroslav Tykhiy
91f3a6db54 Add a guideline for naming new sysctl nodes.
Discussed in:	cvs-src (some time ago)
2006-11-23 14:28:19 +00:00
Ruslan Ermilov
bd84dd2f8f Revise markup. 2006-09-30 17:09:59 +00:00
David E. O'Brien
c157a036a9 Add an extension to the UINT & ULONG types. The XINT & XLONG types behave
the same, except sysctl(8) will print out the values in hex.
2006-08-12 23:33:10 +00:00
David E. O'Brien
b470b929f3 Fix bug preventing the proper displaying of the CTLFLAG_WR option. 2006-08-12 20:09:33 +00:00
Giorgos Keramidas
f4006aff16 Fix a couple of typos and other minor nits
Reviewed by:	rwatson
2006-04-28 23:21:36 +00:00
Robert Watson
8a1f412960 Fix typo.
MFC after:	1 month
Submitted by:	Antoine Brodin <antoine dot brodin@laposte dot net>
2006-04-28 19:43:44 +00:00
Robert Watson
dba9e9ccbf Add a basic man page for the sysctl(9) macro interfaces. Previously man
pages existed only for the dynamic sysctl interfaces.  There's probably
more complete and accurate content, better advice, etc, that could be added
here.

Per scottl's suggest, add a small piece of moralizing text regarding the
fact that sysctl names quickly get embedded in system configuration files,
libraries, third party applications, and even books, so renaming and
removing names after they've been published is a tricky issue.

MFC after:	1 month
2006-04-28 10:45:27 +00:00