summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDave Jones <davej@redhat.com>2011-02-22 19:02:12 -0500
committerDave Jones <davej@redhat.com>2011-02-22 19:02:12 -0500
commitab32379ad4bea08d75f4094797c81cd0094c4735 (patch)
tree87c6f1a21193100d7ac7f6fc00777104a78948ac
parentb5629dcb903d5d48c38572b6a024336b34aeb98b (diff)
gather topology info per-cpu
-rw-r--r--Intel/topology.c6
-rw-r--r--topology.c11
-rw-r--r--x86info.c1
-rw-r--r--x86info.h2
4 files changed, 12 insertions, 8 deletions
diff --git a/Intel/topology.c b/Intel/topology.c
index c6f5eb0..a4222fa 100644
--- a/Intel/topology.c
+++ b/Intel/topology.c
@@ -124,9 +124,9 @@ void get_intel_topology(struct cpudata *cpu)
if (debug == 1) {
if ((cpu->x86_max_cores * cpu->num_siblings) > 1) {
printf("%s:\n", __func__);
- printf("Siblings: %d\n", cpu->num_siblings);
- printf("Physical Processor ID: %d\n", cpu->phys_proc_id);
- printf("Processor Core ID: %d\n", cpu->cpu_core_id);
+ printf("\tSiblings: %d\n", cpu->num_siblings);
+ printf("\tPhysical Processor ID: %d\n", cpu->phys_proc_id);
+ printf("\tProcessor Core ID: %d\n", cpu->cpu_core_id);
}
}
out:
diff --git a/topology.c b/topology.c
index 9382c80..e8eedf8 100644
--- a/topology.c
+++ b/topology.c
@@ -23,6 +23,12 @@ static char * corenum(int num)
}
}
+void get_topology(struct cpudata *cpu)
+{
+ if (cpu->vendor == VENDOR_INTEL)
+ get_intel_topology(cpu);
+}
+
void display_topology(struct cpudata *head)
{
struct cpudata *cpu;
@@ -33,12 +39,9 @@ void display_topology(struct cpudata *head)
int num_sockets = 0;
/* For now, we only support topology parsing on Intel. */
- if (head->vendor == VENDOR_INTEL)
- get_intel_topology(head);
- else
+ if (head->vendor != VENDOR_INTEL)
return;
-
if (debug == 1) {
cpu = head;
printf("cpu->phys_proc_id: ");
diff --git a/x86info.c b/x86info.c
index d8d3f2b..4200f5a 100644
--- a/x86info.c
+++ b/x86info.c
@@ -154,6 +154,7 @@ static void fill_in_cpu_info(struct cpudata *cpu)
get_cpu_info_basics(cpu); /* get vendor,family,model,stepping */
get_feature_flags(cpu);
identify(cpu);
+ get_topology(cpu);
}
diff --git a/x86info.h b/x86info.h
index 56013c9..6394658 100644
--- a/x86info.h
+++ b/x86info.h
@@ -173,9 +173,9 @@ void decode_connector(enum connector type);
void show_benchmarks(struct cpudata *cpu);
void decode_serial_number(struct cpudata *cpu);
+void get_topology(struct cpudata *head);
void display_topology(struct cpudata *head);
void get_intel_topology(struct cpudata *cpu);
-void show_intel_topology(struct cpudata *cpu);
void decode_AMD_cacheinfo(struct cpudata *cpu);