From: Pavel Rochnyack Date: Sat, 20 Oct 2018 12:11:47 +0000 (+0700) Subject: cpufreq: Review p-state transitions metric X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=aa74d25e11b340861806826e0db8fb9860ee109a;p=collectd.git cpufreq: Review p-state transitions metric --- diff --git a/src/cpufreq.c b/src/cpufreq.c index 18e79d44..679d81e7 100644 --- a/src/cpufreq.c +++ b/src/cpufreq.c @@ -31,7 +31,6 @@ static int num_cpu; 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. */ @@ -62,17 +61,6 @@ static int counter_init(void) { 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; @@ -152,9 +140,7 @@ static int cpufreq_read(void) { 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); } /* diff --git a/src/types.db b/src/types.db index e9de64fc..0370b7f0 100644 --- a/src/types.db +++ b/src/types.db @@ -260,7 +260,6 @@ total_threads value:DERIVE:0:U 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