← 返回命令列表

Linux command

lstopo 命令

文件

复制后可按需替换文件名、目录或参数。

常用示例

Show hardware topology

lstopo

Display in terminal

lstopo-no-graphics

Output as image

lstopo [topology.png]

Output as PDF

lstopo [topology.pdf]

Output as XML

lstopo [topology.xml]

Show only CPU info

lstopo --only core

Show with PCI devices

lstopo --whole-io

Show physical indexes

lstopo -p

说明

lstopo displays hardware topology including CPUs, caches, memory, and I/O devices. It visualizes the hierarchical structure of the system from machine level down to individual cores and threads. The output shows NUMA nodes, packages (sockets), cores, and processing units (threads). Cache levels (L1, L2, L3) are displayed with their sizes and sharing between cores. Graphical output creates images showing the topology tree. Text mode (lstopo-no-graphics) works in terminals without graphics support. Understanding topology is important for performance optimization. It shows which cores share caches, which are on the same NUMA node, and how memory is organized. The tool can load topology from XML files, enabling offline analysis or comparison between systems.

参数

--of _FORMAT_
Output format (png, pdf, svg, xml, txt, console).
--only _TYPE_
Show only specific object types.
--whole-io
Show all I/O devices.
--no-io
Hide I/O devices.
-p, --physical
Show physical/OS indexes.
-l, --logical
Show logical indexes.
--merge
Merge identical objects.
--no-legend
Hide the legend.
--no-caches
Hide cache information.
-v, --verbose
Verbose output.
--input _FILE_
Read topology from XML file.
--version
Print version.

FAQ

What is the lstopo command used for?

lstopo displays hardware topology including CPUs, caches, memory, and I/O devices. It visualizes the hierarchical structure of the system from machine level down to individual cores and threads. The output shows NUMA nodes, packages (sockets), cores, and processing units (threads). Cache levels (L1, L2, L3) are displayed with their sizes and sharing between cores. Graphical output creates images showing the topology tree. Text mode (lstopo-no-graphics) works in terminals without graphics support. Understanding topology is important for performance optimization. It shows which cores share caches, which are on the same NUMA node, and how memory is organized. The tool can load topology from XML files, enabling offline analysis or comparison between systems.

How do I run a basic lstopo example?

Run `lstopo` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does --of _FORMAT_ do in lstopo?

Output format (png, pdf, svg, xml, txt, console).