I saw so many links showing that the strace is listing gettimeofday as a syscall in its output, but in my case I feel like it is getting broken down to other calls. Am i missing anything ?
I am running in VM on linux 4.4 kernel and ubuntu 16.04
root@ak-dev-1:~# cat trial.c && gcc trial.c && strace -c ./a.out
#include <stdio.h>
#include <sys/time.h>
#include <unistd.h>
int main() {
struct timeval tv;
gettimeofday(&tv, NULL);
printf("%lu.%lu\n", tv.tv_sec, tv.tv_usec);
}
1584465316.623916
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
0.00 0.000000 0 1 read
0.00 0.000000 0 1 write
0.00 0.000000 0 2 open
0.00 0.000000 0 2 close
0.00 0.000000 0 3 fstat
0.00 0.000000 0 7 mmap
0.00 0.000000 0 4 mprotect
0.00 0.000000 0 1 munmap
0.00 0.000000 0 3 brk
0.00 0.000000 0 3 3 access
0.00 0.000000 0 1 execve
0.00 0.000000 0 1 arch_prctl
------ ----------- ----------- --------- --------- ----------------
100.00 0.000000 29 3 total
root@ak-dev-1:~# uname -a
Linux ak-dev-1 4.4.0-137-generic #163-Ubuntu SMP Mon Sep 24 13:14:43 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux