projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge branch 'collectd-5.4' into collectd-5.5
[collectd.git]
/
src
/
cpufreq.c
diff --git
a/src/cpufreq.c
b/src/cpufreq.c
index
74e542b
..
b92b1d0
100644
(file)
--- a/
src/cpufreq.c
+++ b/
src/cpufreq.c
@@
-37,7
+37,7
@@
static int cpufreq_init (void)
while (1)
{
while (1)
{
- status = snprintf (filename, sizeof (filename),
+ status = s
s
nprintf (filename, sizeof (filename),
"/sys/devices/system/cpu/cpu%d/cpufreq/"
"scaling_cur_freq", num_cpu);
if ((status < 1) || ((unsigned int)status >= sizeof (filename)))
"/sys/devices/system/cpu/cpu%d/cpufreq/"
"scaling_cur_freq", num_cpu);
if ((status < 1) || ((unsigned int)status >= sizeof (filename)))
@@
-67,13
+67,13
@@
static void cpufreq_submit (int cpu_num, double value)
vl.values = values;
vl.values_len = 1;
vl.values = values;
vl.values_len = 1;
- vl.time = time (NULL);
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "cpufreq", sizeof (vl.plugin));
sstrncpy (vl.host, hostname_g, sizeof (vl.host));
sstrncpy (vl.plugin, "cpufreq", sizeof (vl.plugin));
- snprintf (vl.type_instance, sizeof (vl.type_instance),
+ sstrncpy (vl.type, "cpufreq", sizeof (vl.type));
+ ssnprintf (vl.type_instance, sizeof (vl.type_instance),
"%i", cpu_num);
"%i", cpu_num);
- plugin_dispatch_values (
"cpufreq",
&vl);
+ plugin_dispatch_values (&vl);
}
static int cpufreq_read (void)
}
static int cpufreq_read (void)
@@
-87,7
+87,7
@@
static int cpufreq_read (void)
for (i = 0; i < num_cpu; i++)
{
for (i = 0; i < num_cpu; i++)
{
- status = snprintf (filename, sizeof (filename),
+ status = s
s
nprintf (filename, sizeof (filename),
"/sys/devices/system/cpu/cpu%d/cpufreq/"
"scaling_cur_freq", i);
if ((status < 1) || ((unsigned int)status >= sizeof (filename)))
"/sys/devices/system/cpu/cpu%d/cpufreq/"
"scaling_cur_freq", i);
if ((status < 1) || ((unsigned int)status >= sizeof (filename)))