summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6b24c5c)
raw | patch | inline | side by side (parent: 6b24c5c)
author | Vincent Brillault <git@lerya.net> | |
Sat, 23 Aug 2014 07:49:21 +0000 (09:49 +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 ff19cc4b0e6699e085a9633db883b9ad34e90946..0989b052ed1864ab63d5f3c981d2a9d6e2a891ca 100644 (file)
--- a/src/turbostat.c
+++ b/src/turbostat.c
return -ERR_CPU_MIGRATE;
}
- ssnprintf(pathname, STATIC_ARRAY_SIZE(pathname), "/dev/cpu/%d/msr", cpu);
+ ssnprintf(pathname, sizeof(pathname), "/dev/cpu/%d/msr", cpu);
fd = open(pathname, O_RDONLY);
if (fd < 0)
return -ERR_CANT_OPEN_MSR;
int matches;
char character;
- ssnprintf(path, 80, "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", cpu);
+ ssnprintf(path, sizeof(path), "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", cpu);
filep = fopen(path, "r");
if (!filep) {
ERROR("%s: open failed", path);
interval_float = tv_delta.tv_sec + tv_delta.tv_usec/1000000.0;
- snprintf(name, NAME_LEN, "cpu%02d", t->cpu_id);
+ snprintf(name, sizeof(name), "cpu%02d", t->cpu_id);
if (!skip_c0)
turbostat_submit(name, "percent", "c0", 100.0 * t->mperf/t->tsc);
if (!(t->flags & CPU_IS_FIRST_THREAD_IN_CORE))
goto done;
- snprintf(name, NAME_LEN, "core%02d", c->core_id);
+ snprintf(name, sizeof(name), "core%02d", c->core_id);
if (do_core_cstate & (1 << 3))
turbostat_submit(name, "percent", "c3", 100.0 * c->c3/t->tsc);
if (!(t->flags & CPU_IS_FIRST_CORE_IN_PACKAGE))
goto done;
- snprintf(name, NAME_LEN, "pkg%02d", p->package_id);
+ snprintf(name, sizeof(name), "pkg%02d", p->package_id);
if (do_ptm)
turbostat_submit(NULL, "temperature", name, p->pkg_temp_c);