From ab32379ad4bea08d75f4094797c81cd0094c4735 Mon Sep 17 00:00:00 2001 From: Dave Jones Date: Tue, 22 Feb 2011 19:02:12 -0500 Subject: gather topology info per-cpu --- Intel/topology.c | 6 +++--- topology.c | 11 +++++++---- x86info.c | 1 + x86info.h | 2 +- 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); -- cgit v1.2.3