From: Willy Tarreau Date: Mon, 31 Mar 2025 13:40:41 +0000 (+0200) Subject: MINOR: thread: dump the CPU topology in thread_map_to_groups() X-Git-Tag: v3.2-dev9~39 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e17512c3b2f94fe11a21e9053f37c2b36a6a877d;p=thirdparty%2Fhaproxy.git MINOR: thread: dump the CPU topology in thread_map_to_groups() It was previously done in thread_detect_count() but that's not quite handy because we still don't know about the groups setting. Better do it slightly later and have all the relevant info instead. --- diff --git a/src/thread.c b/src/thread.c index 5a2257d08..3ca0b5a4e 100644 --- a/src/thread.c +++ b/src/thread.c @@ -1432,6 +1432,13 @@ int thread_map_to_groups() #ifdef USE_THREAD all_tgroups_mask = m; #endif + +#if defined(USE_THREAD) && defined(USE_CPU_AFFINITY) + if (global.tune.debug & GDBG_CPU_AFFINITY) { + cpu_reorder_by_index(ha_cpu_topo, cpu_topo_maxcpus); + cpu_dump_topology(ha_cpu_topo); + } +#endif return 0; } @@ -1664,13 +1671,6 @@ void thread_detect_count(void) global.nbthread, MAX_THREADS_PER_GROUP * global.nbtgroups, MAX_THREADS_PER_GROUP, MAX_TGROUPS); global.nbthread = MAX_THREADS_PER_GROUP * global.nbtgroups; } - -#if defined(USE_THREAD) && defined(USE_CPU_AFFINITY) - if (global.tune.debug & GDBG_CPU_AFFINITY) { - cpu_reorder_by_index(ha_cpu_topo, cpu_topo_maxcpus); - cpu_dump_topology(ha_cpu_topo); - } -#endif return; }