static void submit_hp(const char *plug_inst, const char *type,
const char *type_instance, gauge_t free_value, gauge_t used_value)
{
static void submit_hp(const char *plug_inst, const char *type,
const char *type_instance, gauge_t free_value, gauge_t used_value)
{
-
- values[0].gauge = free_value;
- values[1].gauge = used_value;
+ value_t values[] = {
+ { .gauge = free_value },
+ { .gauge = used_value },
+ };
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, g_plugin_name, sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plug_inst, sizeof (vl.plugin_instance));
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, g_plugin_name, sizeof (vl.plugin));
sstrncpy (vl.plugin_instance, plug_inst, sizeof (vl.plugin_instance));
while ((result = readdir(dir)) != NULL) {
if (strncmp(result->d_name, hugepages_dir, sizeof(hugepages_dir)-1)) {
/* not node dir */
while ((result = readdir(dir)) != NULL) {
if (strncmp(result->d_name, hugepages_dir, sizeof(hugepages_dir)-1)) {
/* not node dir */
e_info.d_name = result->d_name;
e_info.node = node;
walk_directory(path2, read_hugepage_entry, &e_info, 0);
e_info.d_name = result->d_name;
e_info.node = node;
walk_directory(path2, read_hugepage_entry, &e_info, 0);
/* Limit not defined if errno == 0, otherwise error */
if (errno != 0) {
ERROR("%s: pathconf failed", g_plugin_name);
/* Limit not defined if errno == 0, otherwise error */
if (errno != 0) {
ERROR("%s: pathconf failed", g_plugin_name);
while ((result = readdir(dir)) != NULL) {
if (strncmp(result->d_name, node_string, sizeof(node_string)-1)) {
/* not node dir */
while ((result = readdir(dir)) != NULL) {
if (strncmp(result->d_name, node_string, sizeof(node_string)-1)) {
/* not node dir */
continue;
}
ssnprintf(path, (size_t) lim, sys_node_hugepages, result->d_name);
read_syshugepages(path, result->d_name);
continue;
}
ssnprintf(path, (size_t) lim, sys_node_hugepages, result->d_name);
read_syshugepages(path, result->d_name);