IF YOU WOULD LIKE TO GET AN ACCOUNT, please write an
email to Administrator. User accounts are meant only to access repo
and report issues and/or generate pull requests.
This is a purpose-specific Git hosting for
BaseALT
projects. Thank you for your understanding!
Только зарегистрированные пользователи имеют доступ к сервису!
Для получения аккаунта, обратитесь к администратору.
count_syscall() was calling setitimer/getitimer once in order to find
smallest "tick" OS uses in time accounting, in order to use it
for syscalls which apparently spent less than that time in syscall.
The code assumed that this "tick" is not zero... but it is zero
on linux-3.6.11. Which means that this hack doesn't work...
At least this change prevents this measurement from being done
_repeatedly_, by initializing one_tick to -1, not 0.
While at it, added comments in count_syscall() explaining what we are doing.
Optimized call_summary_pers() a bit, by eliminating redundant tv -> float
conversions, and prevented 0.0/0.0 which was resulting in "% time"
being shown as "-nan" if total CPU time spent was 0.000000
(try "strace -c /bin/true").
The code seems to seriously underestimate CPU usage:
"strace -c ls -lR /usr/share >/dev/null" shows total time spent
in syscalls to be only ~10..20% of what "time ls -lR /usr/share >/dev/null"
shows.
It might be useful to have a mode where we show wall clock time
spent in syscalls, not CPU time. It might also be more accurate.
text data bss dec hex filename
245019 676 5708 251403 3d60b strace_old
244923 684 5676 251283 3d593 strace
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This is strace, a system call tracer for Linux.
strace is released under a Berkeley-style license at the request
of Paul Kranenburg; see the file COPYRIGHT for details.
See the file CREDITS for a list of authors and other contributors.
See the file INSTALL for compilation and installation instructions.
See the file NEWS for information on what has changed in recent
versions.
You can get the latest version of strace from its homepage at
http://sourceforge.net/projects/strace/ .
Please send bug reports and enhancements to the strace
mailinglist at strace-devel@lists.sourceforge.net.