Skip to contentSkip to conversation

Oprofile for v2.6.32

GIT PULL Ingo Molnar 1 participant 1 message Sep 11, 2009 x86

lore
Share & tools
lore
#0 lore raw

Linus,

Please pull the oprofile-for-linus git tree from:

git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip.git oprofile-for-linus

Highlights:

- Multiplexing support
- lots of cleanups

Thanks,

Ingo

------------------>
Andrew Morton (1):
arch/x86/oprofile/op_model_amd.c: fix op_amd_handle_ibs() return type

Jason Yeh (1):
oprofile: Implement performance counter multiplexing

Jaswinder Singh Rajput (1):
x86: oprofile/op_model_amd.c set return values for op_amd_handle_ibs()

Maynard Johnson (1):
oprofile: reset bt_lost_no_mapping with other stats

Robert Richter (51):
Revert "oprofile: discover counters for op ppro too" x86/oprofile: moving arch_perfmon counter setup to op_x86_model_spec.init x86/oprofile: minor style changes in struct op_x86_model_spec
oprofile: remove irq_flags in struct op_entry
oprofile: remove obselete include headers
x86/oprofile: remove #ifdefs in ibs functions
x86/oprofile: simplify AMD cpu init code
x86/oprofile: move common macros to op_x86_model.h
x86/oprofile: remove MSR macros for AMD cpus
x86/oprofile: remove MSR macros for ppro cpus
x86/oprofile: remove MSR macros for p4 cpus
x86/oprofile: fix and cleanup CTRL_SET_* macros
x86/oprofile: remove unused macros for AMD virtualization profiling x86/oprofile: pass the model to setup_ctrs() functions x86/oprofile: replace macros to calculate control register x86/oprofile: replace CTR_OVERFLOWED macros
x86/oprofile: replace CTRL_SET_*ACTIVE macros
x86/oprofile: replace CTR*_IS_RESERVED macros
x86/oprofile: use 64 bit wrmsr functions
x86/oprofile: use 64 bit values to save MSR states
x86/oprofile: remove some local variables in MSR save/restore functions x86/oprofile: use 64 bit values in IBS functions
x86/oprofile: introduce oprofile_add_data64()
x86/oprofile: fix initialization of arch_perfmon for core_i7 x86/oprofile: Fix cast of counter value
x86/oprofile: Rework and simplify nmi_cpu_setup()
x86/oprofile: Whitespaces changes only
x86/oprofile: Fix usage of NUM_CONTROLS/NUM_COUNTERS macros x86/oprofile: Use per_cpu() instead of __get_cpu_var() x86/oprofile: Fix initialization of switch_index
oprofile: oprofile_set_timeout(), return with error for invalid args
oprofile: Rename variable timeout_jiffies and move to oprofile_files.c
oprofile: Remove oprofile_multiplexing_init()
oprofile: Grouping multiplexing code in oprof.c
oprofile: Introduce op_x86_phys_to_virt()
oprofile: Grouping multiplexing code in op_model_amd.c x86/oprofile: Implement multiplexing setup/shutdown functions x86/oprofile: Moving nmi_setup_cpu_mux() in nmi_int.c x86/oprofile: Moving nmi_cpu_save/restore_mpx_registers() in nmi_int.c x86/oprofile: Moving nmi_cpu_switch() in nmi_int.c
x86/oprofile: Remove const qualifier from struct op_x86_model_spec x86/oprofile: Remove unused num_virt_controls from struct op_x86_model_spec x86/oprofile: Modify initialization of num_virt_counters x86/oprofile: Add function has_mux() to check multiplexing support x86/oprofile: Enable multiplexing only if the model supports it x86/oprofile: Implement mux_clone()
oprofile: Adding switch counter to oprofile statistic variables x86/oprofile: Implement op_x86_virt_to_phys()
x86/oprofile: Add counter reservation check for virtual counters x86/oprofile: Small coding style fixes
Revert "x86: oprofile/op_model_amd.c set return values for op_amd_handle_ibs()"

 arch/Kconfig                      |   12 +
 arch/x86/oprofile/nmi_int.c       |  404 ++++++++++++++++++++++++++-----------
 arch/x86/oprofile/op_counter.h    |    2 +-
 arch/x86/oprofile/op_model_amd.c  |  372 +++++++++++++++++++---------------
 arch/x86/oprofile/op_model_p4.c   |   72 ++++----
 arch/x86/oprofile/op_model_ppro.c |  101 ++++-----
 arch/x86/oprofile/op_x86_model.h  |   59 ++++--
 drivers/oprofile/cpu_buffer.c     |   16 ++-
 drivers/oprofile/oprof.c          |   71 +++++++-
 drivers/oprofile/oprof.h          |    3 +
 drivers/oprofile/oprofile_files.c |   46 +++++
 drivers/oprofile/oprofile_stats.c |    5 +
 drivers/oprofile/oprofile_stats.h |    1 +
 include/linux/oprofile.h          |    5 +-
 14 files changed, 766 insertions(+), 403 deletions(-)
arch/Kconfig +12 -0
index 99193b1..beea3cc 100644
@@ -30,6 +30,18 @@ config OPROFILE_IBS
 
 	  If unsure, say N.
 
+config OPROFILE_EVENT_MULTIPLEX
+	bool "OProfile multiplexing support (EXPERIMENTAL)"
+	default n
+	depends on OPROFILE && X86
+	help
+	  The number of hardware counters is limited. The multiplexing
+	  feature enables OProfile to gather more events than counters
+	  are provided by the hardware. This is realized by switching
+	  between events at an user specified time interval.
+
+	  If unsure, say N.
+
 config HAVE_OPROFILE
 	bool
 
