summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/ref/posix.texi15
-rw-r--r--doc/ref/statprof.texi12
2 files changed, 19 insertions, 8 deletions
diff --git a/doc/ref/posix.texi b/doc/ref/posix.texi
index 64e668d17..5cb68a292 100644
--- a/doc/ref/posix.texi
+++ b/doc/ref/posix.texi
@@ -1,7 +1,7 @@
@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
@c Copyright (C) 1996, 1997, 2000, 2001, 2002, 2003, 2004, 2006, 2007,
-@c 2008, 2009, 2010, 2011, 2012, 2013, 2014 Free Software Foundation, Inc.
+@c 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2017 Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
@node POSIX
@@ -2162,12 +2162,12 @@ expiry will be signalled.
A real-time timer, counting down elapsed real time. At zero it raises
@code{SIGALRM}. This is like @code{alarm} above, but with a higher
resolution period.
-@end defvar
+@end defvar
@defvar ITIMER_VIRTUAL
A virtual-time timer, counting down while the current process is
actually using CPU. At zero it raises @code{SIGVTALRM}.
-@end defvar
+@end defvar
@defvar ITIMER_PROF
A profiling timer, counting down while the process is running (like
@@ -2176,7 +2176,7 @@ process's behalf. At zero it raises a @code{SIGPROF}.
This timer is intended for profiling where a program is spending its
time (by looking where it is when the timer goes off).
-@end defvar
+@end defvar
@code{getitimer} returns the restart timer value and its current value,
as a list containing two pairs. Each pair is a time in seconds and
@@ -2196,6 +2196,13 @@ previous setting, in the same form as @code{getitimer} returns.
Although the timers are programmed in microseconds, the actual
accuracy might not be that high.
+
+Note that @code{ITIMER_PROF} and @code{ITIMER_VIRTUAL} are not
+functional on all platforms and may always error when called.
+@code{(provided? 'ITIMER_PROF)} and @code{(provided? 'ITIMER_VIRTUAL)}
+can be used to test if the those itimers are supported on the given
+host. @code{ITIMER_REAL} is supported on all platforms that support
+@code{setitimer}.
@end deffn
diff --git a/doc/ref/statprof.texi b/doc/ref/statprof.texi
index 65f0d473b..850c5bd2e 100644
--- a/doc/ref/statprof.texi
+++ b/doc/ref/statprof.texi
@@ -1,6 +1,6 @@
@c -*-texinfo-*-
@c This is part of the GNU Guile Reference Manual.
-@c Copyright (C) 2013, 2015 Free Software Foundation, Inc.
+@c Copyright (C) 2013, 2015, 2017 Free Software Foundation, Inc.
@c See the file guile.texi for copying conditions.
@node Statprof
@@ -128,17 +128,21 @@ After the @var{thunk} has been profiled, print out a profile to
@var{port}. If @var{display-style} is @code{flat}, the results will be
printed as a flat profile. Otherwise if @var{display-style} is
@code{tree}, print the results as a tree profile.
+
+Note that @code{statprof} requires a working profiling timer. Some
+platforms do not support profiling timers. @code{(provided?
+'ITIMER_PROF)} can be used to check for support of profiling timers.
@end deffn
Profiling can also be enabled and disabled manually.
-@deffn {Scheme Procedure} statprof-active?
+@deffn {Scheme Procedure} statprof-active?
Returns @code{#t} if @code{statprof-start} has been called more times
than @code{statprof-stop}, @code{#f} otherwise.
@end deffn
-@deffn {Scheme Procedure} statprof-start
-@deffnx {Scheme Procedure} statprof-stop
+@deffn {Scheme Procedure} statprof-start
+@deffnx {Scheme Procedure} statprof-stop
Start or stop the profiler.
@end deffn