12ac3634aSSukadev BhattiproluWhat: /sys/devices/cpu/events/ 22ac3634aSSukadev Bhattiprolu /sys/devices/cpu/events/branch-misses 32ac3634aSSukadev Bhattiprolu /sys/devices/cpu/events/cache-references 42ac3634aSSukadev Bhattiprolu /sys/devices/cpu/events/cache-misses 52ac3634aSSukadev Bhattiprolu /sys/devices/cpu/events/stalled-cycles-frontend 62ac3634aSSukadev Bhattiprolu /sys/devices/cpu/events/branch-instructions 72ac3634aSSukadev Bhattiprolu /sys/devices/cpu/events/stalled-cycles-backend 82ac3634aSSukadev Bhattiprolu /sys/devices/cpu/events/instructions 92ac3634aSSukadev Bhattiprolu /sys/devices/cpu/events/cpu-cycles 102ac3634aSSukadev Bhattiprolu 112ac3634aSSukadev BhattiproluDate: 2013/01/08 122ac3634aSSukadev Bhattiprolu 132ac3634aSSukadev BhattiproluContact: Linux kernel mailing list <linux-kernel@vger.kernel.org> 142ac3634aSSukadev Bhattiprolu 152ac3634aSSukadev BhattiproluDescription: Generic performance monitoring events 162ac3634aSSukadev Bhattiprolu 172ac3634aSSukadev Bhattiprolu A collection of performance monitoring events that may be 182ac3634aSSukadev Bhattiprolu supported by many/most CPUs. These events can be monitored 192ac3634aSSukadev Bhattiprolu using the 'perf(1)' tool. 202ac3634aSSukadev Bhattiprolu 212ac3634aSSukadev Bhattiprolu The contents of each file would look like: 222ac3634aSSukadev Bhattiprolu 232ac3634aSSukadev Bhattiprolu event=0xNNNN 242ac3634aSSukadev Bhattiprolu 252ac3634aSSukadev Bhattiprolu where 'N' is a hex digit and the number '0xNNNN' shows the 262ac3634aSSukadev Bhattiprolu "raw code" for the perf event identified by the file's 272ac3634aSSukadev Bhattiprolu "basename". 282ac3634aSSukadev Bhattiprolu 292ac3634aSSukadev Bhattiprolu 30ed90a446SCody P SchaferWhat: /sys/bus/event_source/devices/<pmu>/events/<event> 31ed90a446SCody P SchaferDate: 2014/02/24 32ed90a446SCody P SchaferContact: Linux kernel mailing list <linux-kernel@vger.kernel.org> 33ed90a446SCody P SchaferDescription: Per-pmu performance monitoring events specific to the running system 34ed90a446SCody P Schafer 35ed90a446SCody P Schafer Each file (except for some of those with a '.' in them, '.unit' 36ed90a446SCody P Schafer and '.scale') in the 'events' directory describes a single 37ed90a446SCody P Schafer performance monitoring event supported by the <pmu>. The name 38ed90a446SCody P Schafer of the file is the name of the event. 39ed90a446SCody P Schafer 40*b031fe83SRandy Dunlap As performance monitoring event names are case insensitive 41*b031fe83SRandy Dunlap in the perf tool, the perf tool only looks for all lower 42*b031fe83SRandy Dunlap case or all upper case event names in sysfs to avoid 43785623eeSIan Rogers scanning the directory. It is therefore required the 44*b031fe83SRandy Dunlap name of the event here is either completely lower or upper 45*b031fe83SRandy Dunlap case, with no mixed-case characters. Numbers, '.', '_', and 46*b031fe83SRandy Dunlap '-' are also allowed. 47785623eeSIan Rogers 48ed90a446SCody P Schafer File contents: 49ed90a446SCody P Schafer 50ed90a446SCody P Schafer <term>[=<value>][,<term>[=<value>]]... 51ed90a446SCody P Schafer 52ed90a446SCody P Schafer Where <term> is one of the terms listed under 53ed90a446SCody P Schafer /sys/bus/event_source/devices/<pmu>/format/ and <value> is 54ed90a446SCody P Schafer a number is base-16 format with a '0x' prefix (lowercase only). 55ed90a446SCody P Schafer If a <term> is specified alone (without an assigned value), it 56ed90a446SCody P Schafer is implied that 0x1 is assigned to that <term>. 57ed90a446SCody P Schafer 58ebab9426SBjorn Helgaas Examples (each of these lines would be in a separate file): 59ed90a446SCody P Schafer 60ed90a446SCody P Schafer event=0x2abc 61ed90a446SCody P Schafer event=0x423,inv,cmask=0x3 62ed90a446SCody P Schafer domain=0x1,offset=0x8,starting_index=0xffff 6398a43e0eSCody P Schafer domain=0x1,offset=0x8,core=? 64ed90a446SCody P Schafer 65ed90a446SCody P Schafer Each of the assignments indicates a value to be assigned to a 66ed90a446SCody P Schafer particular set of bits (as defined by the format file 67ed90a446SCody P Schafer corresponding to the <term>) in the perf_event structure passed 68ed90a446SCody P Schafer to the perf_open syscall. 69ed90a446SCody P Schafer 7098a43e0eSCody P Schafer In the case of the last example, a value replacing "?" would 7198a43e0eSCody P Schafer need to be provided by the user selecting the particular event. 7298a43e0eSCody P Schafer This is referred to as "event parameterization". Event 7398a43e0eSCody P Schafer parameters have the format 'param=?'. 7498a43e0eSCody P Schafer 75ed90a446SCody P SchaferWhat: /sys/bus/event_source/devices/<pmu>/events/<event>.unit 76ed90a446SCody P SchaferDate: 2014/02/24 77ed90a446SCody P SchaferContact: Linux kernel mailing list <linux-kernel@vger.kernel.org> 78ed90a446SCody P SchaferDescription: Perf event units 79ed90a446SCody P Schafer 80ed90a446SCody P Schafer A string specifying the English plural numerical unit that <event> 81ed90a446SCody P Schafer (once multiplied by <event>.scale) represents. 82ed90a446SCody P Schafer 83ed90a446SCody P Schafer Example: 84ed90a446SCody P Schafer 85ed90a446SCody P Schafer Joules 86ed90a446SCody P Schafer 87ed90a446SCody P SchaferWhat: /sys/bus/event_source/devices/<pmu>/events/<event>.scale 88ed90a446SCody P SchaferDate: 2014/02/24 89ed90a446SCody P SchaferContact: Linux kernel mailing list <linux-kernel@vger.kernel.org> 90ed90a446SCody P SchaferDescription: Perf event scaling factors 91ed90a446SCody P Schafer 92ed90a446SCody P Schafer A string representing a floating point value expressed in 93ed90a446SCody P Schafer scientific notation to be multiplied by the event count 94ebab9426SBjorn Helgaas received from the kernel to match the unit specified in the 95ed90a446SCody P Schafer <event>.unit file. 96ed90a446SCody P Schafer 97ed90a446SCody P Schafer Example: 98ed90a446SCody P Schafer 99ed90a446SCody P Schafer 2.3283064365386962890625e-10 100ed90a446SCody P Schafer 101ed90a446SCody P Schafer This is provided to avoid performing floating point arithmetic 102ed90a446SCody P Schafer in the kernel. 103