X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fturbostat.c;h=73a6769be44a80a75786fa8b99fdddefe0e4e39e;hb=be126043c2be20399d7670fe194645292018bde0;hp=62bd92b13bda49efbdc83b702866fc0b164a6385;hpb=14d94fb83e1e9487dc46415b4334e7217b9175e9;p=collectd.git diff --git a/src/turbostat.c b/src/turbostat.c index 62bd92b1..73a6769b 100644 --- a/src/turbostat.c +++ b/src/turbostat.c @@ -266,7 +266,7 @@ open_msr(unsigned int cpu, _Bool multiple_read) { } } - ssnprintf(pathname, sizeof(pathname), "/dev/cpu/%d/msr", cpu); + snprintf(pathname, sizeof(pathname), "/dev/cpu/%d/msr", cpu); fd = open(pathname, O_RDONLY); if (fd < 0) { ERROR("turbostat plugin: failed to open %s", pathname); @@ -556,7 +556,7 @@ static int submit_counters(struct thread_data *t, struct core_data *c, DEBUG("turbostat plugin: submit stats for cpu: %d, core: %d, pkg: %d", t->cpu_id, c->core_id, p->package_id); - ssnprintf(name, sizeof(name), "cpu%02d", t->cpu_id); + snprintf(name, sizeof(name), "cpu%02d", t->cpu_id); if (!aperf_mperf_unstable) turbostat_submit(name, "percent", "c0", 100.0 * t->mperf / t->tsc); @@ -585,7 +585,7 @@ static int submit_counters(struct thread_data *t, struct core_data *c, /* If not using logical core numbering, set core id */ if (!config_lcn) { - ssnprintf(name, sizeof(name), "core%02d", c->core_id); + snprintf(name, sizeof(name), "core%02d", c->core_id); } if (do_core_cstate & (1 << 3)) @@ -602,7 +602,7 @@ static int submit_counters(struct thread_data *t, struct core_data *c, if (!(t->flags & CPU_IS_FIRST_CORE_IN_PACKAGE)) goto done; - ssnprintf(name, sizeof(name), "pkg%02d", p->package_id); + snprintf(name, sizeof(name), "pkg%02d", p->package_id); if (do_ptm) turbostat_submit(name, "temperature", NULL, p->pkg_temp_c); @@ -1064,7 +1064,7 @@ static int get_threads_on_core(unsigned int cpu) { int matches; char character; - ssnprintf(path, sizeof(path), + snprintf(path, sizeof(path), "/sys/devices/system/cpu/cpu%d/topology/thread_siblings_list", cpu); filep = fopen(path, "r"); if (!filep) { @@ -1118,7 +1118,7 @@ for_all_proc_cpus(int(func)(unsigned int)) { retval = func(cpu_num); if (retval) { fclose(fp); - return (retval); + return retval; } } fclose(fp);