first test
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 29 Mar 2006 17:40:51 +0000 (17:40 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Wed, 29 Mar 2006 17:40:51 +0000 (17:40 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@1730 04897980-b3bd-0310-b5e0-8ef037075253

tests/kernel/Makefile
tests/kernel/module-template.c
tests/kernel/test-time-probe.c

index cc8bd836ee4f55262d28541fbe61166c4f1dfd31..894283113f1f01e7cd9a4d7e7580075bede11208 100644 (file)
@@ -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
index e153a5b482d35d693cd478ebcc48a4c08898065b..9ee86e50160f13faca40e0b001d70da198e6d20e 100644 (file)
@@ -4,17 +4,48 @@
  */
 
 
+#define CONFIG_LTT_FACILITY_TESTS
+#include "ltt-facility-tests.h"
+
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/ltt-core.h>
 
+
+/* 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<NR_LOOPS; i++) {
+               time1 = get_cycles();
+               trace_tests_write_4bytes(5000);
+               time2 = get_cycles();
+               time = time2 - time1;
+               max_time = max(max_time, time);
+               min_time = min(min_time, time);
+               tot_time += time;
+       }
+       local_irq_restore(flags);
+
+       printk(KERN_ALERT "test results : time per probe\n");
+       printk(KERN_ALERT "number of loops : %d\n", NR_LOOPS);
+       printk(KERN_ALERT "total time : %llu\n", tot_time);
+       printk(KERN_ALERT "min : %llu\n", min_time);
+       printk(KERN_ALERT "max : %llu\n", max_time);
 
-       printf(KERN_ALERT "test end\n");
+       printk(KERN_ALERT "test end\n");
        
        return -EAGAIN; /* Fail will directly unload the module */
 }
index 587b4533d74c29be650dd4996e4a735212a8e788..9ee86e50160f13faca40e0b001d70da198e6d20e 100644 (file)
@@ -4,12 +4,14 @@
  */
 
 
+#define CONFIG_LTT_FACILITY_TESTS
 #include "ltt-facility-tests.h"
 
 #include <linux/init.h>
 #include <linux/module.h>
 #include <linux/ltt-core.h>
 
+
 /* 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. */
This page took 0.03021 seconds and 4 git commands to generate.