cache_test doesn't need sharedlib anymore

This commit is contained in:
Lenni Hein 2025-02-25 14:36:02 +01:00
parent 71425ba3e5
commit 3799317456
2 changed files with 5 additions and 4 deletions

View File

@ -19,4 +19,5 @@ target_link_libraries(recv sharedlib)
# add the cache-test executable # add the cache-test executable
add_executable(cache_test cache_test.c lib.c lib.h) add_executable(cache_test cache_test.c lib.c lib.h)
target_link_libraries(cache_test sharedlib) # link sharedlib if you want to test on the padded addr (less chance for noise)
# target_link_libraries(cache_test sharedlib)

View File

@ -2,7 +2,6 @@
#include <stdlib.h> #include <stdlib.h>
#include <stdint.h> #include <stdint.h>
#include "lib.h" #include "lib.h"
#include "sharedlib.h"
#define NUM_ACCESSES 1000000 #define NUM_ACCESSES 1000000
@ -45,7 +44,8 @@ int main()
return 1; 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); size_t threshold = find_crossover_point(hits, misses, NUM_ACCESSES);
printf("Suggested threshold: %zu\n", threshold); printf("Suggested threshold: %zu\n", threshold);