excessive use of gettimeofday(2) and other syscalls

Alexander Best arundel at freebsd.org
Tue Sep 6 22:01:15 UTC 2011


hi there,

in a recent discussion on current@ [1], it was discovered that chromium makes
excessive use of gettimeofday(2). while searching google, i found other
software that is/was having the same issue [2]. although this is a programming
error, it would still be nice, if freebsd could issue a warning in cases like
these. would it be possible to instruct freebsd to issue a warning, when a
process issues a certain amount of syscalls per second (maybe tuneable via
sysctl)?

while calling gettimeofday(2) excessively isn't causing any harm, it triggers
a lot of context switches and reduces performance. having such warnings in
place could help a user identify such a process without having to use debugging
tools, such as ktrace or dtrace.

cheers.
alex

[1] http://www.mail-archive.com/freebsd-current@freebsd.org/msg131040.html
[1] https://forum.transmissionbt.com/viewtopic.php?f=2&t=11687


More information about the freebsd-hackers mailing list