Skip to content

Instantly share code, notes, and snippets.

@surki
Created August 27, 2020 12:53
Show Gist options
  • Save surki/129132cf6504433611b0d834eee98784 to your computer and use it in GitHub Desktop.
Save surki/129132cf6504433611b0d834eee98784 to your computer and use it in GitHub Desktop.
[root@ip-172-16-20-17 ec2-user]# curl http://instance-data/latest/meta-data/instance-type
i3.16xlarge
 
[root@ip-172-16-20-17 ec2-user]# cat /proc/cpuinfo | grep "model name"
model name      : Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz
 
[root@ip-172-16-20-17 ec2-user]# dmesg | grep -i perf
[   22.307535] Performance Events: Broadwell events, core PMU driver.
 
[root@ip-172-16-20-17 ec2-user]# perf list hw
 
List of pre-defined events (to be used in -e):
 
 branch-instructions OR branches                    [Hardware event]
 branch-misses                                      [Hardware event]
 bus-cycles                                         [Hardware event]
 cache-misses                                       [Hardware event]
 cache-references                                   [Hardware event]
 cpu-cycles OR cycles                               [Hardware event]
 instructions                                       [Hardware event]
 
 
[root@ip-172-16-20-17 ec2-user]# perf stat ls
 
Performance counter stats for 'ls':
 
         0.625179      task-clock (msec)         #    0.633 CPUs utilized
                0      context-switches          #    0.000 K/sec
                0      cpu-migrations            #    0.000 K/sec
               82      page-faults               #    0.131 M/sec
        1,674,090      cycles                    #    2.678 GHz
        1,150,692      instructions              #    0.69  insn per cycle
          238,616      branches                  #  381.676 M/sec
            9,649      branch-misses             #    4.04% of all branches
 
      0.000987276 seconds time elapsed
 
[root@ip-172-16-20-17 obj]# rr record ls
rr: Saving execution to trace directory `/root/.local/share/rr/ls-0'.
[FATAL /home/ec2-user/rr/rr/src/PerfCounters.cc:324:check_working_counters() errno: EOPNOTSUPP]
Got 0 branch events, expected at least 500.
 
The hardware performance counter seems to not be working. Check
that hardware performance counters are working by running
 perf stat -e r5101c4 true
and checking that it reports a nonzero number of events.
If performance counters seem to be working with 'perf', file an
rr issue, otherwise check your hardware/OS/VM configuration. Also
check that other software is not using performance counters on
this CPU.
Aborted
 
# Mozilla rr needs r5101c4
[root@ip-172-16-20-17 ec2-user]# perf stat -e r5101c4 ls
 
Performance counter stats for 'ls':
 
                0      r5101c4
 
      0.001176665 seconds time elapsed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment