aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2010-06-08 10:38:48 +0000
committerNick Clifton <nickc@redhat.com>2010-06-08 10:38:48 +0000
commitede501f418518c00cacde27516e9de0d94692d96 (patch)
tree93d7ee781e66fc3ab5e7469075996046517faae2
parent9fbcbd8145b538d4e48d7f8a13b8949bc2197ed7 (diff)
downloadgdb-ede501f418518c00cacde27516e9de0d94692d96.zip
gdb-ede501f418518c00cacde27516e9de0d94692d96.tar.gz
gdb-ede501f418518c00cacde27516e9de0d94692d96.tar.bz2
* gprof.texi (Sampling Error): Note that call counts and basic
block counts are only reliable for multi-threaded applications if the counting function itself is thread safe.
-rw-r--r--gprof/ChangeLog6
-rw-r--r--gprof/gprof.texi12
2 files changed, 14 insertions, 4 deletions
diff --git a/gprof/ChangeLog b/gprof/ChangeLog
index 22a43f7..4370951 100644
--- a/gprof/ChangeLog
+++ b/gprof/ChangeLog
@@ -1,5 +1,11 @@
2010-06-08 Nick Clifton <nickc@redhat.com>
+ * gprof.texi (Sampling Error): Note that call counts and basic
+ block counts are only reliable for multi-threaded applications if
+ the counting function itself is thread safe.
+
+2010-06-08 Nick Clifton <nickc@redhat.com>
+
* gprof.texi: Replace abbreviated 20th century year numbers with
full versions.
diff --git a/gprof/gprof.texi b/gprof/gprof.texi
index 03074d8..70c4f88 100644
--- a/gprof/gprof.texi
+++ b/gprof/gprof.texi
@@ -1615,10 +1615,14 @@ only a small amount of time, so that on the average the sampling process
ought to catch that function in the act only once, there is a pretty good
chance it will actually find that function zero times, or twice.
-By contrast, the number-of-calls and basic-block figures
-are derived by counting, not
-sampling. They are completely accurate and will not vary from run to run
-if your program is deterministic.
+By contrast, the number-of-calls and basic-block figures are derived
+by counting, not sampling. They are completely accurate and will not
+vary from run to run if your program is deterministic and single
+threaded. In multi-threaded applications, or single threaded
+applications that link with multi-threaded libraries, the counts are
+only deterministic if the counting function is thread-safe. (Note:
+beware that the mcount counting function in glibc is @emph{not}
+thread-safe). @xref{Implementation, ,Implementation of Profiling}.
The @dfn{sampling period} that is printed at the beginning of the flat
profile says how often samples are taken. The rule of thumb is that a