aboutsummaryrefslogtreecommitdiff
path: root/sys/sys/sysctl.h
Commit message (Collapse)AuthorAgeFilesLines
* Implement the following macros for completeness:Pawel Jakub Dawidek2008-07-211-0/+9
| | | | | | | | | | | | SYSCTL_QUAD() SYSCTL_ADD_QUAD() TUNABLE_QUAD() TUNABLE_QUAD_FETCH() Now we can use 64bit tunables on 32bit systems. Notes: svn path=/head/; revision=180661
* - Make SCHED_STATS more generic by adding a wrapper to create theJeff Roberson2008-04-171-0/+1
| | | | | | | | | | | | | | | | | | | | | variables and sysctl nodes. - In reset walk the children of kern_sched_stats and reset the counters via the oid_arg1 pointer. This allows us to add arbitrary counters to the tree and still reset them properly. - Define a set of switch types to be passed with flags to mi_switch(). These types are named SWT_*. These types correspond to SCHED_STATS counters and are automatically handled in this way. - Make the new SWT_ types more specific than the older switch stats. There are now stats for idle switches, remote idle wakeups, remote preemption ithreads idling, etc. - Add switch statistics for ULE's pickcpu algorithm. These stats include how much migration there is, how often affinity was successful, how often threads were migrated to the local cpu on wakeup, etc. Sponsored by: Nokia Notes: svn path=/head/; revision=178272
* - Restore runq to manipulating threads directly by putting runq links andJeff Roberson2008-03-201-0/+1
| | | | | | | | | | | | | | rqindex back in struct thread. - Compile kern_switch.c independently again and stop #include'ing it from schedulers. - Remove the ts_thread backpointers and convert most code to go from struct thread to struct td_sched. - Cleanup the ts_flags #define garbage that was causing us to sometimes do things that expanded to td->td_sched->ts_thread->td_flags in 4BSD. - Export the kern.sched sysctl node in sysctl.h Notes: svn path=/head/; revision=177435
* Add very basic support for the kernel to export a list of features. EachJohn Baldwin2007-12-311-0/+8
| | | | | | | | | | | | | | | feature is represented by a node in the new 'kern.features' sysctl node. A feature is present if the corresponding node is present and evaluates to true. A FEATURE() wrapper macro is added which takes the sysctl node name and a description of the feature as the sole arguments and creates a read-only sysctl node with a value of 1. Discussed on: arch Notes: svn path=/head/; revision=175019
* Add another new sysctl in support of the forthcoming procstat(1) toRobert Watson2007-12-021-0/+1
| | | | | | | | | | | | | | | | | support its -k argument: kern.proc.kstack - dump the kernel stack of a process, if debugging is permitted. This sysctl is present if either "options DDB" or "options STACK" is compiled into the kernel. Having support for tracing the kernel stacks of processes from user space makes it much easier to debug (or understand) specific wmesg's while avoiding the need to enter DDB in order to determine the path by which a process came to be blocked on a particular wait channel or lock. Notes: svn path=/head/; revision=174197
* Add two new sysctls in support of the forthcoming procstat(1) to supportRobert Watson2007-12-021-0/+3
| | | | | | | | | | | | | | | | | | | its -f and -v arguments: kern.proc.filedesc - dump file descriptor information for a process, if debugging is permitted, including socket addresses, open flags, file offsets, file paths, etc. kern.proc.vmmap - dump virtual memory mapping information for a process, if debugging is permitted, including layout and information on underlying objects, such as the type of object and path. These provide a superset of the information historically available through the now-deprecated procfs(4), and are intended to be exported in an ABI-robust form. Notes: svn path=/head/; revision=174167
* Add sysctl_rename_oid() to support device_set_unit() usage. Otherwise,Peter Wemm2007-11-301-0/+1
| | | | | | | | when unit numbers are changed, the sysctl devinfo tree gets out of sync and duplicate trees are attempted to be attached with the original name. Notes: svn path=/head/; revision=174113
* Rescue hw.machine_arch in CTL_HW_NAMES.Ruslan Ermilov2007-10-161-0/+1
| | | | Notes: svn path=/head/; revision=172702
* Backout sensors framework.Alexander Leidinger2007-10-151-4/+1
| | | | | | | | Requested by: phk Discussed on: cvs-all Notes: svn path=/head/; revision=172674
* Import OpenBSD's sysctl hardware sensors framework.Alexander Leidinger2007-10-141-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit includes the following core components: * sample configuration file for sensorsd * rc(8) script and glue code for sensorsd(8) * sysctl(3) doc fixes for CTL_HW tree * sysctl(3) documentation for hardware sensors * sysctl(8) documentation for hardware sensors * support for the sensor structure for sysctl(8) * rc.conf(5) documentation for starting sensorsd(8) * sensor_attach(9) et al documentation * /sys/kern/kern_sensors.c o sensor_attach(9) API for drivers to register ksensors o sensor_task_register(9) API for the update task o sysctl(3) glue code o hw.sensors shadow tree for sysctl(8) internal magic * <sys/sensors.h> * HW_SENSORS definition for <sys/sysctl.h> * sensors display for systat(1), including documentation * sensorsd(8) and all applicable documentation The userland part of the framework is entirely source-code compatible with OpenBSD 4.1, 4.2 and -current as of today. All sensor readings can be viewed with `sysctl hw.sensors`, monitored in semi-realtime with `systat -sensors` and also logged with `sensorsd`. Submitted by: Constantine A. Murenin <cnst@FreeBSD.org> Sponsored by: Google Summer of Code 2007 (GSoC2007/cnst-sensors) Mentored by: syrinx Tested by: many OKed by: kensmith Obtained from: OpenBSD (parts) Notes: svn path=/head/; revision=172631
* Add a function for exporting 64 bit types.David Malone2007-06-041-0/+1
| | | | Notes: svn path=/head/; revision=170288
* Add kern.arnd sysctl. SSP code uses it to initialize the stack guardAlexander Kabaev2007-05-191-1/+2
| | | | | | | | | magic value. Submitted by: Jeremie Le Hen <jeremie@le-hen.org> Notes: svn path=/head/; revision=169727
* Add kern.hostuuid sysctl, which will be used to keep host's UUID.Pawel Jakub Dawidek2007-04-091-1/+3
| | | | | | | Reviewed by: mlaier, rink, brooks, rwatson Notes: svn path=/head/; revision=168545
* Declare security and security.bsd sysctl hierarchies in sysctl.h alongRobert Watson2006-09-171-0/+2
| | | | | | | | | | | with other commonly used sysctl name spaces, rather than declaring them all over the place. MFC after: 1 month Sponsored by: nCircle Network Security, Inc. Notes: svn path=/head/; revision=162383
* Add _vm_stats and _vm_stats_misc to the sysctl declarations in sysctl.h andAlan Cox2006-08-211-0/+2
| | | | | | | eliminate their declarations from various source files. Notes: svn path=/head/; revision=161492
* Add an extension to the UINT & ULONG types. The XINT & XLONG types behaveDavid E. O'Brien2006-08-121-0/+16
| | | | | | | the same, except sysctl(8) will print out the values in hex. Notes: svn path=/head/; revision=161256
* Add new kernel config option. NO_SYSCTL_DESCR to omit the descriptions forWarner Losh2006-07-181-12/+18
| | | | | | | | | | | | the sysctls. This saves a lot of space in the resulting kernel which is important for embedded systems. This change was done in a ABI compatible way. The pointer is still there, it just points to an empty string instead of the description. MFC After: 3 days Notes: svn path=/head/; revision=160469
* Move some functions and definitions from uipc_socket2.c to uipc_socket.c:Robert Watson2006-06-101-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | - Move sonewconn(), which creates new sockets for incoming connections on listen sockets, so that all socket allocate code is together in uipc_socket.c. - Move 'maxsockets' and associated sysctls to uipc_socket.c with the socket allocation code. - Move kern.ipc sysctl node to uipc_socket.c, add a SYSCTL_DECL() for it to sysctl.h and remove lots of scattered implementations in various IPC modules. - Sort sodealloc() after soalloc() in uipc_socket.c for dependency order reasons. Statisticize soalloc() and sodealloc() as they are now required only in uipc_socket.c, and are internal to the socket implementation. After this change, socket allocation and deallocation is entirely centralized in one file, and uipc_socket2.c consists entirely of socket buffer manipulation and default protocol switch functions. MFC after: 1 month Notes: svn path=/head/; revision=159481
* Declare regression subtree in sysctl.h so that components outside ofRobert Watson2006-03-261-0/+1
| | | | | | | | | kern_mib.c can easily add regression sysctls. MFC after: 1 month Notes: svn path=/head/; revision=157157
* Make sysctl_msec_to_ticks(SYSCTL_HANDLER_ARGS) generally available insteadAndre Oppermann2006-02-161-0/+1
| | | | | | | | | | of being private to tcp_timer.c. Sponsored by: TCP/IP Optimization Fundraise 2005 MFC after: 3 days Notes: svn path=/head/; revision=155758
* Add a sysctl that returns the full path of a process' text file.David Schultz2005-04-181-0/+1
| | | | | | | | This information is needed by things like `gdb -p' and Sun's javac, and previously it could only be obtained via procfs Notes: svn path=/head/; revision=145216
* Move implementation of hw.bus.rman sysctl to subr_rman.c so thatPoul-Henning Kamp2005-03-241-0/+1
| | | | | | | | | subr_bus.c doesn't need to peek inside struct resource. OK from: imp Notes: svn path=/head/; revision=144071
* Add a sysctl that records the amount of physical memory in the machine.Wes Peters2005-02-281-1/+3
| | | | | | | | Submitted by: Nicko Dehaine <nicko@stbernard.com> MFC after: 1 day Notes: svn path=/head/; revision=142834
* Add a missing prefix to a struct field for consistency.Poul-Henning Kamp2005-02-071-1/+1
| | | | Notes: svn path=/head/; revision=141433
* /* -> /*- for license, minor formatting changesWarner Losh2005-01-071-1/+1
| | | | Notes: svn path=/head/; revision=139825
* Put on my peril sensitive sunglasses and add a flags field to the internalPeter Wemm2004-10-111-3/+9
| | | | | | | | | | | | | | | | | | | sysctl routines and state. Add some code to use it for signalling the need to downconvert a data structure to 32 bits on a 64 bit OS when requested by a 32 bit app. I tried to do this in a generic abi wrapper that intercepted the sysctl oid's, or looked up the format string etc, but it was a real can of worms that turned into a fragile mess before I even got it partially working. With this, we can now run 'sysctl -a' on a 32 bit sysctl binary and have it not abort. Things like netstat, ps, etc have a long way to go. This also fixes a bug in the kern.ps_strings and kern.usrstack hacks. These do matter very much because they are used by libc_r and other things. Notes: svn path=/head/; revision=136404
* Introduce SYSCTL_CHILDREN_SET macro which can be used in place ofAlexander Kabaev2004-07-281-0/+2
| | | | | | | cast as a value. Notes: svn path=/head/; revision=132784
* Define a KERN_PROC_GID option for kvm_getprocs().Garance A Drosehn2004-06-191-1/+2
| | | | | | | Submitted by: Cyrille Lefevre Notes: svn path=/head/; revision=130725
* Do the dreaded s/dev_t/struct cdev */Poul-Henning Kamp2004-06-161-1/+1
| | | | | | | Bump __FreeBSD_version accordingly. Notes: svn path=/head/; revision=130585
* Define a KERN_PROC_RGID option for kvm_getprocs().Garance A Drosehn2004-05-221-0/+1
| | | | | | | Submitted by: Cyrille Lefevre Notes: svn path=/head/; revision=129597
* Remove advertising clause from University of California Regent's license,Warner Losh2004-04-071-4/+0
| | | | | | | | | per letter dated July 22, 1999. Approved by: core Notes: svn path=/head/; revision=127976
* Rename the wiredlen member of struct sysctl_req to validlen and alwaysDon Lewis2004-03-161-1/+1
| | | | | | | | | | | | | | | set it to avoid the need for a bunch of code that tests whether or not the lock member is set to REQ_WIRED in order to determine which length member should be used. Fix another bug in the oldlen return value code. Fix a potential wired memory leak if a sysctl handler uses sysctl_wire_old_buffer() and returns an EAGAIN error to trigger a retry. Notes: svn path=/head/; revision=127052
* Add sysctl_move_oid() which reparents an existing OID.Dag-Erling Smørgrav2004-02-271-0/+2
| | | | Notes: svn path=/head/; revision=126319
* Bump CTL_MAXNAME from 12 to 24.Dag-Erling Smørgrav2004-02-261-1/+1
| | | | Notes: svn path=/head/; revision=126293
* Split the mlock() kernel code into two parts, mlock(), which unpacksDon Lewis2004-02-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the syscall arguments and does the suser() permission check, and kern_mlock(), which does the resource limit checking and calls vm_map_wire(). Split munlock() in a similar way. Enable the RLIMIT_MEMLOCK checking code in kern_mlock(). Replace calls to vslock() and vsunlock() in the sysctl code with calls to kern_mlock() and kern_munlock() so that the sysctl code will obey the wired memory limits. Nuke the vslock() and vsunlock() implementations, which are no longer used. Add a member to struct sysctl_req to track the amount of memory that is wired to handle the request. Modify sysctl_wire_old_buffer() to return an error if its call to kern_mlock() fails. Only wire the minimum of the length specified in the sysctl request and the length specified in its argument list. It is recommended that sysctl handlers that use sysctl_wire_old_buffer() should specify reasonable estimates for the amount of data they want to return so that only the minimum amount of memory is wired no matter what length has been specified by the request. Modify the callers of sysctl_wire_old_buffer() to look for the error return. Modify sysctl_old_user to obey the wired buffer length and clean up its implementation. Reviewed by: bms Notes: svn path=/head/; revision=126253
* Add sysctls to allow showing threads for pgrp, tty, uid, ruid,Daniel Eischen2004-02-221-0/+4
| | | | | | | and pid. Notes: svn path=/head/; revision=126125
* Fix a typo in a comment: sysctl(1) should be sysctl(8).Tom Rhodes2003-11-141-1/+1
| | | | Notes: svn path=/head/; revision=122707
* Add another sysctl flag, CTLFLAG_TUN, which is a hint to the userlandMike Silbersack2003-10-211-0/+2
| | | | | | | | | | | sysctl that a given variable is tunable. Also added is CTLFLAG_RDTUN, which is CTLFLAG_RD|CTLFLAG_TUN; TUN does not always imply read-only, so RDTUN should be used where RD was used before. Notes: svn path=/head/; revision=121305
* Remove magic numbers surrounding locking state in the sysctl module, andBruce M Simpson2003-10-051-1/+6
| | | | | | | replace them with more meaningful defines. Notes: svn path=/head/; revision=120781
* Replace 'OS release date' with 'kernel release date' here, too.Eivind Eklund2003-08-211-1/+1
| | | | | | | Reminded by: ru Notes: svn path=/head/; revision=119212
* Make the system call vector name of a process accessible to userRobert Drehmel2003-07-121-0/+1
| | | | | | | | land applications by introducing the KERN_PROC_SV_NAME sysctl node, which is searchable by PID. Notes: svn path=/head/; revision=117464
* Add KERN_PROC_PROC for returning only processes, not threads.Scott Long2003-06-121-0/+1
| | | | Notes: svn path=/head/; revision=116261
* Attempt to fix Alpha build by renaming ident[] to kern_ident[].Juli Mallett2003-06-091-1/+1
| | | | Notes: svn path=/head/; revision=116105
* Expose kern.ident by way of OID_AUTO.Juli Mallett2003-06-091-3/+1
| | | | | | | Requested by: phk Notes: svn path=/head/; revision=116090
* Make kernel identification (`ident' in the config(8) driver) available toJuli Mallett2003-06-091-1/+4
| | | | | | | | | | | | userland, and the kernel. In the kernel by way of the 'ident[]' variable akin to all the other stuff generated by newvers.sh. In userland it is available to sysctl consumers via KERN_IDENT or 'kern.ident'. It is exported by uname(1) by the -i flag. Reviewed by: hackers@ Notes: svn path=/head/; revision=116085
* Sysctl treats `long' and `unsigned long' differently - fix a comment.Robert Drehmel2003-03-281-1/+1
| | | | Notes: svn path=/head/; revision=112744
* Introduce the ability to flag a sysctl for operation at secure level 2 or 3Matthew Dillon2003-01-141-0/+11
| | | | | | | | | | | | | | | in addition to secure level 1. The mask supports up to a secure level of 8 but only add defines through CTLFLAG_SECURE3 for now. As per the missif in the log entry for 1.11 of ip_fw2.c which added the secure flag to the IPFW sysctl's in the first place, change the secure level requirement from 1 to 3 now that we have support for it. Reviewed by: imp With Design Suggestions by: imp Notes: svn path=/head/; revision=109246
* Use a separate macro to generate the name of the sysctl_oid_list that holdsJake Burkholder2003-01-041-2/+5
| | | | | | | | | | the children of a sysctl node, so that the arguments to the SYSCTL_NODE macro can themselves be macros. It would be nice to use __CONCAT throughout this file, but the macros are so large that it quickly becomes unweildly, (4 nested __CONCATs). Notes: svn path=/head/; revision=108649
* Always put the "access" macro argument in (), it might be an expression.Poul-Henning Kamp2002-10-201-18/+18
| | | | | | | This is a purely stylistic change. Notes: svn path=/head/; revision=105582
* Remove unneeded <sys/_posix.h> include.Mike Barcroft2002-10-071-1/+0
| | | | Notes: svn path=/head/; revision=104624