From e649c400fcf323e85b207eac57ed41acf9684a90 Mon Sep 17 00:00:00 2001 From: Vincent Brillault Date: Sat, 23 Aug 2014 17:34:52 +0200 Subject: [PATCH] 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 --- src/turbostat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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); -- 2.30.2