aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kernel/cpu/perf_counter.c
Commit message (Collapse)AuthorAge
* perfcounters: remove warningsIngo Molnar2008-12-23
| | | | | | Impact: remove debug checks Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86: perf_counter.c intel_perfmon_event_map and max_intel_perfmon_events ↵Jaswinder Singh2008-12-19
| | | | | | | | | | | | | should be static Impact: cleanup, avoid sparse warnings, reduce kernel size a bit Fixes these sparse warnings: arch/x86/kernel/cpu/perf_counter.c:44:11: warning: symbol 'intel_perfmon_event_map' was not declared. Should it be static? arch/x86/kernel/cpu/perf_counter.c:54:11: warning: symbol 'max_intel_perfmon_events' was not declared. Should it be static? Signed-off-by: Jaswinder Singh <jaswinder@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* perfcounters: fix lapic initializationIngo Molnar2008-12-14
| | | | | | Fix non-working NMI sampling in certain bootup scenarios. Signed-off-by: Ingo Molnar <mingo@elte.hu>
* perfcounters: fix non-intel-perfmon CPUsIngo Molnar2008-12-14
| | | | | | Do not write MSR_CORE_PERF_GLOBAL_CTRL on CPUs where it does not exist. Signed-off-by: Ingo Molnar <mingo@elte.hu>
* perfcounters: restructure x86 counter mathIngo Molnar2008-12-14
| | | | | | | | | | | Impact: restructure code Change counter math from absolute values to clear delta logic. We try to extract elapsed deltas from the raw hw counter - and put that into the generic counter. Signed-off-by: Ingo Molnar <mingo@elte.hu>
* Merge branch 'x86/irq' into perfcounters/coreIngo Molnar2008-12-12
| | | | ( with manual semantic merge of arch/x86/kernel/cpu/perf_counter.c )
* perf counters: clean up state transitionsIngo Molnar2008-12-11
| | | | | | | | | | | | | | | 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: Ingo Molnar <mingo@elte.hu>
* perf counters: consolidate hw_perf save/restore APIsIngo Molnar2008-12-11
| | | | | | | | | | | 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: Ingo Molnar <mingo@elte.hu>
* perf counters: implement PERF_COUNT_CPU_CLOCKIngo Molnar2008-12-11
| | | | | | | | | | | | | 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: Ingo Molnar <mingo@elte.hu>
* perf counters: hw driver APIIngo Molnar2008-12-11
| | | | | | | | | | | | | | | | | | | 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: Ingo Molnar <mingo@elte.hu>
* perf counters: add support for group countersIngo Molnar2008-12-11
| | | | | | | | | | | | | | | | | | | | | | 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: Ingo Molnar <mingo@elte.hu>
* perf counters: restructure the APIIngo Molnar2008-12-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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: Ingo Molnar <mingo@elte.hu>
* perf counters: expand use of counter->eventThomas Gleixner2008-12-11
| | | | | | | | | Impact: change syscall, cleanup Make use of the new perf_counters event type. Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* perf counters: protect them against CSTATE transitionsThomas Gleixner2008-12-11
| | | | | | | | | | | | 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: Thomas Gleixner <tglx@linutronix.de> Signed-off-by: Ingo Molnar <mingo@elte.hu>
* perfcounters: consolidate global-disable codepathsIngo Molnar2008-12-09
| | | | | | | | Impact: cleanup Simplify global disable handling. Signed-off-by: Ingo Molnar <mingo@elte.hu>
* perfcounters, x86: clean up debug codeIngo Molnar2008-12-09
| | | | | | | | Impact: cleanup Get rid of unused debug code. Signed-off-by: Ingo Molnar <mingo@elte.hu>
* perfcounters, x86: simplify disable/enable of countersIngo Molnar2008-12-09
| | | | | | | | | | Impact: fix spurious missed counter wakeups In the case of NMI events, close a race window that can occur if an NMI hits counter code that temporarily disables+enables a counter, and the NMI leaks into the disabled section. Signed-off-by: Ingo Molnar <mingo@elte.hu>
* x86, perfcounters: read out MSR_CORE_PERF_GLOBAL_STATUS with counters disabledIngo Molnar2008-12-08
| | | | | | | | | | | | Impact: make perfcounter NMI and IRQ sequence more robust Make __smp_perf_counter_interrupt() a bit more conservative: first disable all counters, then read out the status. Most invocations are because there are real events, so there's no performance impact. Code flow gets a bit simpler as well this way. Signed-off-by: Ingo Molnar <mingo@elte.hu>
* performance counters: x86 supportIngo Molnar2008-12-08
Implement performance counters for x86 Intel CPUs. It's simplified right now: the PERFMON CPU feature is assumed, which is available in Core2 and later Intel CPUs. The design is flexible to be extended to more CPU types as well. Signed-off-by: Ingo Molnar <mingo@elte.hu>