LinuxCommandLibrary

corelist

List CPU cores a process is running on

SYNOPSIS

corelist [-h] [-l] [-v] [-V] [-c cpulist] [event ...]

PARAMETERS

-h
    Display help message and exit

-l
    List all available events (default behavior)

-v
    Increase verbosity for detailed output

-V
    Print version information

-c cpulist
    Specify comma-separated list of CPU cores (e.g., 0-3,7)

event
    Filter and show details for specific event names

DESCRIPTION

The corelist command is a utility for displaying Performance Monitoring Unit (PMU) events supported by the CPU cores on a Linux system. It is particularly useful for performance engineers and developers working with hardware performance counters.

Corelist queries the kernel's perf_event interface or libpfm to enumerate events available on specific or all CPU cores. This helps in identifying valid event names, codes, and attributes before using them with tools like perf record, stat, or low-level PMU programming.

By default, it lists events for the current core, but options allow specifying core lists, verbosity levels, and filtering. Output includes event names (e.g., 'cycles', 'instructions'), numeric codes, and descriptions where available. This is essential for cross-CPU compatibility, as PMU events can vary between core models in heterogeneous systems like big.LITTLE ARM or Intel hybrid architectures.

Corelist is part of the pmc-tools or libpfm packages, lightweight and non-intrusive, making it a go-to for event discovery without running full benchmarks.

CAVEATS

Requires root privileges or perf_event_paranoid <=1 for full access on some kernels.
Not all PMU events are listed if kernel lacks support. Output varies by CPU architecture.

OUTPUT FORMAT

Events shown as name:code:config with human-readable descriptions.
Example: cycles:0x3c - CPU clock cycles.

INSTALLATION

Install via apt install pmc-tools or yum install pmc-tools; often bundled with linux-tools.

HISTORY

Developed by Stephane Eranian as part of pmc-tools (circa 2005-2010) for Intel/AMD PMU support. Integrated into libpfm4 project; actively maintained for modern x86/ARM CPUs.

SEE ALSO

perf(1), pfm(3), ocperf(1)

Copied to clipboard