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*785623eeSIan Rogers As performance monitoring event names are case 41*785623eeSIan Rogers insensitive in the perf tool, the perf tool only looks 42*785623eeSIan Rogers for lower or upper case event names in sysfs to avoid 43*785623eeSIan Rogers scanning the directory. It is therefore required the 44*785623eeSIan Rogers name of the event here is either lower or upper case. 45*785623eeSIan Rogers 46ed90a446SCody P Schafer File contents: 47ed90a446SCody P Schafer 48ed90a446SCody P Schafer <term>[=<value>][,<term>[=<value>]]... 49ed90a446SCody P Schafer 50ed90a446SCody P Schafer Where <term> is one of the terms listed under 51ed90a446SCody P Schafer /sys/bus/event_source/devices/<pmu>/format/ and <value> is 52ed90a446SCody P Schafer a number is base-16 format with a '0x' prefix (lowercase only). 53ed90a446SCody P Schafer If a <term> is specified alone (without an assigned value), it 54ed90a446SCody P Schafer is implied that 0x1 is assigned to that <term>. 55ed90a446SCody P Schafer 56ebab9426SBjorn Helgaas Examples (each of these lines would be in a separate file): 57ed90a446SCody P Schafer 58ed90a446SCody P Schafer event=0x2abc 59ed90a446SCody P Schafer event=0x423,inv,cmask=0x3 60ed90a446SCody P Schafer domain=0x1,offset=0x8,starting_index=0xffff 6198a43e0eSCody P Schafer domain=0x1,offset=0x8,core=? 62ed90a446SCody P Schafer 63ed90a446SCody P Schafer Each of the assignments indicates a value to be assigned to a 64ed90a446SCody P Schafer particular set of bits (as defined by the format file 65ed90a446SCody P Schafer corresponding to the <term>) in the perf_event structure passed 66ed90a446SCody P Schafer to the perf_open syscall. 67ed90a446SCody P Schafer 6898a43e0eSCody P Schafer In the case of the last example, a value replacing "?" would 6998a43e0eSCody P Schafer need to be provided by the user selecting the particular event. 7098a43e0eSCody P Schafer This is referred to as "event parameterization". Event 7198a43e0eSCody P Schafer parameters have the format 'param=?'. 7298a43e0eSCody P Schafer 73ed90a446SCody P SchaferWhat: /sys/bus/event_source/devices/<pmu>/events/<event>.unit 74ed90a446SCody P SchaferDate: 2014/02/24 75ed90a446SCody P SchaferContact: Linux kernel mailing list <linux-kernel@vger.kernel.org> 76ed90a446SCody P SchaferDescription: Perf event units 77ed90a446SCody P Schafer 78ed90a446SCody P Schafer A string specifying the English plural numerical unit that <event> 79ed90a446SCody P Schafer (once multiplied by <event>.scale) represents. 80ed90a446SCody P Schafer 81ed90a446SCody P Schafer Example: 82ed90a446SCody P Schafer 83ed90a446SCody P Schafer Joules 84ed90a446SCody P Schafer 85ed90a446SCody P SchaferWhat: /sys/bus/event_source/devices/<pmu>/events/<event>.scale 86ed90a446SCody P SchaferDate: 2014/02/24 87ed90a446SCody P SchaferContact: Linux kernel mailing list <linux-kernel@vger.kernel.org> 88ed90a446SCody P SchaferDescription: Perf event scaling factors 89ed90a446SCody P Schafer 90ed90a446SCody P Schafer A string representing a floating point value expressed in 91ed90a446SCody P Schafer scientific notation to be multiplied by the event count 92ebab9426SBjorn Helgaas received from the kernel to match the unit specified in the 93ed90a446SCody P Schafer <event>.unit file. 94ed90a446SCody P Schafer 95ed90a446SCody P Schafer Example: 96ed90a446SCody P Schafer 97ed90a446SCody P Schafer 2.3283064365386962890625e-10 98ed90a446SCody P Schafer 99ed90a446SCody P Schafer This is provided to avoid performing floating point arithmetic 100ed90a446SCody P Schafer in the kernel. 101