From: Vincent Brillault Date: Sat, 23 Aug 2014 15:34:52 +0000 (+0200) Subject: Turbostat: move set_temperature_target to setup_all_buffers X-Git-Tag: collectd-5.5.0~24^2~51 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=e649c400fcf323e85b207eac57ed41acf9684a90 Turbostat: move set_temperature_target to setup_all_buffers setup_all_buffers can be called after a free_all_buffers, which would remove the tcc_activation_temp --- diff --git a/src/turbostat.c b/src/turbostat.c index 55d1179b..41b95e2d 100644 --- a/src/turbostat.c +++ b/src/turbostat.c @@ -1462,6 +1462,8 @@ static int setup_all_buffers(void) DO_OR_GOTO_ERR(allocate_counters(&thread_odd, &core_odd, &package_odd)); DO_OR_GOTO_ERR(allocate_counters(&thread_delta, &core_delta, &package_delta)); DO_OR_GOTO_ERR(for_all_proc_cpus(initialize_counters)); + DO_OR_GOTO_ERR(for_all_cpus(set_temperature_target, EVEN_COUNTERS)); + DO_OR_GOTO_ERR(for_all_cpus(set_temperature_target, ODD_COUNTERS)); allocated = 1; return 0; @@ -1479,8 +1481,6 @@ turbostat_init(void) DO_OR_GOTO_ERR(probe_cpu()); DO_OR_GOTO_ERR(check_dev_msr()); DO_OR_GOTO_ERR(setup_all_buffers()); - DO_OR_GOTO_ERR(for_all_cpus(set_temperature_target, EVEN_COUNTERS)); - DO_OR_GOTO_ERR(for_all_cpus(set_temperature_target, ODD_COUNTERS)); plugin_register_complex_read(NULL, PLUGIN_NAME, turbostat_read, NULL, NULL);