arch/x86/oprofile/nmi_int.c +288 -116

588 lines not on this page · raw message

arch/x86/oprofile/op_counter.h +1 -1
index 91b6a11..e28398d 100644
@@ -10,7 +10,7 @@
 #ifndef OP_COUNTER_H
 #define OP_COUNTER_H
 
-#define OP_MAX_COUNTER 8
+#define OP_MAX_COUNTER 32
 
 /* Per-perfctr configuration as set via
  * oprofilefs.
arch/x86/oprofile/op_model_amd.c +204 -168

509 lines not on this page · raw message

arch/x86/oprofile/op_model_p4.c +35 -37

184 lines not on this page · raw message

arch/x86/oprofile/op_model_ppro.c +45 -56

207 lines not on this page · raw message

arch/x86/oprofile/op_x86_model.h +37 -22

88 lines not on this page · raw message

drivers/oprofile/cpu_buffer.c +15 -1
index 242257b..a7aae24 100644
@@ -21,7 +21,6 @@
 
 #include <linux/sched.h>
 #include <linux/oprofile.h>
-#include <linux/vmalloc.h>
 #include <linux/errno.h>
 
 #include "event_buffer.h"
@@ -407,6 +406,21 @@ int oprofile_add_data(struct op_entry *entry, unsigned long val)
 	return op_cpu_buffer_add_data(entry, val);
 }
 
+int oprofile_add_data64(struct op_entry *entry, u64 val)
+{
+	if (!entry->event)
+		return 0;
+	if (op_cpu_buffer_get_size(entry) < 2)
+		/*
+		 * the function returns 0 to indicate a too small
+		 * buffer, even if there is some space left
+		 */
+		return 0;
+	if (!op_cpu_buffer_add_data(entry, (u32)val))
+		return 0;
+	return op_cpu_buffer_add_data(entry, (u32)(val >> 32));
+}
+
 int oprofile_write_commit(struct op_entry *entry)
 {
 	if (!entry->event)
drivers/oprofile/oprof.c +70 -1

101 lines not on this page · raw message

drivers/oprofile/oprof.h +3 -0
index c288d3c..cb92f5c 100644
@@ -24,6 +24,8 @@ struct oprofile_operations;
 extern unsigned long oprofile_buffer_size;
 extern unsigned long oprofile_cpu_buffer_size;
 extern unsigned long oprofile_buffer_watershed;
+extern unsigned long oprofile_time_slice;
+
 extern struct oprofile_operations oprofile_ops;
 extern unsigned long oprofile_started;
 extern unsigned long oprofile_backtrace_depth;
@@ -35,5 +37,6 @@ void oprofile_create_files(struct super_block *sb, struct dentry *root);
 void oprofile_timer_init(struct oprofile_operations *ops);
 
 int oprofile_set_backtrace(unsigned long depth);
+int oprofile_set_timeout(unsigned long time);
 
 #endif /* OPROF_H */
drivers/oprofile/oprofile_files.c +46 -0

74 lines not on this page · raw message

drivers/oprofile/oprofile_stats.c +5 -0
index 3c2270a..61689e8 100644
@@ -34,6 +34,7 @@ void oprofile_reset_stats(void)
 	atomic_set(&oprofile_stats.sample_lost_no_mapping, 0);
 	atomic_set(&oprofile_stats.event_lost_overflow, 0);
 	atomic_set(&oprofile_stats.bt_lost_no_mapping, 0);
+	atomic_set(&oprofile_stats.multiplex_counter, 0);
 }
 
 
@@ -76,4 +77,8 @@ void oprofile_create_stats_files(struct super_block *sb, struct dentry *root)
 		&oprofile_stats.event_lost_overflow);
 	oprofilefs_create_ro_atomic(sb, dir, "bt_lost_no_mapping",
 		&oprofile_stats.bt_lost_no_mapping);
+#ifdef CONFIG_OPROFILE_EVENT_MULTIPLEX
+	oprofilefs_create_ro_atomic(sb, dir, "multiplex_counter",
+		&oprofile_stats.multiplex_counter);
+#endif
 }
drivers/oprofile/oprofile_stats.h +1 -0
index 3da0d08..0b54e46 100644
@@ -17,6 +17,7 @@ struct oprofile_stat_struct {
 	atomic_t sample_lost_no_mapping;
 	atomic_t bt_lost_no_mapping;
 	atomic_t event_lost_overflow;
+	atomic_t multiplex_counter;
 };
 
 extern struct oprofile_stat_struct oprofile_stats;
include/linux/oprofile.h +4 -1
index 1d9518b..5171639 100644
@@ -67,6 +67,9 @@ struct oprofile_operations {
 
 	/* Initiate a stack backtrace. Optional. */
 	void (*backtrace)(struct pt_regs * const regs, unsigned int depth);
+
+	/* Multiplex between different events. Optional. */
+	int (*switch_events)(void);
 	/* CPU identification string. */
 	char * cpu_type;
 };
@@ -171,7 +174,6 @@ struct op_sample;
 struct op_entry {
 	struct ring_buffer_event *event;
 	struct op_sample *sample;
-	unsigned long irq_flags;
 	unsigned long size;
 	unsigned long *data;
 };
@@ -180,6 +182,7 @@ void oprofile_write_reserve(struct op_entry *entry,
 			    struct pt_regs * const regs,
 			    unsigned long pc, int code, int size);
 int oprofile_add_data(struct op_entry *entry, unsigned long val);
+int oprofile_add_data64(struct op_entry *entry, u64 val);
 int oprofile_write_commit(struct op_entry *entry);
 
 #endif /* OPROFILE_H */