LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   how to get cpu information on Linux machine (https://www.linuxquestions.org/questions/programming-9/how-to-get-cpu-information-on-linux-machine-358037/)

laxmi_cs 08-29-2005 05:16 AM

how to get cpu information on Linux machine
 
Hi,

I want to display cpu information like model number, vender information, and how many cpu's are there in the system (Linux machine)

Is there any system call ? or /proc/cpuinfo is the only way

And also how get information regarding controllers and adapters installed on system(Linux machine) using any system call



Thanks and regards
laxmi

Nathanael 08-29-2005 05:22 AM

cat /proc/cpuinfo
cat /proc/meminfo
dmesg
lspci

Welcome to LQ :-)

laxmi_cs 08-29-2005 05:26 AM

How to get the same things using some system calls

Nathanael 08-29-2005 05:39 AM

do these not supply you with enough information?
what do you need it for?
does this not work?

laxmi_cs 08-29-2005 05:44 AM

Sorry, I want to store model number, vender information, and how many cpu's are there to some variables so that i can display same things on the browser

seran 08-29-2005 07:09 AM

you can open this file /proc/cpuinfo from your C program, and store those vendor_id, model name fields in to variables. this is one way. this will require lots of string processing work.

grep65535 08-25-2006 02:52 AM

/usr/sbin/./x86info -a

Matir 08-25-2006 10:01 AM

x86info is hardly a standard utility.

/proc/cpuinfo is the standard interface to the kernel's information regarding CPUs. It is the best option for getting the information you want. There are several scripts on here and other sites that show how to extract the relevant information.

Matir 08-25-2006 10:01 AM

Moved: This thread is more suitable in Programming and has been moved accordingly to help your thread/question get the exposure it deserves.

xhi 08-25-2006 10:06 AM

i agree with Nathanael

this is why

`cat /proc/cpuinfo`
Code:

processor      : 0
vendor_id      : GenuineIntel
cpu family      : 15
model          : 2
model name      : Intel(R) Xeon(TM) CPU 3.06GHz
stepping        : 9
cpu MHz        : 3057.662
cache size      : 512 KB
physical id    : 0
siblings        : 2
core id        : 0
cpu cores      : 1
fdiv_bug        : no
hlt_bug        : no
f00f_bug        : no
coma_bug        : no
fpu            : yes
fpu_exception  : yes
cpuid level    : 2
wp              : yes
flags          : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips        : 6119.81

processor      : 1
vendor_id      : GenuineIntel
cpu family      : 15
model          : 2
model name      : Intel(R) Xeon(TM) CPU 3.06GHz
stepping        : 9
cpu MHz        : 3057.662
cache size      : 512 KB
physical id    : 0
siblings        : 2
core id        : 0
cpu cores      : 1
fdiv_bug        : no
hlt_bug        : no
f00f_bug        : no
coma_bug        : no
fpu            : yes
fpu_exception  : yes
cpuid level    : 2
wp              : yes
flags          : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe cid xtpr
bogomips        : 6112.78

what more do you need?

lkg 08-26-2006 04:24 AM

Here i cant see the unique cpuid how to retriew that cpuid?????????

cupubboy 08-26-2006 05:24 AM

Who are you?

CPUID is an cpu instruction .. look here for details http://www.paradicesoftware.com/specs/cpuid/index.htm

Although the best reading material are the manuals from intel's site Cheers

Matir 08-26-2006 10:07 AM

Though I'm not sure why you need the CPUID. /proc/cpuinfo contains all the information from CPUID, already decoded for you.

Nightfrost 08-26-2006 10:52 AM

I actually have a similar problem. I'm trying to write a set of scripts for which I need to know the pentium-m cpu model of the current computer. That is, I need to know if it's p-m 753, p-m 725, etc. I can't find that information in /proc/cpuinfo. Is there a way to find that out?

grep65535 08-26-2006 03:12 PM

Quote:

Originally Posted by Matir
x86info is hardly a standard utility.

/proc/cpuinfo is the standard interface to the kernel's information regarding CPUs. It is the best option for getting the information you want. There are several scripts on here and other sites that show how to extract the relevant information.


i wasn't shooting for standard, more so toward another alternative to the already suggested methods, the guy asks for maybe another way beyond /proc/cpuinfo, i just threw one out there ;-p


All times are GMT -5. The time now is 05:48 AM.