1. 10 Mar, 2016 4 commits
    • Sukadev Bhattiprolu's avatar
      powerpc/perf/hv-24x7: Display change in counter values · 2b206ee6
      Sukadev Bhattiprolu authored
      For 24x7 counters, perf displays the raw value of the 24x7 counter, which
      is a monotonically increasing value.
      
      	perf stat -C 0 -e \
      		'hv_24x7/HPM_0THRD_NON_IDLE_CCYC__PHYS_CORE,core=1/' \
      		sleep 1
      
       Performance counter stats for 'CPU(s) 0':
      
           9,105,403,170      hv_24x7/HPM_0THRD_NON_IDLE_CCYC__PHYS_CORE,core=1/
      
             0.000425751 seconds time elapsed
      
      In the typical usage of 'perf stat' this counter value is not as useful
      as the _change_ in the counter value over the duration of the application.
      
      Have h_24x7_event_init() set the event's prev_count to the raw value of
      the 24x7 counter at the time of initialization. When the application
      terminates, hv_24x7_event_read() will compute the change in value and
      report to the perf tool. Similarly, for the transaction interface, clear
      the event count to 0 at the beginning of the transaction.
      
      	perf stat -C 0 -e \
      		'hv_24x7/HPM_0THRD_NON_IDLE_CCYC__PHYS_CORE,core=1/' \
      		sleep 1
      
       Performance counter stats for 'CPU(s) 0':
      
                 245,758      hv_24x7/HPM_0THRD_NON_IDLE_CCYC__PHYS_CORE,core=1/
      
             1.006366383 seconds time elapsed
      Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      2b206ee6
    • Sukadev Bhattiprolu's avatar
      powerpc/perf/hv-24x7: Fix usage with chip events. · e5a5886d
      Sukadev Bhattiprolu authored
      24x7 counters can belong to different domains (core, chip, virtual CPU
      etc). For events in the 'chip' domain, sysfs entry currently looks like:
      
      	$ cd /sys/bus/event_source/devices/hv_24x7/events
      	$ cat PM_XLINK_CYCLES__PHYS_CHIP
      	domain=0x1,offset=0x230,core=?,lpar=0x0
      
      where the required parameter, 'core=?' is specified with perf as:
      
      	perf stat -C 0 -e hv_24x7/PM_XLINK_CYCLES__PHYS_CHIP,core=1/ \
      		/bin/true
      
      This is inconsistent in that 'core' is a required parameter for a chip
      event.  Instead, have the the sysfs entry display 'chip=?' for chip
      events:
      
      	$ cd /sys/bus/event_source/devices/hv_24x7/events
      	$ cat PM_XLINK_CYCLES__PHYS_CHIP
      	domain=0x1,offset=0x230,chip=?,lpar=0x0
      
      We also need to add a 'chip' entry in the sysfs format directory:
      
      	$ ls /sys/bus/event_source/devices/hv_24x7/format
      	chip  core  domain  lpar  offset  vcpu
      	^^^^
      	(new)
      
      so the perf tool can automatically check usage and format the chip
      parameter correctly:
      
      	$ perf stat -C 0 -v -e hv_24x7/PM_XLINK_CYCLES__PHYS_CHIP/ \
      		/bin/true
      	Required parameter 'chip' not specified
      	invalid or unsupported event: 'hv_24x7/PM_XLINK_CYCLES__PHYS_CHIP/'
      
      	$ perf stat -C 0 -v -e hv_24x7/PM_XLINK_CYCLES__PHYS_CHIP,chip=1/ \
      		/bin/true
      	hv_24x7/PM_XLINK_CYCLES__PHYS_CHIP,chip=1/: 0 6628908 6628908
      
      	 Performance counter stats for 'CPU(s) 0':
      
      	         0      hv_24x7/PM_XLINK_CYCLES__PHYS_CHIP,chip=1/
      
      	    0.006606970 seconds time elapsed
      Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      e5a5886d
    • Sukadev Bhattiprolu's avatar
      powerpc/perf: Export Power8 generic and cache events to sysfs · e0728b50
      Sukadev Bhattiprolu authored
      Power8 supports a large number of events in each susbystem so when a
      user runs:
      
      	perf stat -e branch-instructions sleep 1
      	perf stat -e L1-dcache-loads sleep 1
      
      it is not clear as to which PMU events were monitored.
      
      Export the generic hardware and cache perf events for Power8 to sysfs,
      so users can precisely determine the PMU event monitored by the generic
      event.
      
      Eg:
      	cat /sys/bus/event_source/devices/cpu/events/branch-instructions
      	event=0x10068
      
      	$ cat /sys/bus/event_source/devices/cpu/events/L1-dcache-loads
      	event=0x100ee
      Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      e0728b50
    • Sukadev Bhattiprolu's avatar
      powerpc/perf: Remove PME_ prefix for power7 events · d4969e24
      Sukadev Bhattiprolu authored
      We used the PME_ prefix earlier to avoid some macro/variable name
      collisions.  We have since changed the way we define/use the event
      macros so we no longer need the prefix.
      
      By dropping the prefix, we keep the the event macros consistent with
      their official names.
      Reported-by: default avatarMichael Ellerman <ellerman@au1.ibm.com>
      Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      d4969e24
  2. 09 Mar, 2016 22 commits
  3. 08 Mar, 2016 14 commits