diff --git a/cpuid_tool/cpuid_tool.c b/cpuid_tool/cpuid_tool.c index 00c61c5..5f4ab97 100644 --- a/cpuid_tool/cpuid_tool.c +++ b/cpuid_tool/cpuid_tool.c @@ -143,17 +143,17 @@ static void usage(void) int line_fill, l, i; printf("Usage: cpuid_tool [options]\n\n"); printf("Options:\n"); - printf(" -h,--help - Show this help\n"); - printf(" --load= - Load RAW CPUID data from file\n"); - printf(" --save= - Aquire RAW CPUID data and write it to file\n"); - printf(" --report,--all - Report all decoded CPU info (w/o clock)\n"); - printf(" --clock - in conjunction to --report: print CPU clock as well\n"); - printf(" --clock-rdtsc - same as --clock, but use RDTSC for clock detection\n"); - printf(" --quiet - disable warnings\n"); + printf(" -h, --help - Show this help\n"); + printf(" --load= - Load raw CPUID data from file\n"); + printf(" --save= - Aquire raw CPUID data and write it to file\n"); + printf(" --report, --all - Report all decoded CPU info (w/o clock)\n"); + printf(" --clock - in conjunction to --report: print CPU clock as well\n"); + printf(" --clock-rdtsc - same as --clock, but use RDTSC for clock detection\n"); + printf(" --cpulist - list all known CPUs\n"); + printf(" --quiet - disable warnings\n"); printf(" --outfile= - redirect all output to this file, instead of stdout\n"); - printf(" --verbose, -v - be extra verbose (more keys increase verbosiness level)\n"); - printf(" --version - print library version\n"); - printf(" --cpulist - list all known CPUs\n"); + printf(" --verbose, -v - be extra verbose (more keys increase verbosiness level)\n"); + printf(" --version - print library version\n"); printf("\n"); printf("Query switches (generate 1 line of ouput per switch; in order of appearance):"); @@ -349,7 +349,7 @@ static void print_info(output_data_switch query, struct cpu_raw_data_t* raw, fprintf(fout, "%d\n", data->num_logical_cpus); break; case NEED_TOTAL_CPUS: - fprintf(fout, "%d\n", data->total_cpus); + fprintf(fout, "%d\n", data->total_logical_cpus); break; case NEED_L1D_SIZE: fprintf(fout, "%d\n", data->l1_data_cache); @@ -548,7 +548,7 @@ int main(int argc, char** argv) fprintf(fout, " ext_model : %d (%02Xh)\n", data.ext_model, data.ext_model); fprintf(fout, " num_cores : %d\n", data.num_cores); fprintf(fout, " num_logical: %d\n", data.num_logical_cpus); - fprintf(fout, " total_cpus : %d\n", data.total_cpus); + fprintf(fout, " tot_logical: %d\n", data.total_logical_cpus); fprintf(fout, " L1 D cache : %d KB\n", data.l1_data_cache); fprintf(fout, " L1 I cache : %d KB\n", data.l1_instruction_cache); fprintf(fout, " L2 cache : %d KB\n", data.l2_cache); diff --git a/libcpuid/cpuid_main.c b/libcpuid/cpuid_main.c index 383d47e..63ff44e 100644 --- a/libcpuid/cpuid_main.c +++ b/libcpuid/cpuid_main.c @@ -250,7 +250,7 @@ static int cpuid_basic_identify(struct cpu_raw_data_t* raw, struct cpu_id_t* dat data->brand_str[48] = 0; } load_features_common(raw, data); - data->total_cpus = get_total_cpus(); + data->total_logical_cpus = get_total_cpus(); return set_error(ERR_OK); } diff --git a/libcpuid/libcpuid.h b/libcpuid/libcpuid.h index d7da135..2473064 100644 --- a/libcpuid/libcpuid.h +++ b/libcpuid/libcpuid.h @@ -154,7 +154,7 @@ struct cpu_id_t { * If you're writing a multithreaded program and you want to run it on * all CPUs, this is the number of threads you need. */ - int32_t total_cpus; + int32_t total_logical_cpus; /** * L1 data cache size in KB. Could be zero, if the CPU lacks cache. @@ -649,9 +649,13 @@ libcpuid_warn_fn_t cpuid_set_warn_function(libcpuid_warn_fn_t warn_fun); void cpuid_set_verbosiness_level(int level); -/** @see cpuid_get_cpu_list */ +/** + * @brief a structure that holds a list of processor names + */ struct cpu_list_t { + /** Number of entries in the list */ int num_entries; + /** Pointers to names. There will be num_entries of them */ char **names; }; @@ -665,13 +669,11 @@ struct cpu_list_t { * vendors. The list is written out in approximate chronological introduction * order of the parts. * - * @param vendor - the vendor to be queried - * @param list [out] - the resulting list will be written here. The `names' - * field of the structure will hold the names (memory is - * allocated by this function). `num_entries' will hold - * the count. + * @param vendor the vendor to be queried + * @param list [out] the resulting list will be written here. * NOTE: As the memory is dynamically allocated, be sure to call - * @see cpuid_free_cpu_list() after you're done with the data + * cpuid_free_cpu_list() after you're done with the data + * @see cpu_list_t */ void cpuid_get_cpu_list(cpu_vendor_t vendor, struct cpu_list_t* list); @@ -679,7 +681,7 @@ void cpuid_get_cpu_list(cpu_vendor_t vendor, struct cpu_list_t* list); * @brief Frees a CPU list * * This function deletes all the memory associated with a CPU list, as obtained - * by @see cpuid_get_cpu_list() + * by cpuid_get_cpu_list() * * @param list - the list to be free()'d. */