[IDLESTAT] topology: add cpu core info even without Hyper-Threading.

Message ID 1377683741-8321-1-git-send-email-shaojie.sun@linaro.com
State New
Headers show

Commit Message

sunshaojie Aug. 28, 2013, 9:55 a.m.
In ARM big-little arch, core ID is not equal to cpuid. to keep
code ID info, we print core ID info even without Hyper-Threading.

Signed-off-by: Shaojie Sun <shaojie.sun@linaro.com>
---
 topology.c |   22 ++++++----------------
 1 file changed, 6 insertions(+), 16 deletions(-)

Patch

diff --git a/topology.c b/topology.c
index e93381c..e9d3aa3 100644
--- a/topology.c
+++ b/topology.c
@@ -173,14 +173,9 @@  int output_topo_info(struct cpu_topology *topo_list)
 	list_for_each_entry(s_phy, &topo_list->physical_head, list_physical) {
 		printf("cluster%c:\n", s_phy->physical_id + 'A');
 		list_for_each_entry(s_core, &s_phy->core_head, list_core) {
-			if (s_core->is_ht) {
-				printf("\tcore%d\n", s_core->core_id);
-				list_for_each_entry(s_cpu, &s_core->cpu_head, list_cpu)
-					printf("\t\tcpu%d\n", s_cpu->cpu_id);
-			} else {
-				list_for_each_entry(s_cpu, &s_core->cpu_head, list_cpu)
-					printf("\tcpu%d\n", s_cpu->cpu_id);
-			}
+			printf("\tcore%d\n", s_core->core_id);
+			list_for_each_entry(s_cpu, &s_core->cpu_head, list_cpu)
+				printf("\t\tcpu%d\n", s_cpu->cpu_id);
 		}
 	}
 
@@ -196,14 +191,9 @@  int outfile_topo_info(FILE *f, struct cpu_topology *topo_list)
 	list_for_each_entry(s_phy, &topo_list->physical_head, list_physical) {
 		fprintf(f, "cluster%c:\n", s_phy->physical_id + 'A');
 		list_for_each_entry(s_core, &s_phy->core_head, list_core) {
-			if (s_core->is_ht) {
-				fprintf(f, "\tcore%d\n", s_core->core_id);
-				list_for_each_entry(s_cpu, &s_core->cpu_head, list_cpu)
-					fprintf(f, "\t\tcpu%d\n", s_cpu->cpu_id);
-			} else {
-				list_for_each_entry(s_cpu, &s_core->cpu_head, list_cpu)
-					fprintf(f, "\tcpu%d\n", s_cpu->cpu_id);
-			}
+			fprintf(f, "\tcore%d\n", s_core->core_id);
+			list_for_each_entry(s_cpu, &s_core->cpu_head, list_cpu)
+				fprintf(f, "\t\tcpu%d\n", s_cpu->cpu_id);
 		}
 	}