update
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 13 May 2008 19:20:42 +0000 (19:20 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 13 May 2008 19:20:42 +0000 (19:20 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2908 04897980-b3bd-0310-b5e0-8ef037075253

tests/kernel/Makefile
tests/kernel/test-int3-speed.c [new file with mode: 0644]

index a7a7d5bcebab5bf4f8ab4e833b870e66bf29444c..a246c501db0fbc89ef9e92ae8ef97b21d5c6462b 100644 (file)
@@ -18,6 +18,7 @@ endif
        obj-m += test-trace-speed.o
        obj-m += test-rcu-speed.o
        obj-m += test-fct-speed.o
+       obj-m += test-int3-speed.o
        obj-m += test-kprobes2.o
        #obj-m += test-mark-speed.o
        #obj-m += test-mark-speed-edit.o
diff --git a/tests/kernel/test-int3-speed.c b/tests/kernel/test-int3-speed.c
new file mode 100644 (file)
index 0000000..0160670
--- /dev/null
@@ -0,0 +1,65 @@
+/* test-mark.c
+ *
+ */
+
+#include <linux/module.h>
+#include <linux/proc_fs.h>
+#include <linux/sched.h>
+#include <linux/timex.h>
+#include <linux/marker.h>
+#include <asm/ptrace.h>
+
+       //asm volatile ("");
+struct proc_dir_entry *pentry = NULL;
+
+void test(unsigned long arg)
+{
+       asm volatile ("int3;\n\t");
+       //trace_mark(test_marker, "arg1 %lu arg2 %p", arg, current);
+}
+
+static int my_open(struct inode *inode, struct file *file)
+{
+       unsigned int i;
+       cycles_t cycles1, cycles2;
+       unsigned long flags;
+
+       local_irq_save(flags);
+       rdtsc_barrier();
+       cycles1 = get_cycles();
+       rdtsc_barrier();
+       for(i=0; i<20000; i++) {
+               test(i);
+       }
+       rdtsc_barrier();
+       cycles2 = get_cycles();
+       rdtsc_barrier();
+       local_irq_restore(flags);
+       printk("cycles : %llu\n", cycles2-cycles1);
+       return -EPERM;
+}
+
+
+static struct file_operations my_operations = {
+       .open = my_open,
+};
+
+int init_module(void)
+{
+       pentry = create_proc_entry("testmark", 0444, NULL);
+       if (pentry)
+               pentry->proc_fops = &my_operations;
+
+       printk("test addr %p\n", &test);
+       return 0;
+}
+
+void cleanup_module(void)
+{
+       remove_proc_entry("testmark", NULL);
+}
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Mathieu Desnoyers");
+MODULE_DESCRIPTION("Marker Test");
+
This page took 0.027744 seconds and 4 git commands to generate.