mirror of
https://github.com/Dr-Noob/cpufetch.git
synced 2026-03-26 00:10:38 +01:00
[v0.90][ARM] Print right number of cores and frequency for each CPU
This commit is contained in:
@@ -26,14 +26,15 @@ VENDOR get_cpu_vendor(struct cpuInfo* cpu) {
|
||||
return cpu->cpu_vendor;
|
||||
}
|
||||
|
||||
uint32_t get_nsockets(struct topology* topo) {
|
||||
return topo->sockets;
|
||||
}
|
||||
|
||||
int64_t get_freq(struct frequency* freq) {
|
||||
return freq->max;
|
||||
}
|
||||
|
||||
#ifdef ARCH_X86
|
||||
char* get_str_cpu_name(struct cpuInfo* cpu) {
|
||||
return cpu->cpu_name;
|
||||
}
|
||||
|
||||
char* get_str_sockets(struct topology* topo) {
|
||||
char* string = malloc(sizeof(char) * 2);
|
||||
int32_t sanity_ret = snprintf(string, 2, "%d", topo->sockets);
|
||||
@@ -44,9 +45,8 @@ char* get_str_sockets(struct topology* topo) {
|
||||
return string;
|
||||
}
|
||||
|
||||
#ifdef ARCH_X86
|
||||
char* get_str_cpu_name(struct cpuInfo* cpu) {
|
||||
return cpu->cpu_name;
|
||||
uint32_t get_nsockets(struct topology* topo) {
|
||||
return topo->sockets;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
@@ -74,14 +74,14 @@ struct cache {
|
||||
};
|
||||
|
||||
struct topology {
|
||||
int64_t total_cores;
|
||||
uint32_t physical_cores;
|
||||
int32_t total_cores;
|
||||
struct cache* cach;
|
||||
#ifdef ARCH_X86
|
||||
uint32_t physical_cores;
|
||||
uint32_t logical_cores;
|
||||
uint32_t smt_available; // Number of SMT that is currently enabled
|
||||
uint32_t smt_supported; // Number of SMT that CPU supports (equal to smt_available if SMT is enabled)
|
||||
uint32_t sockets;
|
||||
struct cache* cach;
|
||||
#ifdef ARCH_X86
|
||||
struct apic* apic;
|
||||
#endif
|
||||
};
|
||||
@@ -135,13 +135,13 @@ struct cpuInfo {
|
||||
|
||||
#ifdef ARCH_X86
|
||||
char* get_str_cpu_name(struct cpuInfo* cpu);
|
||||
char* get_str_sockets(struct topology* topo);
|
||||
uint32_t get_nsockets(struct topology* topo);
|
||||
#endif
|
||||
|
||||
VENDOR get_cpu_vendor(struct cpuInfo* cpu);
|
||||
uint32_t get_nsockets(struct topology* topo);
|
||||
int64_t get_freq(struct frequency* freq);
|
||||
|
||||
char* get_str_sockets(struct topology* topo);
|
||||
char* get_str_aes(struct cpuInfo* cpu);
|
||||
char* get_str_sha(struct cpuInfo* cpu);
|
||||
char* get_str_l1i(struct cache* cach);
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
#include "../arm/midr.h"
|
||||
#endif
|
||||
|
||||
static const char* VERSION = "0.89";
|
||||
static const char* VERSION = "0.90";
|
||||
|
||||
void print_help(char *argv[]) {
|
||||
printf("Usage: %s [--version] [--help] [--debug] [--style \"fancy\"|\"retro\"|\"legacy\"] [--color \"intel\"|\"amd\"|'R,G,B:R,G,B:R,G,B:R,G,B']\n\n", argv[0]);
|
||||
|
||||
Reference in New Issue
Block a user