summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e774e5b)
raw | patch | inline | side by side (parent: e774e5b)
author | Vincent Brillault <git@lerya.net> | |
Sat, 23 Aug 2014 14:32:29 +0000 (16:32 +0200) | ||
committer | Vincent Brillault <git@lerya.net> | |
Sat, 28 Feb 2015 06:35:41 +0000 (07:35 +0100) |
src/turbostat.c | patch | blob | history |
diff --git a/src/turbostat.c b/src/turbostat.c
index 0f84a991f3692ab43b1ca4e0da9afb9cca2309bf..1588e65b0173354e230c557291660dc3980a5ecf 100644 (file)
--- a/src/turbostat.c
+++ b/src/turbostat.c
#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
/* 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;
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;
}