IMX53 on recent 4.4.x kernels
Lucas Stach
l.stach at pengutronix.de
Thu Jul 20 08:14:00 PDT 2017
Am Donnerstag, den 20.07.2017, 15:06 +0000 schrieb Vellemans, Noel:
> Hi ,
[...]
>
> ====BEGIN- Test-code=======================================================================================
>
> #include <stdio.h>
> #include<stdlib.h>
> #include<string.h>
> #include<unistd.h>
> #include<fcntl.h>
> #include <time.h>
> #include <sys/times.h>
>
>
>
> #define MS_TICKTIME2 ({\
> struct timespec tp;\
> clock_gettime(4, &tp);\
> (unsigned long)tp.tv_sec*1000+tp.tv_nsec/1000000;})
clock_gettime is one of the things which get optimized into "not a
syscall at all" if your kernel provides a VDSO. Are you sure your new
kernel configuration has CONFIG_VDSO enabled?
Regards,
Lucas
>
>
> int main(int argc, char* argv[])
> {
> unsigned long mainloopcount=20000000;
> unsigned long t2,t1;
> printf("TestCode-1\n");
> printf("Going to loop %ld times.\n",mainloopcount);
> t1=MS_TICKTIME2;
> do{
> /* just do some call to the kernel .. */
> volatile unsigned long t3=MS_TICKTIME2;
> t3++; /* whatever increment this as dummy operation*/
> } while(--mainloopcount);
> t2=MS_TICKTIME2;
> printf("%ld-%ld = >%ld ms \n",t2,t1,((signed long)t2-(signed long)t1));
>
> return 0;
> }
More information about the linux-arm-kernel
mailing list