Go to file
Denys Vlasenko 8050cdc43c Tweaks for -c: fixed setitimer/getitimer hack; optimized call_summary_pers()
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>
2013-03-07 12:27:40 +01:00
debian Prepare for 4.7 release 2012-05-02 12:34:56 +00:00
linux Disable STREAMS syscalls for non-SPARC 2013-03-05 16:50:12 +01:00
m4 Implement prlimit64 decoding, rewrite [gs]etrlimit decoding 2012-03-16 19:05:21 +00:00
qemu_multiarch_testing Slight tweak to qemu_multiarch_testing scripts 2012-03-21 11:32:55 +01:00
test Clean up mmap decoding 2013-02-19 11:54:36 +01:00
tests Fix trace=set regression introduced by commit v4.7-111-g9cbc15b 2013-03-01 16:22:02 +00:00
.gitignore linux/ioctlent: unify them all 2011-03-14 15:32:38 +00:00
.mailmap Remove duplicate names from CREDITS 2012-05-01 21:51:38 +00:00
AUTHORS 2002-12-22 Roland McGrath <roland@redhat.com> 2002-12-30 00:51:30 +00:00
bjm.c Merge adjacent tprint's 2013-02-23 20:07:44 +01:00
block.c Fix wrongly indented closing curly brace. No code changes 2013-03-05 17:46:19 +01:00
ChangeLog-CVS Generate ChangeLog from git log 2009-07-08 21:01:21 +00:00
configure.ac Add support for Imagination Technologies Meta 2013-03-05 12:57:06 +01:00
COPYRIGHT Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
count.c Tweaks for -c: fixed setitimer/getitimer hack; optimized call_summary_pers() 2013-03-07 12:27:40 +01:00
CREDITS.in Remove duplicate names from CREDITS 2012-05-01 21:51:38 +00:00
defs.h Open-code isprint(c) and isspace(c) 2013-03-06 23:44:23 +01:00
desc.c Remove code which supports systems with long long off_t. 2013-02-18 15:47:57 +01:00
errnoent.sh Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
file.c Open-code isprint(c) and isspace(c) 2013-03-06 23:44:23 +01:00
git-set-file-times * git-set-file-times: Import from rsync. 2009-10-09 23:07:28 +00:00
gitlog-to-changelog gitlog-to-changelog: update from gnulib 2011-11-05 13:32:27 +00:00
HACKING-scripts HACKING-scripts: new doc file by Mike Frysinger 2009-02-23 07:56:01 +00:00
INSTALL Remove and update documentation 2012-02-25 15:29:21 +01:00
io.c Create and use struct_sysent and struct_ioctlent typedefs. 2013-02-22 13:26:10 +01:00
ioctl.c Create and use struct_sysent and struct_ioctlent typedefs. 2013-02-22 13:26:10 +01:00
ioctlsort.c Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
ipc.c Merge adjacent tprint's 2013-02-23 20:07:44 +01:00
loop.c Use %d printf format instead of %i everywhere 2012-05-16 12:29:09 +02:00
make-dist Generate an xz tar archive of the distribution 2011-02-27 14:05:58 +00:00
Makefile.am Makefile: add commented-out tweak to generate link map 2013-03-06 18:59:09 +01:00
mem.c Use sysconf(_SC_PAGESIZE) instead of hardcoded PAGE_SHIFT 2013-03-05 16:03:53 +00:00
mtd.c Use %d printf format instead of %i everywhere 2012-05-16 12:29:09 +02:00
net.c Handle recv[m]msg for non-native 32-bit personality syscalls 2013-02-12 11:57:48 +01:00
NEWS maint: post-release administrivia 2012-05-02 23:00:34 +00:00
pathtrace.c Stop using a large static buffer in getfdpath 2013-03-06 18:24:34 +01:00
process.c Add support for Imagination Technologies Meta 2013-03-05 12:57:06 +01:00
quota.c Enhance quotactl decoding 2012-10-26 23:43:13 +00:00
README Remove and update documentation 2012-02-25 15:29:21 +01:00
README-hacking doc: describe documentation policy 2012-05-03 01:44:49 +00:00
README-linux Cleanup trailing whitespaces and indentation that uses spaces before tabs 2009-07-08 14:57:27 +00:00
README-linux-ptrace README-linux-ptrace: correct the description of suppressed signals 2012-02-09 19:57:52 +01:00
resource.c Macroize conditional signed widening operation 2013-02-15 14:58:52 +01:00
scsi.c Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
signal.c Mass replace error_msg("%s", "literal") -> error_msg("literal") 2013-02-26 12:30:09 +01:00
signalent.sh Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
sock.c Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
strace-graph Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
strace-log-merge strace-log-merge: fix file suffix calculation 2012-03-26 12:10:01 +00:00
strace.1 Use dynamically-sized selected[] array for -P PATH 2013-03-05 15:46:34 +01:00
strace.c Remove variable tracing_paths and check in pathtrace_match 2013-03-05 16:01:53 +01:00
strace.spec Prepare for 4.7 release 2012-05-02 12:34:56 +00:00
stream.c Disable STREAMS syscalls for non-SPARC 2013-03-05 16:50:12 +01:00
syscall.c Emit better message for ERESTARTNOHAND return 2013-03-05 16:56:35 +01:00
syscallent.sh Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
system.c Add support for the OpenRISC 1000 platform 2013-02-14 13:38:27 +01:00
term.c Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00
time.c Update STA_* constants 2012-05-01 21:17:51 +00:00
util.c Open-code isprint(c) and isspace(c) 2013-03-06 23:44:23 +01:00
vsprintf.c strace_vfprintf: if malloc fails, exit gracefully 2013-03-05 17:29:18 +01:00
xlate.el Tidy up includes and copyright notices, fix indentation 2012-03-16 12:02:22 +01:00

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.