tools/power turbostat: Restore ability to execute in topology-order
authorLen Brown <len.brown@intel.com>
Sat, 16 Feb 2019 05:58:23 +0000 (21:58 -0800)
committerLen Brown <len.brown@intel.com>
Thu, 21 Mar 2019 02:55:37 +0000 (22:55 -0400)
turbostat executes on CPUs in "topology order".
This is an optimization for measuring profoundly idle systems --
as the closest hardware is woken next...

Fix a typo that was added with the sub-die-node support,
that broke topology ordering on multi-node systems.

Signed-off-by: Len Brown <len.brown@intel.com>
tools/power/x86/turbostat/turbostat.c

index 9327c0ddc3a59c6424d33b6278b9cf7e51155ce7..78d88b7d4e98033b61f33d8993be2478163e03a9 100644 (file)
@@ -314,9 +314,8 @@ int for_all_cpus(int (func)(struct thread_data *, struct core_data *, struct pkg
        int retval, pkg_no, core_no, thread_no, node_no;
 
        for (pkg_no = 0; pkg_no < topo.num_packages; ++pkg_no) {
-               for (core_no = 0; core_no < topo.cores_per_node; ++core_no) {
-                       for (node_no = 0; node_no < topo.nodes_per_pkg;
-                            node_no++) {
+               for (node_no = 0; node_no < topo.nodes_per_pkg; node_no++) {
+                       for (core_no = 0; core_no < topo.cores_per_node; ++core_no) {
                                for (thread_no = 0; thread_no <
                                        topo.threads_per_core; ++thread_no) {
                                        struct thread_data *t;