newbie question

John Hughes john at calva.com
Sun Mar 30 09:39:12 UTC 2003


> When I use strace /bin/echo foobar
> I get this output
>  strace -c /bin/echo foobar   
> execve("/bin/echo", ["/bin/echo"], [/* 64 vars */]) = 0
> 
> % time     seconds  usecs/call     calls    errors syscall
> ------ ----------- ----------- --------- --------- ----------------
>  29.26    0.000189           7        29        13 open
...
>   0.62    0.000004           4         1           uname
>   0.62    0.000004           4         1           mprotect
> ------ ----------- ----------- --------- --------- ----------------
> 100.00    0.000646                    97        13 total
> 
> I want to know how many sys call he made/used for executing this binairy
> I just can't believe he made 97 for this simple programme

Yup, that's it, 97 syscalls to do an echo.  What system are you on?  My
UnixWare does 4 calls (exec, ioctl, brk, write (+ exit)).  Aha, it seems
you're using some kind of Linux, my Redhat system does 84 calls,
most to do do with loading locale info.  Why does echo need locale
info?  (what on earth could echo do with LC_TELEPHONE?) .

> and what could errors syscall mean any info would help

13 of those syscalls (all "open") failed.

Do the strace without the "-c" option to see what syscalls failed and why.





More information about the Strace-devel mailing list