запустите команду и соберите статистику счетчика производительности (Run a command and gather performance counter statistics)
THREAD MODE EXAMPLE:
perf-stat reports the scaled counts for hybrid event and with a
percentage displayed. The percentage is the event's running
time/enabling time.
One example, triad_loop runs on cpu16 (atom core), while we can
see the scaled value for core cycles is 160,444,092 and the
percentage is 0.47%.
perf stat -e cycles — taskset -c 16 ./triad_loop
As previous, two events are created.
.ft C
perf_event_attr:
size 120
config 0x400000000
sample_type IDENTIFIER
read_format TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING
disabled 1
inherit 1
enable_on_exec 1
exclude_guest 1
.ft
and
.ft C
perf_event_attr:
size 120
config 0x800000000
sample_type IDENTIFIER
read_format TOTAL_TIME_ENABLED|TOTAL_TIME_RUNNING
disabled 1
inherit 1
enable_on_exec 1
exclude_guest 1
.ft
Performance counter stats for 'taskset -c 16 ./triad_loop':
233,066,666 cpu_core/cycles/ (0.43%)
604,097,080 cpu_atom/cycles/ (99.57%)