From 26c9702b7e90ca207ee162424529fd0755390ef1 Mon Sep 17 00:00:00 2001 From: compudj Date: Wed, 29 Mar 2006 17:40:51 +0000 Subject: [PATCH] first test git-svn-id: http://ltt.polymtl.ca/svn@1730 04897980-b3bd-0310-b5e0-8ef037075253 --- tests/kernel/Makefile | 2 +- tests/kernel/module-template.c | 35 ++++++++++++++++++++++++++++++++-- tests/kernel/test-time-probe.c | 2 ++ 3 files changed, 36 insertions(+), 3 deletions(-) diff --git a/tests/kernel/Makefile b/tests/kernel/Makefile index cc8bd836..89428311 100644 --- a/tests/kernel/Makefile +++ b/tests/kernel/Makefile @@ -2,7 +2,7 @@ ifneq ($(KERNELRELEASE),) ifneq ($(CONFIG_LTT),) obj-m += ltt-facility-loader-tests.o obj-m += test-time-probe.o - #test-l1-hit-probe.o test-int-response.o test-instrument-size-small.o test-instrument-size-med.o test-instrument-size-big.o test-time-precision.o + #test-l1-hit-probe.o test-instrument-size-small.o test-instrument-size-med.o test-instrument-size-big.o endif else diff --git a/tests/kernel/module-template.c b/tests/kernel/module-template.c index e153a5b4..9ee86e50 100644 --- a/tests/kernel/module-template.c +++ b/tests/kernel/module-template.c @@ -4,17 +4,48 @@ */ +#define CONFIG_LTT_FACILITY_TESTS +#include "ltt-facility-tests.h" + #include #include #include + +/* Event logged : 4 bytes + 20 bytes header = 24 bytes. Let's use 1MB of + * buffers. 1MB / 24bytes = 43690. So, if we write 20000 event, we should not + * lose events. Check event lost count after tests. */ + +#define NR_LOOPS 20000 + static int ltt_test_init(void) { + unsigned int i; + cycles_t time1, time2, time; + cycles_t max_time = 0, min_time = 18446744073709551615ULL; /* (2^64)-1 */ + cycles_t tot_time = 0; + unsigned long flags; printk(KERN_ALERT "test init\n"); - + local_irq_save(flags); + for(i=0; i #include #include + /* Event logged : 4 bytes + 20 bytes header = 24 bytes. Let's use 1MB of * buffers. 1MB / 24bytes = 43690. So, if we write 20000 event, we should not * lose events. Check event lost count after tests. */ -- 2.34.1