1. 28 2月, 2009 2 次提交
  2. 11 2月, 2009 1 次提交
    • P
      perf_counters: allow users to count user, kernel and/or hypervisor events · 0475f9ea
      Paul Mackerras 提交于
      Impact: new perf_counter feature
      
      This extends the perf_counter_hw_event struct with bits that specify
      that events in user, kernel and/or hypervisor mode should not be
      counted (i.e. should be excluded), and adds code to program the PMU
      mode selection bits accordingly on x86 and powerpc.
      
      For software counters, we don't currently have the infrastructure to
      distinguish which mode an event occurs in, so we currently fail the
      counter initialization if the setting of the hw_event.exclude_* bits
      would require us to distinguish.  Context switches and CPU migrations
      are currently considered to occur in kernel mode.
      
      On x86, this changes the previous policy that only root can count
      kernel events.  Now non-root users can count kernel events or exclude
      them.  Non-root users still can't use NMI events, though.  On x86 we
      don't appear to have any way to control whether hypervisor events are
      counted or not, so hw_event.exclude_hv is ignored.
      
      On powerpc, the selection of whether to count events in user, kernel
      and/or hypervisor mode is PMU-wide, not per-counter, so this adds a
      check that the hw_event.exclude_* settings are the same as other events
      on the PMU.  Counters being added to a group have to have the same
      settings as the other hardware counters in the group.  Counters and
      groups can only be enabled in hw_perf_group_sched_in or power_perf_enable
      if they have the same settings as any other counters already on the
      PMU.  If we are not running on a hypervisor, the exclude_hv setting
      is ignored (by forcing it to 0) since we can't ever get any
      hypervisor events.
      Signed-off-by: NPaul Mackerras <paulus@samba.org>
      0475f9ea
  3. 09 2月, 2009 1 次提交
  4. 05 2月, 2009 1 次提交
  5. 23 1月, 2009 3 次提交
  6. 27 12月, 2008 1 次提交
  7. 23 12月, 2008 10 次提交
  8. 20 12月, 2008 1 次提交
  9. 15 12月, 2008 3 次提交
  10. 11 12月, 2008 8 次提交
    • I
      perf counters: clean up state transitions · 6a930700
      Ingo Molnar 提交于
      Impact: cleanup
      
      Introduce a proper enum for the 3 states of a counter:
      
      	PERF_COUNTER_STATE_OFF		= -1
      	PERF_COUNTER_STATE_INACTIVE	=  0
      	PERF_COUNTER_STATE_ACTIVE	=  1
      
      and rename counter->active to counter->state and propagate the
      changes everywhere.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      6a930700
    • I
      perf counters: consolidate hw_perf save/restore APIs · 01b2838c
      Ingo Molnar 提交于
      Impact: cleanup
      
      Rename them to better match up the usual IRQ disable/enable APIs:
      
       hw_perf_disable_all()  => hw_perf_save_disable()
       hw_perf_restore_ctrl() => hw_perf_restore()
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      01b2838c
    • I
      perf counters: implement PERF_COUNT_CPU_CLOCK · 5c92d124
      Ingo Molnar 提交于
      Impact: add new perf-counter type
      
      The 'CPU clock' counter counts the amount of CPU clock time that is
      elapsing, in nanoseconds. (regardless of how much of it the task is
      spending on a CPU executing)
      
      This counter type is a Linux kernel based abstraction, it is available
      even if the hardware does not support native hardware performance counters.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      5c92d124
    • I
      perf counters: hw driver API · 621a01ea
      Ingo Molnar 提交于
      Impact: restructure code, introduce hw_ops driver abstraction
      
      Introduce this abstraction to handle counter details:
      
       struct hw_perf_counter_ops {
      	void (*hw_perf_counter_enable)	(struct perf_counter *counter);
      	void (*hw_perf_counter_disable)	(struct perf_counter *counter);
      	void (*hw_perf_counter_read)	(struct perf_counter *counter);
       };
      
      This will be useful to support assymetric hw details, and it will also
      be useful to implement "software counters". (Counters that count kernel
      managed sw events such as pagefaults, context-switches, wall-clock time
      or task-local time.)
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      621a01ea
    • I
      perf counters: add support for group counters · 04289bb9
      Ingo Molnar 提交于
      Impact: add group counters
      
      This patch adds the "counter groups" abstraction.
      
      Groups of counters behave much like normal 'single' counters, with a
      few semantic and behavioral extensions on top of that.
      
      A counter group is created by creating a new counter with the open()
      syscall's group-leader group_fd file descriptor parameter pointing
      to another, already existing counter.
      
      Groups of counters are scheduled in and out in one atomic group, and
      they are also roundrobin-scheduled atomically.
      
      Counters that are member of a group can also record events with an
      (atomic) extended timestamp that extends to all members of the group,
      if the record type is set to PERF_RECORD_GROUP.
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      04289bb9
    • I
      perf counters: restructure the API · 9f66a381
      Ingo Molnar 提交于
      Impact: clean up new API
      
      Thorough cleanup of the new perf counters API, we now get clean separation
      of the various concepts:
      
       - introduce perf_counter_hw_event to separate out the event source details
      
       - move special type flags into separate attributes: PERF_COUNT_NMI,
         PERF_COUNT_RAW
      
       - extend the type to u64 and reserve it fully to the architecture in the
         raw type case.
      
      And make use of all these changes in the core and x86 perfcounters code.
      
      Also change the syscall signature to:
      
        asmlinkage int sys_perf_counter_open(
      
      	struct perf_counter_hw_event	*hw_event_uptr		__user,
      	pid_t				pid,
      	int				cpu,
      	int				group_fd);
      
      ( Note that group_fd is unused for now - it's reserved for the counter
        groups abstraction. )
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      9f66a381
    • T
      perf counters: expand use of counter->event · dfa7c899
      Thomas Gleixner 提交于
      Impact: change syscall, cleanup
      
      Make use of the new perf_counters event type.
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      dfa7c899
    • T
      perf counters: protect them against CSTATE transitions · 4ac13294
      Thomas Gleixner 提交于
      Impact: fix rare lost events problem
      
      There are CPUs whose performance counters misbehave on CSTATE transitions,
      so provide a way to just disable/enable them around deep idle methods.
      
      (hw_perf_enable_all() is cheap on x86.)
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      4ac13294
  11. 10 12月, 2008 3 次提交
  12. 08 12月, 2008 2 次提交