ifneq ($(KERNELRELEASE),)
ifneq ($(CONFIG_LTT),)
- obj-m += ltt-facility-loader-tests.o
-# obj-m += test-time-probe.o
- obj-m += test-time-probe2.o
- obj-m += test-compact.o
+ #obj-m += ltt-facility-loader-tests.o
+# #obj-m += test-time-probe.o
+ #obj-m += test-time-probe2.o
+ #obj-m += test-compact.o
# obj-m += ltt-facility-loader-compact.o
# obj-m += test-instrument-size-small.o
# obj-m += test-instrument-size-med.o
# obj-m += test-instrument-size-big.o
# obj-m += test-printk-effect.o
endif
- obj-m += test-debugfs.o
+ obj-m += test-async-tsc.o
+ obj-m += test-tsc-sync.o
+ obj-m += test-hpet.o
+ #obj-m += test-debugfs.o
# obj-m += test-mod.o
# obj-m += atomic-pIII-cmx.o
- obj-m += test-hotplug.o
- obj-m += rdtsc-smp.o
- obj-m += test-local.o
- obj-m += test-ser.o
+ #obj-m += test-hotplug.o
+ #obj-m += rdtsc-smp.o
+ #obj-m += test-local.o
+ #obj-m += test-ser.o
# obj-m += test-cmpxchg.o
# obj-m += test-cmpxchg-nolock.o
# obj-m += test-spinlock.o
#obj-m += test-kprobes.o
#obj-m += test-printk.o
#obj-m += test-debugfs.o
- obj-m += test-mark.o
- obj-m += test-markxmc.o
+ #obj-m += test-mark.o
+ #obj-m += test-markxmc.o
# obj-m += probe.o
# obj-m += test-irqloop.o
#obj-m += marker-loader.o
--- /dev/null
+/* test-tsc-sync.c
+ *
+ * Test TSC sync
+ */
+
+
+#include <linux/module.h>
+#include <linux/timer.h>
+#include <asm/timex.h>
+#include <linux/jiffies.h>
+
+static DEFINE_PER_CPU(cycles_t, count) = 0;
+
+static struct timer_list test_timer;
+
+/* IPI called on each CPU. */
+static void test_each(void *info)
+{
+ __get_cpu_var(count) = get_cycles();
+}
+
+static void do_test_timer(unsigned long data)
+{
+ int cpu;
+
+ /* Increment the counters */
+ on_each_cpu(test_each, NULL, 0, 1);
+ /* Read all the counters */
+ printk("Counters read from CPU %d\n", smp_processor_id());
+ for_each_online_cpu(cpu) {
+ printk("Read : CPU %d, count %llu\n", cpu,
+ per_cpu(count, cpu));
+ }
+ del_timer(&test_timer);
+ test_timer.expires = jiffies + 1000;
+ add_timer(&test_timer);
+}
+
+static int __init test_init(void)
+{
+ /* initialize the timer that will increment the counter */
+ init_timer(&test_timer);
+ test_timer.function = do_test_timer;
+ test_timer.expires = jiffies + 1;
+ add_timer(&test_timer);
+
+ return 0;
+}
+
+static void __exit test_exit(void)
+{
+ del_timer_sync(&test_timer);
+}
+
+module_init(test_init);
+module_exit(test_exit);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Mathieu Desnoyers");
+MODULE_DESCRIPTION("sync tsc test");
+