From: Vincent Brillault Date: Sat, 23 Aug 2014 14:32:29 +0000 (+0200) Subject: Turbostat: remove proc_stat global variable X-Git-Tag: collectd-5.5.0~24^2~54 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=8a4a61985b6b7e5e507843805cf4b5e965d9f5ed;p=collectd.git Turbostat: remove proc_stat global variable --- diff --git a/src/turbostat.c b/src/turbostat.c index 0f84a991..1588e65b 100644 --- a/src/turbostat.c +++ b/src/turbostat.c @@ -60,8 +60,6 @@ #define PLUGIN_NAME "turbostat" -static const char *proc_stat = "/proc/stat"; - /* * If set, aperf_mperf_unstable disables a/mperf based stats. * This includes: C0 & C1 states, frequency @@ -107,8 +105,6 @@ static double rapl_energy_units; /* 0x642 MSR_PP1_POLICY */ #define TJMAX_DEFAULT 100 -int backwards_count; - cpu_set_t *cpu_present_set, *cpu_affinity_set, *cpu_saved_affinity_set; size_t cpu_present_setsize, cpu_affinity_setsize, cpu_saved_affinity_setsize; @@ -720,15 +716,15 @@ for_all_proc_cpus(int (func)(int)) int cpu_num; int retval; - fp = fopen(proc_stat, "r"); + fp = fopen("/proc/stat", "r"); if (!fp) { - ERROR("%s: open failed", proc_stat); + ERROR("Failed to open /proc/stat"); return -ERR_CANT_OPEN_FILE; } retval = fscanf(fp, "cpu %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d\n"); if (retval != 0) { - ERROR("%s: failed to parse format", proc_stat); + ERROR("Failed to parse /proc/stat"); return -ERR_CANT_READ_PROC_STAT; }