Go to main content

man pages section 9: DDI and DKI Kernel Functions

Exit Print View

Updated: Wednesday, July 27, 2022
 
 

kstat2_hist_add_value (9F)

Name

kstat2_hist_add_value - create and initialize a new kstat whose data represents a histogram

Synopsis

#include <sys/types.h>
#include <sys/kstat2.h>

void kstat2_hist_add_value(kstat2_t *ksp2, uint64_t value);

Interface Level

Solaris DDI specific (Solaris DDI)

Parameters

ksp2

A kstat created by kstat2_create_histogram() function. For more information, see kstat2_create_histogram(9F)

value

The value to be added to the histogram.

Description

kstat2_hist_add_value() function is used to add data to a histogram kstat.

The function first determines the bucket into which the supplied value will go. If the bucket already exists, its value is incremented by 1. If the bucket does not exist it is created along with any earlier buckets required from the histogram's range_min.

Return Values

No value is returned.

Context

The kstat2_hist_add_value() function can be called from user or kernel context.

See Also

kstat2_create_histogram(9F), kstat2_hold_bykid(9F), kstat2_rele(9F)

Notes

In order to minimize latency, the kstat2_hist_add_value() function does not attempt to obtain the lock of the passed-in kstat. If kstat is deleted by another thread while a thread is in kstat2_hist_add_value() function, the caller must lock the kstat using the kstat2_hold_bykid() function prior to calling the kstat2_hist_add_value() function, and release it with the kstat2_rele() function later.