File tree Expand file tree Collapse file tree 4 files changed +230
-229
lines changed
Expand file tree Collapse file tree 4 files changed +230
-229
lines changed Original file line number Diff line number Diff line change 1- obj-m+ =hello .o
1+ obj-m+ =uncached_ram .o
22
33all :
44 make -C /lib/modules/$(shell uname -r) /build/ M=$(PWD ) modules
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -75,30 +75,25 @@ int main(int ac, char **av)
7575 else
7676 map = malloc (size ); /* test normal memory */
7777
78- unsigned int * pt = ((unsigned int * )map );
79- /* uncached mem should start with 0xdeadbeaf */
80- printf ("read %#0x\n" , * pt );
81- //if (uncached_mem_test) assert(*pt == 0xdeadbeaf);
82- //printf("sizeof(off_t): %i\n", sizeof(off_t));
8378
8479 /*********************************************************************/
85- /* benchmark reads */
80+ /* Read benchmarks */
8681
8782 double time_start = time_now ();
8883
84+ unsigned int * pt = ((unsigned int * )map );
8985 int tsize = size / sizeof (int );
90- //int t[tsize];
9186 #define STEP 10
9287 unsigned int sum = 0 ;
93- int reads = 0 ;
88+ unsigned int reads = 0 ;
9489 for (int i = 0 ; i < tsize - STEP ; i ++ )
9590 for (int k = 0 ; k < 10 ; k ++ )
9691 for (int j = 0 ; j < STEP ; j ++ ) {
9792 sum += pt [i + j ];
9893 reads ++ ;
9994 }
10095
101- printf ("%s mem test: %i reads in %.2fs (sum: %i)\n" ,
96+ printf ("%s mem test: %u reads in %.2fs (sum: %i)\n" ,
10297 (uncached_mem_test ? "uncached" : "cached" ),
10398 reads , time_now () - time_start , sum );
10499}
You can’t perform that action at this time.
0 commit comments