struct thread_data {
value_to_rate_state_t time_state[MAX_AVAIL_FREQS];
- long long transition_prev;
} * t_data;
/* Flags denoting capability of reporting stats. */
num_cpu);
if ((status < 1) || ((unsigned int)status >= sizeof(filename)))
report_total_trans = 0;
-
- /* Initialize total transitions for cpu frequency */
- if (report_total_trans) {
- value_t v;
- snprintf(filename, sizeof(filename),
- "/sys/devices/system/cpu/cpu%d/cpufreq/stats/total_trans", i);
- if (parse_value_file(filename, &v, DS_TYPE_COUNTER) != 0) {
- WARNING("cpufreq plugin: Reading \"%s\" failed.", filename);
- continue;
- }
- t_data[i].transition_prev = v.counter;
}
}
return 0;
WARNING("cpufreq plugin: Reading \"%s\" failed.", filename);
continue;
}
- counter_t c = counter_diff(t_data[i].transition_prev, v.counter);
- t_data[i].transition_prev = v.counter;
- cpufreq_submit(i, "transitions", NULL, &(value_t){.counter = c});
+ cpufreq_submit(i, "counter", "transitions", &v);
}
/*
total_time_in_ms value:DERIVE:0:U
total_values value:DERIVE:0:U
turbo_enabled value:GAUGE:0:1
-transitions value:DERIVE:0:U
uptime value:GAUGE:0:4294967295
uncore_ratio value:GAUGE:0:U
users value:GAUGE:0:65535