1. 15 Sep, 2015 9 commits
  2. 14 Sep, 2015 27 commits
  3. 13 Sep, 2015 4 commits
    • Sukadev Bhattiprolu's avatar
      perf/core: Drop PERF_EVENT_TXN · 8f3e5684
      Sukadev Bhattiprolu authored
      We currently use PERF_EVENT_TXN flag to determine if we are in the middle
      of a transaction. If in a transaction, we defer the schedulability checks
      from pmu->add() operation to the pmu->commit() operation.
      
      Now that we have "transaction types" (PERF_PMU_TXN_ADD, PERF_PMU_TXN_READ)
      we can use the type to determine if we are in a transaction and drop the
      PERF_EVENT_TXN flag.
      
      When PERF_EVENT_TXN is dropped, the cpuhw->group_flag on some architectures
      becomes unused, so drop that field as well.
      
      This is an extension of the Powerpc patch from Peter Zijlstra to s390,
      Sparc and x86 architectures.
      Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      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: Michael Ellerman <mpe@ellerman.id.au>
      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-11-git-send-email-sukadev@linux.vnet.ibm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      8f3e5684
    • Sukadev Bhattiprolu's avatar
      powerpc, perf/powerpc/hv-24x7: Use PMU_TXN_READ interface · 88a48613
      Sukadev Bhattiprolu authored
      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: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarMichael 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: default avatarIngo Molnar <mingo@kernel.org>
      88a48613
    • Sukadev Bhattiprolu's avatar
      perf/core: Define PERF_PMU_TXN_READ interface · 4a00c16e
      Sukadev Bhattiprolu authored
      Define a new PERF_PMU_TXN_READ interface to read a group of counters
      at once.
      
              pmu->start_txn()                // Initialize before first event
      
              for each event in group
                      pmu->read(event);       // Queue each event to be read
      
              rc = pmu->commit_txn()          // Read/update all queued counters
      
      Note that we use this interface with all PMUs.  PMUs that implement this
      interface use the ->read() operation to _queue_ the counters to be read
      and use ->commit_txn() to actually read all the queued counters at once.
      
      PMUs that don't implement PERF_PMU_TXN_READ ignore ->start_txn() and
      ->commit_txn() and continue to read counters one at a time.
      
      Thanks to input from Peter Zijlstra.
      Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      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: Michael Ellerman <mpe@ellerman.id.au>
      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-9-git-send-email-sukadev@linux.vnet.ibm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      4a00c16e
    • Sukadev Bhattiprolu's avatar
      perf/core: Add return value for perf_event_read() · 7d88962e
      Sukadev Bhattiprolu authored
      When we implement the ability to read several counters at once (using
      the PERF_PMU_TXN_READ transaction interface), perf_event_read() can
      fail when the 'group' parameter is true (eg: trying to read too many
      events at once).
      
      For now, have perf_event_read() return an integer. Ignore the return
      value when the 'group' parameter is false.
      Signed-off-by: default avatarSukadev Bhattiprolu <sukadev@linux.vnet.ibm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      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: Michael Ellerman <mpe@ellerman.id.au>
      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-8-git-send-email-sukadev@linux.vnet.ibm.comSigned-off-by: default avatarIngo Molnar <mingo@kernel.org>
      7d88962e