How do I figure out which type of processor I am running? (x86 or powerpc?)


Userlevel 4
What is the easiest way for me to figure out which type of processor that is on my switch? I need to know which switch is running which.

3 replies

Userlevel 2
The best way is to look at all of your CPU information is via
root@leaf1:~# cat /proc/cpuinfo
decode-syseeprom shows a lot more interesting information about your switch
root@leaf1:~# decode-syseeprom   TlvInfo Header:
Id String: TlvInfo
Version: 1
Total Length: 180
TLV Name Code Len Value
-------------------- ---- --- -----
Device Version 0x26 1 2
Platform Name 0x28 8 RANGELEY
Manufacturer 0x2B 9 CELESTICA
Manufacture Country 0x2C 3 CHN
Vendor Name 0x2D 9 CELESTICA
Service Tag 0x2F 2 LB
Product Name 0x21 19 Smallstone-XP D4040
Part Number 0x22 14 R0854-F0004-01
Serial Number 0x23 22 D4040B2F064A16GD000012
Base MAC Address 0x24 6 00:E0:EC:27:A5:12
Manufacture Date 0x25 19 10/16/2014 18:09:12
Label Revision 0x27 13 Smallstone-XP
ONIE Version 0x29 7 2014.08
MAC Addresses 0x2A 2 129
Diag Version 0x2E 5 1.1.1
Vendor Extension 0xFD 3 0x2F 0xD4 0xBF
CRC-32 0xFE 4 0x2580CF56
(checksum valid)

Userlevel 4
Thanks Leslie! Did not know about /proc/cpuinfo. Also found uname is cool.
cumulus@leaf1$ cat /proc/cpuinfo | grep model  model  : 54  model name : Intel(R) Atom(TM) CPU S1220   @ 1.60GHz  model  : 54  model name : Intel(R) Atom(TM) CPU S1220   @ 1.60GHz  model  : 54  model name : Intel(R) Atom(TM) CPU S1220   @ 1.60GHz  model  : 54  model name : Intel(R) Atom(TM) CPU S1220   @ 1.60GHz  cumulus@leaf1$ uname -a  Linux leaf1 3.2.65-1+deb7u2+cl2.5+2 #3.2.65-1+deb7u2+cl2.5+2 SMP Mon Jun 1 18:26:59 PDT 2015 x86_64 GNU/Linux  cumulus@leaf1$
Userlevel 1
If you want a simple, machine-readable test for the processor type, you can use the --machine (-m) argument to uname:

cumulus@spine1$ uname -m
ppc
cumulus@spine1$
cumulus@leaf2$ uname -m
x86_64
cumulus@leaf2$

This easy to use in a conditional when scripting:

cumulus@leaf2$ case $(uname -m) in x86_64) echo Do x86 stuff... ;; ppc) echo Do PPC stuff... ;; esac
Do x86 stuff...
cumulus@leaf2$

Reply