update
authorcompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 8 Apr 2008 04:58:23 +0000 (04:58 +0000)
committercompudj <compudj@04897980-b3bd-0310-b5e0-8ef037075253>
Tue, 8 Apr 2008 04:58:23 +0000 (04:58 +0000)
git-svn-id: http://ltt.polymtl.ca/svn@2872 04897980-b3bd-0310-b5e0-8ef037075253

markers-test/Makefile
markers-test/cachectl.c [new file with mode: 0644]
markers-test/runtest.sh

index 4499bb27f9589dbd056c6e431c9efdda1452ba45..d07a82928c45ce5427d764952ae3baca0c715abe 100644 (file)
@@ -4,6 +4,7 @@ ifneq ($(KERNELRELEASE),)
        obj-m += test-mark-speed-edit.o
        obj-m += test-mark-speed-opt.o
        obj-m += test-mark-speed-local.o
+       obj-m += cachectl.o
 else
        KERNELDIR ?= /lib/modules/$(shell uname -r)/build
        PWD := $(shell pwd)
diff --git a/markers-test/cachectl.c b/markers-test/cachectl.c
new file mode 100644 (file)
index 0000000..7bbea8a
--- /dev/null
@@ -0,0 +1,30 @@
+#include <linux/kernel.h>
+#include <linux/module.h>
+
+int init_module()
+{
+  unsigned tmp;
+    
+  /* Disable cache */
+    
+  asm volatile ("movl  %%cr0, %0\n\t"
+                "orl   $0x40000000, %0\n\t"
+                "wbinvd\n\t"
+                "movl  %0, %%cr0\n\t"
+                "wbinvd\n\t"
+                : "=r" (tmp) : : "memory");
+
+  return 0;
+}
+
+void cleanup_module()
+{
+  unsigned tmp;
+
+  asm volatile ("movl  %%cr0, %0\n\t"
+                "andl   $0xbfffffff, %0\n\t"
+                "wbinvd\n\t"
+                "movl  %0, %%cr0\n\t"
+                "wbinvd\n\t"
+                : "=r" (tmp) : : "memory");
+}
index 0f2901210848a6ad3277f58d90bb1ce379713d2e..986a6e16ac6f1214b74fdbbfcead9f6e7f1976a7 100644 (file)
@@ -41,8 +41,10 @@ rmmod test-mark-speed-local
 RESNOPLOCAL=`dmesg |grep "cycles : " |tail -n 10 |sed 's/^\[.*\] //'| sed 's/cycles : \(.*\)$/\1/'`
 
 
-make clean
-make EXTRA_CFLAGS=-DCACHEFLUSH
+#make clean
+#make EXTRA_CFLAGS=-DCACHEFLUSH
+
+modprobe cachectl
 
 insmod test-mark-speed-empty.ko
 cat /proc/testmark
@@ -79,6 +81,7 @@ rmmod test-mark-speed-local
 RESNOPLOCALFL=`dmesg |grep "cycles : " |tail -n 10 |sed 's/^\[.*\] //'| sed 's/cycles : \(.*\)$/\1/'`
 
 
+rmmod cachectl
 
 
 echo "Results in cycles per loop"
This page took 0.024788 seconds and 4 git commands to generate.