9

cache vs uncache memory access in embedded Linux

view full story
linux-howto

http://stackoverflow.com – I have an embedded target running embedded Linux and I want to calculate the following timings: 1) cache memory read/write timings 2) uncache memory read/write timings Are there any standard tests in Linux to calculate the above timings? I have written my own test that is: void *mem_src = (void*)malloc(MEM_SIZE); void *mem_dest = (void*)malloc(MEM_SIZE); clock_gettime(CLOCK_THREAD_CPUTIME_ID, &pre); memcpy(mem_dest, mem_src, MEM_SIZE); clock_gettime(CLOCK_THREAD_CPUTIME_ID, &post); printf("time %ld\n", (SEC_TO_NSEC(post.tv_sec) + post.tv_nsec) - (SEC_TO_NSEC(pre. (HowTos)