Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions plugins/in_node_exporter_metrics/ne_cpu_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ static int cpu_thermal_update(struct flb_ne *ctx, uint64_t ts)
entry = mk_list_entry(head, struct flb_slist_entry, _head);

/* Core ID */
ret = ne_utils_file_read_uint64(ctx->path_sysfs,
ret = ne_utils_file_read_uint64(ctx, ctx->path_sysfs,
entry->str,
"topology", "core_id",
&core_id);
Expand All @@ -121,7 +121,7 @@ static int cpu_thermal_update(struct flb_ne *ctx, uint64_t ts)
}

/* Physical ID */
ret = ne_utils_file_read_uint64(ctx->path_sysfs,
ret = ne_utils_file_read_uint64(ctx, ctx->path_sysfs,
entry->str,
"topology", "physical_package_id",
&physical_package_id);
Expand All @@ -130,7 +130,7 @@ static int cpu_thermal_update(struct flb_ne *ctx, uint64_t ts)
}

/* Package Metric: node_cpu_core_throttles_total */
ret = ne_utils_file_read_uint64(ctx->path_sysfs,
ret = ne_utils_file_read_uint64(ctx, ctx->path_sysfs,
entry->str,
"thermal_throttle", "core_throttle_count",
&core_throttle_count);
Expand All @@ -150,7 +150,7 @@ static int cpu_thermal_update(struct flb_ne *ctx, uint64_t ts)
}

