1. 28 5月, 2020 3 次提交
    • K
      powerpc/hv-24x7: Add sysfs files inside hv-24x7 device to show processor details · 60beb65d
      Kajol Jain 提交于
      To expose the system dependent parameter like total number of
      sockets and numbers of chips per socket, patch adds two sysfs files.
      "sockets" and "chips" are added to /sys/devices/hv_24x7/interface/
      of the "hv_24x7" pmu.
      Signed-off-by: NKajol Jain <kjain@linux.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20200525104308.9814-4-kjain@linux.ibm.com
      60beb65d
    • K
      powerpc/hv-24x7: Add rtas call in hv-24x7 driver to get processor details · 8ba21426
      Kajol Jain 提交于
      For hv_24x7 socket/chip level events, specific chip-id to which
      the data requested should be added as part of pmu events.
      But number of chips/socket in the system details are not exposed.
      
      Patch implements read_24x7_sys_info() to get system parameter values
      like number of sockets, cores per chip and chips per socket. Rtas_call
      with token "PROCESSOR_MODULE_INFO" is used to get these values.
      
      Subsequent patch exports these values via sysfs.
      
      Patch also make these parameters default to 1.
      Signed-off-by: NKajol Jain <kjain@linux.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20200525104308.9814-3-kjain@linux.ibm.com
      8ba21426
    • K
      powerpc/perf/hv-24x7: Fix inconsistent output values incase multiple hv-24x7 events run · b4ac18ee
      Kajol Jain 提交于
      Commit 2b206ee6 ("powerpc/perf/hv-24x7: Display change in counter
      values")' added to print _change_ in the counter value rather then raw
      value for 24x7 counters. Incase of transactions, the event count
      is set to 0 at the beginning of the transaction. It also sets
      the event's prev_count to the raw value at the time of initialization.
      Because of setting event count to 0, we are seeing some weird behaviour,
      whenever we run multiple 24x7 events at a time.
      
      For example:
      
      command#: ./perf stat -e "{hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/,
      			   hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/}"
      	  		   -C 0 -I 1000 sleep 100
      
           1.000121704                120 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
           1.000121704                  5 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/
           2.000357733                  8 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
           2.000357733                 10 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/
           3.000495215 18,446,744,073,709,551,616 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
           3.000495215 18,446,744,073,709,551,616 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/
           4.000641884                 56 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
           4.000641884 18,446,744,073,709,551,616 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/
           5.000791887 18,446,744,073,709,551,616 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
      
      Getting these large values in case we do -I.
      
      As we are setting event_count to 0, for interval case, overall event_count is not
      coming in incremental order. As we may can get new delta lesser then previous count.
      Because of which when we print intervals, we are getting negative value which create
      these large values.
      
      This patch removes part where we set event_count to 0 in function
      'h_24x7_event_read'. There won't be much impact as we do set event->hw.prev_count
      to the raw value at the time of initialization to print change value.
      
      With this patch
      In power9 platform
      
      command#: ./perf stat -e "{hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/,
      		           hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/}"
      			   -C 0 -I 1000 sleep 100
      
           1.000117685                 93 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
           1.000117685                  1 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/
           2.000349331                 98 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
           2.000349331                  2 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/
           3.000495900                131 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
           3.000495900                  4 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/
           4.000645920                204 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
           4.000645920                 61 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=1/
           4.284169997                 22 hv_24x7/PM_MCS01_128B_RD_DISP_PORT01,chip=0/
      Suggested-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: NKajol Jain <kjain@linux.ibm.com>
      Tested-by: NMadhavan Srinivasan <maddy@linux.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20200525104308.9814-2-kjain@linux.ibm.com
      b4ac18ee
  2. 04 7月, 2019 1 次提交
  3. 31 5月, 2019 1 次提交
  4. 21 1月, 2019 1 次提交
  5. 22 10月, 2017 1 次提交
  6. 02 7月, 2017 8 次提交
  7. 14 6月, 2016 1 次提交
  8. 10 3月, 2016 4 次提交
    • S
      powerpc/perf/24x7: Eliminate domain suffix in event names · 8f69dc70
      Sukadev Bhattiprolu 提交于
      The Physical Core events of the 24x7 PMU can be monitored across various
      domains (physical core, vcpu home core, vcpu home node etc). For each of
      these core events, we currently create multiple events in sysfs, one for
      each domain the event can be monitored in. These events are distinguished
      by their suffixes like __PHYS_CORE, __VCPU_HOME_CORE etc.
      
      Rather than creating multiple such entries, we could let the user specify
      make 'domain' index a required parameter and let the user specify a value
      for it (like they currently specify the core index).
      
      	$ cat /sys/bus/event_source/devices/hv_24x7/events/HPM_CCYC
      	domain=?,offset=0x98,core=?,lpar=0x0
      
      	$ perf stat -C 0 -e hv_24x7/HPM_CCYC,domain=2,core=1/ true
      
      (the 'domain=?' and 'core=?' in sysfs tell perf tool to enforce them as
      required parameters).
      
      This simplifies the interface and allows users to identify events by the
      name specified in the catalog (User can determine the domain index by
      referring to '/sys/bus/event_source/devices/hv_24x7/interface/domains').
      
      Eliminating the event suffix eliminates several functions and simplifies
      code.
      
      Note that Physical Chip events can only be monitored in the chip domain
      so those events have the domain set to 1 (rather than =?) and users don't
      need to specify the domain index for the Chip events.
      
      	$ cat /sys/bus/event_source/devices/hv_24x7/events/PM_XLINK_CYCLES
      	domain=1,offset=0x230,chip=?,lpar=0x0
      
      	$ perf stat -C 0 -e hv_24x7/PM_XLINK_CYCLES,chip=1/ true
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      8f69dc70
    • S
      powerpc/perf/hv-24x7: Display domain indices in sysfs · d34171e8
      Sukadev Bhattiprolu 提交于
      To help users determine domains, display the domain indices used by the
      kernel in sysfs.
      
      	$ cat /sys/bus/event_source/devices/hv_24x7/interface/domains
      	1: Physical Chip
      	2: Physical Core
      	3: VCPU Home Core
      	4: VCPU Home Chip
      	5: VCPU Home Node
      	6: VCPU Remote Node
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      d34171e8
    • S
      powerpc/perf/hv-24x7: Display change in counter values · 2b206ee6
      Sukadev Bhattiprolu 提交于
      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: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      2b206ee6
    • S
      powerpc/perf/hv-24x7: Fix usage with chip events. · e5a5886d
      Sukadev Bhattiprolu 提交于
      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: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      e5a5886d
  9. 16 2月, 2016 1 次提交
  10. 13 9月, 2015 1 次提交
    • S
      powerpc, perf/powerpc/hv-24x7: Use PMU_TXN_READ interface · 88a48613
      Sukadev Bhattiprolu 提交于
      The 24x7 counters in Powerpc allow monitoring a large number of counters
      simultaneously. They also allow reading several counters in a single
      HCALL so we can get a more consistent snapshot of the system.
      
      Use the PMU's transaction interface to monitor and read several event
      counters at once. The idea is that users can group several 24x7 events
      into a single group of events. We use the following logic to submit
      the group of events to the PMU and read the values:
      
      	pmu->start_txn()		// Initialize before first event
      
      	for each event in group
      		pmu->read(event);	// Queue each event to be read
      
      	pmu->commit_txn()		// Read/update all queuedcounters
      
      The ->commit_txn() also updates the event counts in the respective
      perf_event objects.  The perf subsystem can then directly get the
      event counts from the perf_event and can avoid submitting a new
      ->read() request to the PMU.
      
      Thanks to input from Peter Zijlstra.
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: NPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: NMichael Ellerman <mpe@ellerman.id.au>
      Cc: Arnaldo Carvalho de Melo <acme@kernel.org>
      Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
      Cc: Jiri Olsa <jolsa@redhat.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Vince Weaver <vincent.weaver@maine.edu>
      Link: http://lkml.kernel.org/r/1441336073-22750-10-git-send-email-sukadev@linux.vnet.ibm.comSigned-off-by: NIngo Molnar <mingo@kernel.org>
      88a48613
  11. 25 7月, 2015 2 次提交
  12. 08 7月, 2015 1 次提交
  13. 14 4月, 2015 1 次提交
  14. 11 4月, 2015 11 次提交
  15. 07 3月, 2015 1 次提交
  16. 02 2月, 2015 1 次提交
    • C
      powerpc/perf/hv-24x7: parse catalog and populate sysfs with events · 5c5cd7b5
      Cody P Schafer 提交于
      Retrieves and parses the 24x7 catalog on POWER systems that supply it
      (right now, only POWER 8). Events are exposed via sysfs in the standard
      fashion, and are all parameterized.
      
      	$ cd /sys/bus/event_source/devices/hv_24x7/events
      
      	$ cat HPM_CS_FROM_L4_LDATA__PHYS_CORE
      	domain=0x2,offset=0xd58,core=?,lpar=0x0
      
      	$ cat HPM_TLBIE__VCPU_HOME_CHIP
      	domain=0x4,offset=0x358,vcpu=?,lpar=?
      
      where user is required to specify values for the fields with '?' (like
      core, vcpu, lpar above), when specifying the event with the perf tool.
      
      Catalog is (at the moment) only parsed on boot. It needs re-parsing
      when a some hypervisor events occur. At that point we'll also need to
      prevent old events from continuing to function (counter that is passed
      in via spare space in the config values?).
      Signed-off-by: NCody P Schafer <cody@linux.vnet.ibm.com>
      Signed-off-by: NSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: NMichael Ellerman <mpe@ellerman.id.au>
      5c5cd7b5
  17. 12 12月, 2014 1 次提交