Go to main content

man pages section 3: Library Interfaces and Headers

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

libkstat2 (3LIB)

Name

libkstat2 - kernel statistics facility, version 2

Synopsis

cc [ flag... ] file... -lkstat2 [ library... ]
     #include <kstat2.h>

Description

Functions in this library define the interface for reading kernel statistics. The <kstat2.h> header provides type and function declarations for all the libkstat2 library services.

Interfaces

The shared object libkstat2.so.1 provides the public interfaces defined below. See intro(3) man page for additional information on shared object interfaces.

kstat2_close

Closes the kstats session

kstat2_alloc_matcher_list

Allocates a new matcher list

kstat2_add_matcher

Creates a new matcher and appends it to the matcher list

kstat2_free_matcher_list

Frees the matcher list

kstat2_lookup_map

Looks up a kstat map by URI

kstat2_map_flags

Gets the maps flags

kstat2_map_get

Gets a name/value from a kstat map

kstat2_map_get_userdata

Gets the user data for a map

kstat2_map_meta

Gets the metadata for a kstat map

kstat2_map_parent

Gets the parent of a kstat map

kstat2_map_put_integer

Adds an integer value to a kstat map

kstat2_map_put_integers

Adds an integer value to a kstat map

kstat2_map_put_string

Adds a string value to a kstat map

kstat2_map_put_strings

Adds a string value to a kstat map

kstat2_map_remove

Removes a value from a kstat map

kstat2_map_set_tree_cb

Sets the tree modified callback for a map

kstat2_map_set_data_cb

Sets the data modified callback for a map

kstat2_map_set_remove_cb

Sets the map removed callback for a map

kstat2_map_set_userdata

Sets the user data for a map

kstat2_map_size

Gets the number of elements in a kstat map

kstat2_map_to_array

Gets an array containing all the map members

kstat2_map_uri

Gets the URI for a map

kstat2_mapiter_end

Finishes the use of the iterator

kstat2_mapiter_hasnext

Determines if the iterator has further values

kstat2_mapiter_next

Gets the next map value from the iterator

kstat2_mapiter_remove

Removes the current iterated value from the map

kstat2_mapiter_start

Creates a new iterator for a map

kstat2_mapref_alloc

Allocates a new map reference

kstat2_mapref_deref

Dereferences a map reference

kstat2_mapref_free

Frees a map reference

kstat2_nv_meta

Gets the metadata for a name/value

kstat2_nv_uri

Gets the URI for a name/value

kstat2_open

Opens a new kstats session and obtain a handle

kstat2_status_string

Maps a status to a descriptive string

kstat2_update

Refreshes the kstat maps

kstat2_uri_decode

Decodes any URI-unsafe characters in a string

kstat2_uri_encode

Encodes any URI-unsafe characters in a string

Files

/dev/kstat

Kernel statistics driver

/usr/include/kstat2.h

Header

/lib/libkstat2.so.1

Shared object

/lib/64/libkstat2.so.1

64-bit shared object

Examples

For more information, see the kstat2(3KSTAT2) man page.

Attributes

See attributes(7) for descriptions of the following attributes:

ATTRIBUTE TYPE
ATTRIBUTE VALUE
Availability
system/library
Interface Stability
Committed
MT-Level
MT-Safe with exceptions

See Also

kstat2_close(3KSTAT2), kstat2_alloc_matcher_list(3KSTAT2), kstat2_add_matcher(3KSTAT2), kstat2_free_matcher_list(3KSTAT2), kstat2_lookup_map(3KSTAT2), kstat2_map_get(3KSTAT2), kstat2_map_get_userdata(3KSTAT2), kstat2_map_meta(3KSTAT2), kstat2_map_parent(3KSTAT2), kstat2_map_put_integer(3KSTAT2), kstat2_map_put_integers(3KSTAT2), kstat2_map_put_string(3KSTAT2), kstat2_map_put_strings(3KSTAT2), kstat2_map_remove(3KSTAT2), kstat2_map_set_data_cb(3KSTAT2), kstat2_map_set_destroy_cb(3KSTAT2), kstat2_map_set_tree_cb(3KSTAT2), kstat2_map_set_userdata(3KSTAT2), kstat2_map_size(3KSTAT2), kstat2_map_to_array(3KSTAT2), kstat2_map_uri(3KSTAT2), kstat2_mapiter_end(3KSTAT2), kstat2_mapiter_hasnext(3KSTAT2), kstat2_mapiter_next(3KSTAT2), kstat2_mapiter_remove(3KSTAT2), kstat2_mapiter_start(3KSTAT2), kstat2_mapref_alloc(3KSTAT2), kstat2_mapref_deref(3KSTAT2), kstat2_mapref_free(3KSTAT2), kstat2_nv_meta(3KSTAT2), kstat2_open(3KSTAT2), kstat2_status_string(3KSTAT2), kstat2_update(3KSTAT2), kstat2_uri_decode(3KSTAT2), kstat2_uri_encode(3KSTAT2), kstat2(3KSTAT2)

Notes

The kstat2 functions are MT-Safe with the exception that only one thread may actively use a kstat2_handle_t, or any object obtained through it, at any one time. Synchronization is required if multiple threads intend to share a kstat2_handle_t or any object obtained through it. Synchronization is left to the application.