NAME
tuneinfo — retrieve detailed information about kernel tunable parameters
SYNOPSIS
#include <sys/dyntune.h>
int tuneinfo(const char *tunable,
tuneinfo_t *buf,
size_t size,
int count);
DESCRIPTION
This function provides detailed information about one or all kernel tunable
parameters. If a particular parameter is of interest, specify it by name in
tunable.
Otherwise, set
tunable
to
NULL
and information will be returned on all kernel tunable parameters (up to
the size of the supplied buffer).
Information about the selected tunable parameters is returned in
tuneinfo_t
structures.
buf
must specify an address in the caller's space containing space for
count
structures. The size of a
tuneinfo_t
structure, as understood by the caller, should be passed in the
size
parameter.
Each
tuneinfo_t
structure describes a single tunable parameter, and contains at least
the following fields, in unspecified order:
- char ti_name[TUNENAMELEN];
The name of the tunable parameter.
NULL-terminated
ASCII string.
- char ti_desc[TUNEDESCLEN];
An English description of the parameter.
NULL-terminated
ASCII string.
- char ti_mod[TUNEMODLEN];
The name of the DLKM module in which the parameter is defined.
NULL-terminated
ASCII string. This will be a null string for those parameters defined
in the core kernel.
- uint64_t ti_current;
The current value of the parameter.
- uint64_t ti_bootvalue;
The boot-time value of the parameter (compiled into the kernel).
- uint64_t ti_default;
The HP-supplied default value of the parameter.
- uint64_t ti_min;
The minimum value of the parameter. Valid only if the
TIF_MINVALID
flag is set in the
ti_flags
word, below.
- uint64_t ti_max;
The maximum value of the parameter. Valid only if the
TIF_MAXVALID
flag is set in the
ti_flags
word, below.
Note:
The minimum and maximum values returned here are relatively static limits.
They will reflect the limitations of the operating system software, and any
limitations placed on this tunable parameter by the current values of other
tunable parameters. However, they do not reflect any restrictions on the
tunable value based on transient factors like the current usage pattern of
the system.
For example, the maximum value returned for
maxfiles
(the number of files a process may have open) will be no greater than the
current value of
nfile
(the number of files the system may have open). However, the minimum value
returned for
maxfiles
may very well be less than the number of files that some existing process
has open.
- unsigned ti_flags;
A bitmask of zero or more of the following flags:
- TIF_CANSET
The value of this parameter can be changed using
settune().
- TIF_DYNAMIC
The value of this parameter can be changed using
settune(),
without requiring a reboot.
- TIF_SIGNED
The values, minima and maxima, for this parameter should be interpreted
as signed quantities.
- TIF_MINVALID
The
ti_minimum
field contains a minimum allowed value for this parameter.
- TIF_MAXVALID
The
ti_maximum
field contains a maximum allowed value for this parameter.
RETURN VALUE
If
tuneinfo()
is successful, it returns the number of tunable parameters for which
information is available. (This number may exceed the supplied
count
parameter if the supplied buffer is too small to hold all tunable
information.) If the function is not successful, it returns -1.
ERRORS
If this function returns -1 to indicate an error, the global variable
errno
will be set to one of the following values, to indicate the error that
occurred:
- [ENOENT]
The specified tunable parameter does not exist.
- [EFAULT]
tunable
or
buf
contains an address that is inaccessible.
- [EIO]
The Kernel Registry Service was unavailable or encountered an error.
- [EINVAL]
The
size
of a
tuneinfo_t
structure is incorrect.
EXAMPLES
/* To get information about a specific tunable parameter: */
tuneinfo_t info;
int ret;
ret = tuneinfo(swapmem_on, &info, sizeof(info), 1);
if (ret < 0) ...
/* To get information about all tunable parameters: */
tuneinfo_t *all;
int num_tunes;
int ret;
num_tunes = tuneinfo(NULL, NULL, sizeof(tuneinfo_t), 0);
if (num_tunes < 0) ...
all = (tuneinfo_t *)malloc(num_tunes * sizeof(tuneinfo_t));
ret = tuneinfo(NULL, all, sizeof(tuneinfo_t), num_tunes);
if (ret < 0) ...
AUTHOR
tuneinfo()
was developed by Hewlett-Packard Company.