List Processors and Clock Speed on Solaris with psrinfo -v

psrinfo -v prints each Solaris CPU's type, FPU and clock speed. Run it for a hardware inventory or after a CPU fault; covers -p, -s, -t and illumos output.

List Processors and Clock Speed on Solaris with psrinfo -v

Purpose

The Solaris command list on this site files psrinfo -v under the label "Show process information." In fact psrinfo displays information about processors , and the -v flag adds three facts for each one: the processor type, the floating point unit (FPU) type and the clock speed.

With no flags, psrinfo prints one line for each configured processor. The line shows whether the processor is on-line, non-interruptible (no-intr), spare, off-line, faulted or powered off, and when that status last changed.

Admins run it when they build a hardware inventory, when they confirm the CPU count and speed after a board swap, and when they check a processor the kernel has marked faulted. It is one of the commands collected on the Solaris commands and scripts page .

Code

1psrinfo -v

-p and -pv need Solaris 10 or later.

1psrinfo
2psrinfo -p
3psrinfo -pv
4psrinfo -s 0

Code Breakdown

Default output

Plain psrinfo lists each processor by ID, one per line, with its state and the time of the last state change. These are virtual processors. Solaris 10 added reports on physical processors, but the default output still shows the virtual processor information .

A no-intr processor runs LWPs (lightweight processes) but I/O devices cannot interrupt it. A spare processor runs no LWPs at all.

-v: reading the output

-v prints a block for each processor. On a Solaris 10 SPARC system, one block reads:

1Status of virtual processor 0 as of: 04/16/2004 10:32:13
2  on-line since 03/22/2004 19:18:27.
3  The sparcv9 processor operates at 650 MHz,
4        and has a sparcv9 floating point processor.

The first line gives the processor ID and the time psrinfo read the status. The "on-line since" line is the last state change, the same field the default output shows. The last two lines carry the -v detail: processor type sparcv9, clock speed 650 MHz and FPU type sparcv9.

The format holds on Solaris 11. A Solaris 11 SPARC system prints "The sparcv9 processor operates at 1400 MHz, and has a sparcv9 floating point processor."

sparcv9 is the logical processor type. For the chip name, such as UltraSPARC-IV, use -pv. If psrinfo cannot find out any of the three fields, it prints unknown in its place.

-p and -pv

-p counts physical processors. With no other arguments it prints a single integer: the number of physical processors in the system. One physical processor can carry several virtual processors. Each virtual processor has its own interrupt ID and runs its own threads. On a chip multithreading (CMT) chip, the plain psrinfo count and the -p count differ, so check which of the two numbers a report uses.

-pv reports on each physical processor and lists the virtual processor IDs that belong to it. On an x86 system:

1The i386 physical processor has 2 virtual processors (0, 2)
2The i386 physical processor has 2 virtual processors (1, 3)

On a Solaris 11 SPARC system with UltraSPARC-IV chips, one line reads "The UltraSPARC-IV physical processor has 2 virtual processors (8, 520)". The IDs on one chip do not have to sit next to each other. On Solaris 11.3, virtual processors 0 and 512 can sit on the same physical processor.

-s

-s is silent mode. It prints 1 if the named processor is fully on-line. It prints 0 if the processor is no-intr, spare, off-line, faulted or powered off. Silent mode is the form meant for shell scripts. -s takes one processor ID, as in psrinfo -s 0.

processor_id operand

Most forms accept a processor ID or a range of IDs, such as 1-4. An ID that does not exist ends in an error.

-t and -L (documented in Solaris 11.3)

The Solaris 11.3 man page documents tree mode. psrinfo -t draws a tree of the system's processors with their socket, core and CPU IDs. -L adds locality group (lgroup) membership to that tree and works only together with -t. The Solaris 10 man page does not list either flag. Its synopsis has only the -p, -v and -s forms, and it was last revised 21 February 2004.

Key Points

  • SPARC and x86 print different type names. SPARC output names sparcv9 in -v and the chip, such as UltraSPARC-IV, in -pv. x86 output names i386. For the processor type on x86, use isalist.
  • Solaris 10 added -p. The change was made to show CMT features. Scripts that call -p need Solaris 10 or later.
  • The Solaris 11.3 man page documents -t and -L; the Solaris 10 man page does not. The package also changed. On Solaris 10 psrinfo ships in SUNWcsu. On Solaris 11.3 it ships in system/core-os.
  • illumos uses different flags. illumos files psrinfo in section 8 , and /man/1M/psrinfo serves the same page. On illumos, -p counts physical sockets, and -t reports totals instead of drawing a tree. It adds -c, -S and -r, plus a disabled processor state.
  • psrinfo reads state; psradm changes it. Only a privileged user can move a processor between on-line, off-line, spare and no-intr.

Insights and Best Practices

Socket, core and CPU totals on illumos

illumos splits the count into three levels: a physical socket holds cores, and each core holds virtual processors, also called CPUs. psrinfo -t prints the total CPU count. -tc gives the total cores, -tp gives the sockets, and -t with -S gives the CPUs in a given state.

Alternatives on SPARC and x86

On SPARC, prtconf -b prints the firmware banner, which can name the model and speed. On a Sun Ultra 5/10, the banner line reads:

1banner-name: Sun Ultra 5/10 UPA/PCI (UltraSPARC-IIi 333MHz)

On x86, use isalist to display the virtual processor type.

On illumos, psrinfo -r reports CPU properties that apply to the whole system. The only property defined so far is smt_enabled. It is a yes-or-no value that shows whether simultaneous multi-threading (hyper-threading) is active.

Scripting with -s

Use -s in scripts instead of parsing the text of psrinfo or psrinfo -v. The output is one digit for one processor, so a test needs no text matching. On illumos the disabled state, which the Solaris man pages do not list, also returns 0.

What to log

Save the full psrinfo -v output with each host's inventory record. It holds the CPU IDs, types, speeds and state times in one place. Add psrinfo -pv on Solaris 10 and later so the record shows the physical layout as well.

Processor state changes are also recorded in /etc/wtmpx. That file lets you check when a CPU went off-line, even if nobody saved a psrinfo run at the time.

When to Run This

  • Building or refreshing a hardware inventory: psrinfo -v for speed and type, psrinfo -p for the physical count.
  • After the kernel marks a processor faulted. The kernel watches how each processor behaves over time and sets that state itself.
  • Before and after psradm work, to confirm which processors changed state.
  • Checking the CMT layout on UltraSPARC-IV or similar multi-thread SPARC systems with psrinfo -pv, where virtual IDs such as 8 and 520 share one chip.
  • In boot-time or cron health checks, using psrinfo -s on each processor ID.

Troubleshooting Common Issues

"psrinfo: processor 9: Invalid argument". The processor ID does not exist. List the valid IDs first:

1psrinfo

A processor shows off-line, spare or no-intr. Confirm the state, then bring that processor on-line as a privileged user (here, processor 1), or bring all processors on-line:

1psrinfo
2psradm -n 1
3psradm -a -n

A processor shows faulted. The kernel set this state after watching the processor's behavior. Check psrinfo -v for the time of the change before any psradm work. If LWPs are bound to the processor, psradm -F removes those bindings before it changes the processor's status.

unknown in the -v fields. psrinfo could not find out the type, FPU or speed. Cross-check with the other tools:

1prtconf -b
2isalist

Run prtconf -b on SPARC and isalist on x86.

The -p count does not match the processor count. This is expected on multi-thread chips. Show which virtual IDs sit on each chip:

1psrinfo -pv

On illumos, -t with a processor ID is rejected. A processor ID cannot be given along with -r or -t. Drop the ID:

1psrinfo -t

References