From 97dcdc7c96276f34a126d0485d23c592b77a212e Mon Sep 17 00:00:00 2001 From: compudj Date: Wed, 29 Mar 2006 17:03:44 +0000 Subject: [PATCH] first test git-svn-id: http://ltt.polymtl.ca/svn@1728 04897980-b3bd-0310-b5e0-8ef037075253 --- tests/kernel/Makefile | 4 +++- tests/kernel/module-template.c | 6 +++++- tests/kernel/test-time-probe.c | 37 ++++++++++++++++++++++++++++++++-- 3 files changed, 43 insertions(+), 4 deletions(-) diff --git a/tests/kernel/Makefile b/tests/kernel/Makefile index e971a885..3a16de31 100644 --- a/tests/kernel/Makefile +++ b/tests/kernel/Makefile @@ -1,6 +1,8 @@ ifneq ($(KERNELRELEASE),) ifneq ($(CONFIG_LTT),) - 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 + 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 endif else diff --git a/tests/kernel/module-template.c b/tests/kernel/module-template.c index 29f870b3..e153a5b4 100644 --- a/tests/kernel/module-template.c +++ b/tests/kernel/module-template.c @@ -12,7 +12,11 @@ static int ltt_test_init(void) { printk(KERN_ALERT "test init\n"); - return 0; + + + printf(KERN_ALERT "test end\n"); + + return -EAGAIN; /* Fail will directly unload the module */ } static void ltt_test_exit(void) diff --git a/tests/kernel/test-time-probe.c b/tests/kernel/test-time-probe.c index 29f870b3..587b4533 100644 --- a/tests/kernel/test-time-probe.c +++ b/tests/kernel/test-time-probe.c @@ -4,15 +4,48 @@ */ +#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"); - - return 0; + + local_irq_save(flags); + for(i=0; i