/* Package Metric: node_cpu_package_throttles_total */
ret = ne_utils_file_read_uint64(ctx->path_sysfs,
ret = ne_utils_file_read_uint64(ctx, ctx->path_sysfs,
entry->str,
"thermal_throttle", "package_throttle_count",
&package_throttle_count);
Expand Down Expand Up @@ -307,7 +307,7 @@ static int cpu_stat_update(struct flb_ne *ctx, uint64_t ts)
struct flb_slist_entry *line;
struct cpu_stat_info st = {0};

ret = ne_utils_file_read_lines(ctx->path_procfs, "/stat", &list);
ret = ne_utils_file_read_lines(ctx, ctx->path_procfs, "/stat", &list);
if (ret == -1) {
return -1;
}
Expand Down
12 changes: 6 additions & 6 deletions plugins/in_node_exporter_metrics/ne_cpufreq_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ static int cpufreq_update(struct flb_ne *ctx)
cpu_id++;

/* node_cpu_frequency_hertz */
ret = ne_utils_file_read_uint64(ctx->path_sysfs,
ret = ne_utils_file_read_uint64(ctx, ctx->path_sysfs,
entry->str, "cpufreq", "cpuinfo_cur_freq",
&val);
if (ret == 0) {
Expand All @@ -128,7 +128,7 @@ static int cpufreq_update(struct flb_ne *ctx)
}

/* node_cpu_frequency_max_hertz */
ret = ne_utils_file_read_uint64(ctx->path_sysfs,
ret = ne_utils_file_read_uint64(ctx, ctx->path_sysfs,
entry->str, "cpufreq", "cpuinfo_max_freq",
&val);
if (ret == 0) {
Expand All @@ -138,7 +138,7 @@ static int cpufreq_update(struct flb_ne *ctx)
}

/* node_cpu_frequency_min_hertz */
ret = ne_utils_file_read_uint64(ctx->path_sysfs,
ret = ne_utils_file_read_uint64(ctx, ctx->path_sysfs,
entry->str, "cpufreq", "cpuinfo_min_freq",
&val);
if (ret == 0) {
Expand All @@ -149,7 +149,7 @@ static int cpufreq_update(struct flb_ne *ctx)


/* node_cpu_scaling_frequency_hertz */
ret = ne_utils_file_read_uint64(ctx->path_sysfs,
ret = ne_utils_file_read_uint64(ctx, ctx->path_sysfs,
entry->str, "cpufreq", "scaling_cur_freq",
&val);
if (ret == 0) {
Expand All @@ -159,7 +159,7 @@ static int cpufreq_update(struct flb_ne *ctx)
}

/* node_cpu_scaling_frequency_max_hertz */
ret = ne_utils_file_read_uint64(ctx->path_sysfs,
ret = ne_utils_file_read_uint64(ctx, ctx->path_sysfs,
entry->str, "cpufreq", "scaling_max_freq",
&val);
if (ret == 0) {
Expand All @@ -169,7 +169,7 @@ static int cpufreq_update(struct flb_ne *ctx)
}

/* node_cpu_frequency_min_hertz */
ret = ne_utils_file_read_uint64(ctx->path_sysfs,
ret = ne_utils_file_read_uint64(ctx, ctx->path_sysfs,
entry->str, "cpufreq", "scaling_min_freq",
&val);
if (ret == 0) {
Expand Down
2 changes: 1 addition & 1 deletion plugins/in_node_exporter_metrics/ne_diskstats_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@ static int diskstats_update(struct flb_ne *ctx)
mk_list_init(&list);
mk_list_init(&split_list);

ret = ne_utils_file_read_lines(ctx->path_procfs, "/diskstats", &list);
ret = ne_utils_file_read_lines(ctx, ctx->path_procfs, "/diskstats", &list);
if (ret == -1) {
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/in_node_exporter_metrics/ne_filefd_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ static int filefd_update(struct flb_ne *ctx)
struct flb_slist_entry *max;

mk_list_init(&list);
ret = ne_utils_file_read_lines(ctx->path_procfs, "/sys/fs/file-nr", &list);
ret = ne_utils_file_read_lines(ctx, ctx->path_procfs, "/sys/fs/file-nr", &list);
if (ret == -1) {
return -1;
}
Expand Down
10 changes: 5 additions & 5 deletions plugins/in_node_exporter_metrics/ne_hwmon_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,14 +185,14 @@ static void hwmon_process_sensor(struct flb_ne *ctx, const char *chip_path,
}

/* read input value */
ret = ne_utils_file_read_uint64(ctx->path_sysfs, sensor_path,
ret = ne_utils_file_read_uint64(ctx, ctx->path_sysfs, sensor_path,
NULL, NULL, &val);
if (ret != 0) {
return;
}

snprintf(label_name, sizeof(label_name) - 1, "%s_label", sensor_name);
if (ne_utils_file_read_sds(ctx->path_sysfs, chip_path,
if (ne_utils_file_read_sds(ctx, ctx->path_sysfs, chip_path,
label_name, NULL, &label) == 0) {
sensor_label = label;
}
Expand All @@ -206,15 +206,15 @@ static void hwmon_process_sensor(struct flb_ne *ctx, const char *chip_path,
2, (char *[]) {(char *) chip_name, (char *) sensor_label});

snprintf(file_tmp, sizeof(file_tmp) - 1, "%s_max", sensor_name);
if (ne_utils_file_read_uint64(ctx->path_sysfs, chip_path,
if (ne_utils_file_read_uint64(ctx, ctx->path_sysfs, chip_path,
file_tmp, NULL, &val) == 0) {
cmt_gauge_set(ctx->hwmon_temp_max_celsius, tstamp,
((double) val) / 1000.0,
2, (char *[]) {(char *) chip_name, (char *) sensor_label});
}

snprintf(file_tmp, sizeof(file_tmp) - 1, "%s_crit", sensor_name);
if (ne_utils_file_read_uint64(ctx->path_sysfs, chip_path,
if (ne_utils_file_read_uint64(ctx, ctx->path_sysfs, chip_path,
file_tmp, NULL, &val) == 0) {
cmt_gauge_set(ctx->hwmon_temp_crit_celsius, tstamp,
((double) val) / 1000.0,
Expand Down Expand Up @@ -269,7 +269,7 @@ static int ne_hwmon_update(struct flb_input_instance *ins,
mk_list_foreach(head, &hwmons) {
entry = mk_list_entry(head, struct flb_slist_entry, _head);

if (ne_utils_file_read_sds(ctx->path_sysfs, entry->str,
if (ne_utils_file_read_sds(ctx, ctx->path_sysfs, entry->str,
"name", NULL, &chip) != 0) {
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/in_node_exporter_metrics/ne_loadavg_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ static int loadavg_update(struct flb_ne *ctx)
mk_list_init(&list);
mk_list_init(&split_list);

ret = ne_utils_file_read_lines(ctx->path_procfs, "/loadavg", &list);
ret = ne_utils_file_read_lines(ctx, ctx->path_procfs, "/loadavg", &list);
if (ret == -1) {
return -1;
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/in_node_exporter_metrics/ne_meminfo_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ static int meminfo_configure(struct flb_ne *ctx)
mk_list_init(&list);
mk_list_init(&split_list);

ret = ne_utils_file_read_lines(ctx->path_procfs, "/meminfo", &list);
ret = ne_utils_file_read_lines(ctx, ctx->path_procfs, "/meminfo", &list);
if (ret == -1) {
return -1;
}
Expand Down Expand Up @@ -206,7 +206,7 @@ static int meminfo_update(struct flb_ne *ctx)
struct flb_slist_entry *entry;

mk_list_init(&list);
ret = ne_utils_file_read_lines(ctx->path_procfs, "/meminfo", &list);
ret = ne_utils_file_read_lines(ctx, ctx->path_procfs, "/meminfo", &list);
if (ret == -1) {
return -1;
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/in_node_exporter_metrics/ne_netdev_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static int netdev_configure(struct flb_ne *ctx)
mk_list_init(&rx_list);
mk_list_init(&tx_list);

ret = ne_utils_file_read_lines(ctx->path_procfs, "/net/dev", &list);
ret = ne_utils_file_read_lines(ctx, ctx->path_procfs, "/net/dev", &list);
if (ret == -1) {
return -1;
}
Expand Down Expand Up @@ -236,7 +236,7 @@ static int netdev_update(struct flb_ne *ctx)
mk_list_init(&rx_list);
mk_list_init(&tx_list);

ret = ne_utils_file_read_lines(ctx->path_procfs, "/net/dev", &list);
ret = ne_utils_file_read_lines(ctx, ctx->path_procfs, "/net/dev", &list);
if (ret == -1) {
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/in_node_exporter_metrics/ne_netstat_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ static int netstat_update(struct flb_ne *ctx)
int prev_proto;

mk_list_init(&list);
ret = ne_utils_file_read_lines(ctx->path_procfs, "/net/snmp", &list);
ret = ne_utils_file_read_lines(ctx, ctx->path_procfs, "/net/snmp", &list);
if (ret == -1) {
return -1;
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/in_node_exporter_metrics/ne_nvme_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ static int nvme_get_entry_value(struct flb_ne *ctx,
if (check_path_for_sysfs(ctx, nvme_info->str, entry_path) != 0) {
return -1;
}
ret = ne_utils_file_read_lines(nvme_info->str, nvme_sysentry, out_info_list);
ret = ne_utils_file_read_lines(ctx, nvme_info->str, nvme_sysentry, out_info_list);
if (ret == -1) {
return ret;
}
Expand Down
8 changes: 4 additions & 4 deletions plugins/in_node_exporter_metrics/ne_processes_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ static int processes_thread_update(struct flb_ne *ctx, flb_sds_t pid_str, flb_sd
}

mk_list_init(&stat_list);
ret = ne_utils_file_read_lines(thread->str, "/stat", &stat_list);
ret = ne_utils_file_read_lines(ctx,thread->str, "/stat", &stat_list);
if (ret == -1) {
continue;
}
Expand Down Expand Up @@ -271,7 +271,7 @@ static int processes_update(struct flb_ne *ctx)

ts = cfl_time_now();

ret = ne_utils_file_read_uint64(ctx->path_procfs, "/sys", "kernel", "threads-max", &val);
ret = ne_utils_file_read_uint64(ctx, ctx->path_procfs, "/sys", "kernel", "threads-max", &val);
if (ret == -1) {
return -1;
}
Expand All @@ -282,7 +282,7 @@ static int processes_update(struct flb_ne *ctx)
(double)val, 0, NULL);
}

ret = ne_utils_file_read_uint64(ctx->path_procfs, "/sys", "kernel", "pid_max", &val);
ret = ne_utils_file_read_uint64(ctx, ctx->path_procfs, "/sys", "kernel", "pid_max", &val);
if (ret == -1) {
return -1;
}
Expand Down Expand Up @@ -313,7 +313,7 @@ static int processes_update(struct flb_ne *ctx)
}

mk_list_init(&stat_list);
ret = ne_utils_file_read_lines(process->str, "/stat", &stat_list);
ret = ne_utils_file_read_lines(ctx,process->str, "/stat", &stat_list);
if (ret == -1) {
continue;
}
Expand Down
4 changes: 2 additions & 2 deletions plugins/in_node_exporter_metrics/ne_sockstat_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ static int sockstat_update(struct flb_ne *ctx)
struct stat st;

mk_list_init(&list);
ret = ne_utils_file_read_lines(ctx->path_procfs, "/net/sockstat", &list);
ret = ne_utils_file_read_lines(ctx, ctx->path_procfs, "/net/sockstat", &list);
if (ret == -1) {
return -1;
}
Expand Down Expand Up @@ -313,7 +313,7 @@ static int sockstat_update(struct flb_ne *ctx)
return 0;
}
mk_list_init(&list);
ret = ne_utils_file_read_lines(ctx->path_procfs, "/net/sockstat6", &list);
ret = ne_utils_file_read_lines(ctx, ctx->path_procfs, "/net/sockstat6", &list);
if (ret != -1) {
mk_list_foreach(head, &list) {
line = mk_list_entry(head, struct flb_slist_entry, _head);
Expand Down
2 changes: 1 addition & 1 deletion plugins/in_node_exporter_metrics/ne_stat_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ static int stat_update(struct flb_ne *ctx)
struct flb_slist_entry *s_val;

mk_list_init(&list);
ret = ne_utils_file_read_lines(ctx->path_procfs, "/stat", &list);
ret = ne_utils_file_read_lines(ctx, ctx->path_procfs, "/stat", &list);
if (ret == -1) {
flb_plg_error(ctx->ins, "failed to read %s/stat", ctx->path_procfs);
return -1;
Expand Down
10 changes: 5 additions & 5 deletions plugins/in_node_exporter_metrics/ne_thermalzone_linux.c
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,15 @@ static int ne_thermalzone_update_thermal_zones(struct flb_ne *ctx)
entry = mk_list_entry(head, struct flb_slist_entry, _head);

/* Core ID */
ret = ne_utils_file_read_uint64(ctx->path_sysfs,
ret = ne_utils_file_read_uint64(ctx, ctx->path_sysfs,
entry->str,
"temp", NULL,
&temp);
if (ret != 0) {
continue;
}

ret = ne_utils_file_read_sds(ctx->path_sysfs, entry->str, "type", NULL, &type);
ret = ne_utils_file_read_sds(ctx, ctx->path_sysfs, entry->str, "type", NULL, &type);
if (ret != 0) {
flb_plg_error(ctx->ins, "unable to get type for zone: %s", entry->str);
continue;
Expand Down Expand Up @@ -206,23 +206,23 @@ static int ne_thermalzone_update_cooling_devices(struct flb_ne *ctx)
entry = mk_list_entry(head, struct flb_slist_entry, _head);

/* Core ID */
ret = ne_utils_file_read_uint64(ctx->path_sysfs,
ret = ne_utils_file_read_uint64(ctx, ctx->path_sysfs,
entry->str,
"cur_state", NULL,
&cur_state);
if (ret != 0) {
continue;
}

ret = ne_utils_file_read_uint64(ctx->path_sysfs,
ret = ne_utils_file_read_uint64(ctx, ctx->path_sysfs,
entry->str,
"max_state", NULL,
&max_state);
if (ret != 0) {
continue;
}

ret = ne_utils_file_read_sds(ctx->path_sysfs, entry->str, "type", NULL, &type);
ret = ne_utils_file_read_sds(ctx, ctx->path_sysfs, entry->str, "type", NULL, &type);
if (ret != 0) {
flb_plg_error(ctx->ins, "unable to get type for zone: %s", entry->str);
continue;
Expand Down
Loading
Loading