From: Sexton, Rory Date: Tue, 5 Jun 2018 08:43:05 +0000 (+0100) Subject: Extending turbostat plugin to report the following platform metrics: X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=7f709d3ff337e5fdc5fc5f53ebfcbe6050215046;p=collectd.git Extending turbostat plugin to report the following platform metrics: - P-states enabled/disabled - Turboboost enabled/disabled - Platform TDP (Thermal Design Point) - Uncore bus ratio --- diff --git a/src/turbostat.c b/src/turbostat.c index ad58097d..ac8c9fb4 100644 --- a/src/turbostat.c +++ b/src/turbostat.c @@ -425,15 +425,15 @@ get_counters(struct thread_data *t, struct core_data *c, struct pkg_data *p) { READ_MSR(MSR_IA32_PACKAGE_THERM_STATUS, &msr); p->pkg_temp_c = p->tcc_activation_temp - ((msr >> 16) & 0x7F); } - if (do_power_fields && TURBO_PLATFORM) { + if (do_power_fields & TURBO_PLATFORM) { READ_MSR(MSR_IA32_MISC_ENABLE, &msr); p->turbo_enabled = !((msr >> 38) & 0x1); } - if (do_power_fields && PSTATES_PLATFORM) { + if (do_power_fields & PSTATES_PLATFORM) { READ_MSR(MSR_IA32_MISC_ENABLE, &msr); p->pstates_enabled = (msr >> 16) & 0x1; } - if (do_power_fields && UFS_PLATFORM) { + if (do_power_fields & UFS_PLATFORM) { READ_MSR(MSR_UNCORE_FREQ_SCALING, &msr); p->uncore = msr & 0x1F; } @@ -673,13 +673,13 @@ static int submit_counters(struct thread_data *t, struct core_data *c, p->energy_dram * rapl_energy_units / interval_float); } - if (do_power_fields && TURBO_PLATFORM) { + if (do_power_fields & TURBO_PLATFORM) { turbostat_submit(name, "turbo_enabled", NULL, p->turbo_enabled); } - if (do_power_fields && PSTATES_PLATFORM) { + if (do_power_fields & PSTATES_PLATFORM) { turbostat_submit(name, "pstates_enabled", NULL, p->pstates_enabled); } - if (do_power_fields && UFS_PLATFORM) { + if (do_power_fields & UFS_PLATFORM) { turbostat_submit(name, "uncore_ratio", NULL, p->uncore); } turbostat_submit(name, "temperature", "tcc_activation",