#define _HAPROXY_CPU_TOPO_H
#include <haproxy/api.h>
+#include <haproxy/chunk.h>
#include <haproxy/cpuset-t.h>
#include <haproxy/cpu_topo-t.h>
/* Dump the CPU topology <topo> for up to cpu_topo_maxcpus CPUs for
* debugging purposes. Offline CPUs are skipped.
*/
-void cpu_dump_topology(const struct ha_cpu_topo *topo);
+void cpu_topo_debug(const struct ha_cpu_topo *topo);
+
+/* Dump the summary of CPU topology <topo>, i.e. clusters info and thread-cpu
+ * bindings.
+ */
+void cpu_topo_dump_summary(const struct ha_cpu_topo *topo);
/* re-order a CPU topology array by locality to help form groups. */
void cpu_reorder_by_locality(struct ha_cpu_topo *topo, int entries);
/* Dump the CPU topology <topo> for up to cpu_topo_maxcpus CPUs for
* debugging purposes. Offline CPUs are skipped.
*/
-void cpu_dump_topology(const struct ha_cpu_topo *topo)
+void cpu_topo_debug(const struct ha_cpu_topo *topo)
{
int has_smt = 0;
int cpu, lvl;
- int grp, thr;
for (cpu = 0; cpu <= cpu_topo_lastcpu; cpu++) {
if (ha_cpu_topo[cpu].th_cnt > 1) {
}
putchar('\n');
}
+}
+
+/* Dump the summary of CPU topology <topo>: clusters info and thread-cpu
+ * bindings.
+ */
+void cpu_topo_dump_summary(const struct ha_cpu_topo *topo)
+{
+ int cpu, grp, thr;
printf("CPU clusters:\n");
for (cpu = 0; cpu < cpu_topo_maxcpus; cpu++) {
#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);
+ cpu_topo_debug(ha_cpu_topo);
+ chunk_reset(&trash);
+ cpu_topo_dump_summary(ha_cpu_topo);
+ printf("%s\n", trash.area);
}
#endif
return 0;