Fixed little mistake in number of cores. Changed a little README with more doc

This commit is contained in:
Dr-Noob
2018-03-31 12:07:42 +02:00
parent 904d1fd17f
commit c38a427375
2 changed files with 6 additions and 6 deletions

8
01h.c
View File

@@ -250,14 +250,14 @@ VENDOR getCPUVendorInternal(struct cpuInfo* cpu) {
char* getString_NumberCores(struct cpuInfo* cpu) { char* getString_NumberCores(struct cpuInfo* cpu) {
if(cpu->HT > 1) { if(cpu->HT > 1) {
//2(N.Cores)7(' cores(')2(N.Threads)9(' threads)') //2(N.Cores)7(' cores(')3(N.Threads)9(' threads)')
int size = 2+7+2+9+1; int size = 2+7+3+9+1;
char* string = malloc(sizeof(char)*size); char* string = malloc(sizeof(char)*size);
snprintf(string,size,"%d cores(%d threads)",cpu->nThreads,cpu->nThreads/cpu->HT); snprintf(string,size,"%d cores(%d threads)",cpu->nThreads/cpu->HT,cpu->nThreads);
return string; return string;
} }
else { else {
char* string = malloc(sizeof(char)*2+1); char* string = malloc(sizeof(char)*2+7+1);
snprintf(string,2+7+1,"%d cores",cpu->nThreads); snprintf(string,2+7+1,"%d cores",cpu->nThreads);
return string; return string;
} }

View File

@@ -3,7 +3,7 @@
Prints a fancy summary of the CPU with some advanced information Prints a fancy summary of the CPU with some advanced information
### Platforms ### Platforms
This tool works on both 64 bits and 32 bits, but it's __Linux only__ because of its [implementation details](#implementation) This tool works on both 64 bits and 32 bits, but it's __Linux only__ because of its [implementation details](#implementation). AMD support is not guaranteed so information may not be correct
### Usage and installation ### Usage and installation
@@ -47,7 +47,7 @@ Output is detailed as follows:
### Implementation ### Implementation
`cpufetch` makes use of two techniques to fetch data: `cpufetch` makes use of two techniques to fetch data:
* __cpuid__: CPU name, number of threads per core and instructions features are fetched via _cpuid_. See [this](http://www.sandpile.org/x86/cpuid.htm) for more information. * __cpuid__: CPU name, number of threads per core and instructions features are fetched via _cpuid_. See [this](http://www.sandpile.org/x86/cpuid.htm) and [Intel Processor Identification and the CPUID Instruction](https://www.scss.tcd.ie/~jones/CS4021/processor-identification-cpuid-instruction-note.pdf) for more information.
* __udev__: Cache and frequency are fetched via _udev_, by looking at specific files from `/sys/devices/system/cpu` * __udev__: Cache and frequency are fetched via _udev_, by looking at specific files from `/sys/devices/system/cpu`
### Bugs or improvements ### Bugs or improvements