From: compudj Date: Tue, 13 May 2008 19:20:42 +0000 (+0000) Subject: update X-Git-Tag: v0.12.20~581 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=0526b61f03dbbac0164f9f4e21fd531a1d048119;p=lttv.git update git-svn-id: http://ltt.polymtl.ca/svn@2908 04897980-b3bd-0310-b5e0-8ef037075253 --- diff --git a/tests/kernel/Makefile b/tests/kernel/Makefile index a7a7d5bc..a246c501 100644 --- a/tests/kernel/Makefile +++ b/tests/kernel/Makefile @@ -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 index 00000000..0160670b --- /dev/null +++ b/tests/kernel/test-int3-speed.c @@ -0,0 +1,65 @@ +/* test-mark.c + * + */ + +#include +#include +#include +#include +#include +#include + + //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"); +