Greetings,
Can anyone tell me if the time shown with "strace -T" for each system call
is at all representative of the actual time taken when the program executes that sys_call?
For example I write a program in C with a printf("hello"); then I do a strace
with the -T option, amongst other things it displays:
write(1,"hello") <0.000050>
does it mean that the program will take 0.000050 (or 50 microseconds) to execute the printf statement or is it just relevant to strace?
Thanks.
How accurate is strace? (SOLVED)
- cat_n_mouse
- Posts: 12
- Joined: Thu 04 Aug 2011, 18:29
- Location: /usr/bin/Paulo
How accurate is strace? (SOLVED)
Last edited by cat_n_mouse on Sun 14 Aug 2011, 08:04, edited 1 time in total.
- cat_n_mouse
- Posts: 12
- Joined: Thu 04 Aug 2011, 18:29
- Location: /usr/bin/Paulo
- cat_n_mouse
- Posts: 12
- Joined: Thu 04 Aug 2011, 18:29
- Location: /usr/bin/Paulo
Solved.
I took amigos advice and this little pup went to play with the big dogs
over at linuxquestions.org
The answer lies with the kernel configuration options (CONFIG_HZ, CONFIG_NO_HZ, CONFIG_HIGH_RES_TIMERS) and hardware clocks precision.
Also running under any debugger/tracer (strace included) will incur a speed penalty,
I just didn't expect such an overhead (80uS in 100mS)
I took amigos advice and this little pup went to play with the big dogs
over at linuxquestions.org
The answer lies with the kernel configuration options (CONFIG_HZ, CONFIG_NO_HZ, CONFIG_HIGH_RES_TIMERS) and hardware clocks precision.
Also running under any debugger/tracer (strace included) will incur a speed penalty,
I just didn't expect such an overhead (80uS in 100mS)