diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 2a3cdd3..0abda86 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,4 +19,5 @@ target_link_libraries(recv sharedlib) # add the cache-test executable add_executable(cache_test cache_test.c lib.c lib.h) -target_link_libraries(cache_test sharedlib) \ No newline at end of file +# link sharedlib if you want to test on the padded addr (less chance for noise) +# target_link_libraries(cache_test sharedlib) diff --git a/src/cache_test.c b/src/cache_test.c index 2f970ca..84fa5d0 100644 --- a/src/cache_test.c +++ b/src/cache_test.c @@ -2,7 +2,6 @@ #include #include #include "lib.h" -#include "sharedlib.h" #define NUM_ACCESSES 1000000 @@ -45,7 +44,8 @@ int main() return 1; } - measure_multiple_accesses((void*) function, NUM_ACCESSES, hits, misses); + // We use the addr. of main for our test, but anything works. + measure_multiple_accesses((void*) main, NUM_ACCESSES, hits, misses); size_t threshold = find_crossover_point(hits, misses, NUM_ACCESSES); printf("Suggested threshold: %zu\n", threshold); @@ -53,4 +53,4 @@ int main() free(hits); free(misses); return 0; -} \ No newline at end of file +}