^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 1) What: /sys/devices/cpu/events/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 2) /sys/devices/cpu/events/branch-misses
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 3) /sys/devices/cpu/events/cache-references
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 4) /sys/devices/cpu/events/cache-misses
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 5) /sys/devices/cpu/events/stalled-cycles-frontend
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 6) /sys/devices/cpu/events/branch-instructions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 7) /sys/devices/cpu/events/stalled-cycles-backend
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 8) /sys/devices/cpu/events/instructions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 9) /sys/devices/cpu/events/cpu-cycles
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) Date: 2013/01/08
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) Description: Generic performance monitoring events
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) A collection of performance monitoring events that may be
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18) supported by many/most CPUs. These events can be monitored
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19) using the 'perf(1)' tool.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21) The contents of each file would look like:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23) event=0xNNNN
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25) where 'N' is a hex digit and the number '0xNNNN' shows the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26) "raw code" for the perf event identified by the file's
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27) "basename".
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30) What: /sys/bus/event_source/devices/<pmu>/events/<event>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31) Date: 2014/02/24
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) Description: Per-pmu performance monitoring events specific to the running system
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) Each file (except for some of those with a '.' in them, '.unit'
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) and '.scale') in the 'events' directory describes a single
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37) performance monitoring event supported by the <pmu>. The name
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38) of the file is the name of the event.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40) File contents:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42) <term>[=<value>][,<term>[=<value>]]...
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44) Where <term> is one of the terms listed under
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45) /sys/bus/event_source/devices/<pmu>/format/ and <value> is
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46) a number is base-16 format with a '0x' prefix (lowercase only).
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47) If a <term> is specified alone (without an assigned value), it
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) is implied that 0x1 is assigned to that <term>.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) Examples (each of these lines would be in a seperate file):
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) event=0x2abc
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) event=0x423,inv,cmask=0x3
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) domain=0x1,offset=0x8,starting_index=0xffff
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) domain=0x1,offset=0x8,core=?
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) Each of the assignments indicates a value to be assigned to a
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) particular set of bits (as defined by the format file
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) corresponding to the <term>) in the perf_event structure passed
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) to the perf_open syscall.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) In the case of the last example, a value replacing "?" would
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) need to be provided by the user selecting the particular event.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) This is referred to as "event parameterization". Event
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 65) parameters have the format 'param=?'.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 66)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 67) What: /sys/bus/event_source/devices/<pmu>/events/<event>.unit
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 68) Date: 2014/02/24
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 69) Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 70) Description: Perf event units
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 71)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 72) A string specifying the English plural numerical unit that <event>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 73) (once multiplied by <event>.scale) represents.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 74)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 75) Example:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 76)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 77) Joules
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 78)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 79) What: /sys/bus/event_source/devices/<pmu>/events/<event>.scale
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 80) Date: 2014/02/24
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 81) Contact: Linux kernel mailing list <linux-kernel@vger.kernel.org>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 82) Description: Perf event scaling factors
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 83)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 84) A string representing a floating point value expressed in
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 85) scientific notation to be multiplied by the event count
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 86) recieved from the kernel to match the unit specified in the
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 87) <event>.unit file.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 88)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 89) Example:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 90)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 91) 2.3283064365386962890625e-10
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 92)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 93) This is provided to avoid performing floating point arithmetic
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 94) in the kernel.