kstat2_set_v1_names - initialize metadata for v2 kstats published as v1
#include <sys/types.h> #include <sys/kstat2.h> int kstat2_set_v1_names(kstat2_t *ksp, const char *class, const char *module, const char *name, int instance)
Solaris DDI specific (Solaris DDI)
Pointer to v2 kstat.
Null-terminated string representing the v1 kstat's class.
Null-terminated string representing the v1 kstat's module.
Null terminated string representing the v1 kstat's name. This can also be NULL.
Integer representing the driver instance.
The kstat2_set_v1_names() function is used to initialize the v1 kstat naming fields in a v2 kstat. This is used when converting an existing v1 kstat to v2 to ensure that v1 clients continue to see the same values in the kstat as they did prior to conversion.
Kstats which are new to v2 should not use this function as they do not need to be published as v1 kstats.
If the name field is NULL, it will be constructed from a concatenation of the module and instance fields as is done in kstat_create(9F) function. This functionality is provided for backward compatibility for those drivers which have traditionally supplied a NULL ks_name parameter to kstat_create(9F).
if class or module names are NULL, or if the class, module, or name fields including terminating NULL exceed KSTAT_STRLEN characters.
The kstat2_set_v1_names() function can be called from user or kernel context.