summaryrefslogtreecommitdiffstats
path: root/upstream/debian-unstable/man3/mtrace.3
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-17 10:51:52 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-17 10:51:52 +0000
commit4ad94864781f48b1a4b77f9cfb934622bf756ba1 (patch)
tree3900955c1886e6d2570fea7125ee1f01bafe876d /upstream/debian-unstable/man3/mtrace.3
parentAdding upstream version 4.22.0. (diff)
downloadmanpages-l10n-4ad94864781f48b1a4b77f9cfb934622bf756ba1.tar.xz
manpages-l10n-4ad94864781f48b1a4b77f9cfb934622bf756ba1.zip
Adding upstream version 4.23.0.upstream/4.23.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'upstream/debian-unstable/man3/mtrace.3')
-rw-r--r--upstream/debian-unstable/man3/mtrace.323
1 files changed, 11 insertions, 12 deletions
diff --git a/upstream/debian-unstable/man3/mtrace.3 b/upstream/debian-unstable/man3/mtrace.3
index 442da6fb..8123ed98 100644
--- a/upstream/debian-unstable/man3/mtrace.3
+++ b/upstream/debian-unstable/man3/mtrace.3
@@ -3,7 +3,7 @@
.\"
.\" SPDX-License-Identifier: Linux-man-pages-copyleft
.\"
-.TH mtrace 3 2023-07-20 "Linux man-pages 6.05.01"
+.TH mtrace 3 2024-05-02 "Linux man-pages 6.8"
.SH NAME
mtrace, muntrace \- malloc tracing
.SH LIBRARY
@@ -12,7 +12,7 @@ Standard C library
.SH SYNOPSIS
.nf
.B "#include <mcheck.h>"
-.PP
+.P
.B "void mtrace(void);"
.B "void muntrace(void);"
.fi
@@ -28,7 +28,7 @@ These hook functions record tracing information about memory allocation
and deallocation.
The tracing information can be used to discover memory leaks and
attempts to free nonallocated memory in a program.
-.PP
+.P
The
.BR muntrace ()
function disables the hook functions installed by
@@ -39,7 +39,7 @@ If no hook functions were successfully installed by
.BR mtrace (),
.BR muntrace ()
does nothing.
-.PP
+.P
When
.BR mtrace ()
is called, it checks the value of the environment variable
@@ -47,7 +47,7 @@ is called, it checks the value of the environment variable
which should contain the pathname of a file in which
the tracing information is to be recorded.
If the pathname is successfully opened, it is truncated to zero length.
-.PP
+.P
If
.B MALLOC_TRACE
is not set,
@@ -75,7 +75,6 @@ T{
.BR muntrace ()
T} Thread safety MT-Unsafe
.TE
-.sp 1
.\" FIXME: The marking is different from that in the glibc manual,
.\" markings in glibc manual are more detailed:
.\"
@@ -93,7 +92,7 @@ In normal usage,
is called once at the start of execution of a program, and
.BR muntrace ()
is never called.
-.PP
+.P
The tracing output produced after a call to
.BR mtrace ()
is textual, but not designed to be human readable.
@@ -103,7 +102,7 @@ that interprets the trace log and produces human-readable output.
For best results,
the traced program should be compiled with debugging enabled,
so that line-number information is recorded in the executable.
-.PP
+.P
The tracing performed by
.BR mtrace ()
incurs a performance penalty (if
@@ -122,7 +121,7 @@ function and the
.BR mtrace (1)
command in a program that has memory leaks at two different locations.
The demonstration uses the following program:
-.PP
+.P
.in +4n
.RB "$ " "cat t_mtrace.c"
.\" SRC BEGIN (t_mtrace.c)
@@ -145,11 +144,11 @@ main(void)
.EE
.\" SRC END
.in
-.PP
+.P
When we run the program as follows, we see that
.BR mtrace ()
diagnosed memory leaks at two different locations in the program:
-.PP
+.P
.in +4n
.EX
.RB "$ " "cc \-g t_mtrace.c \-o t_mtrace"
@@ -164,7 +163,7 @@ Memory not freed:
0x084c9448 0x100 at /home/cecilia/t_mtrace.c:16
.EE
.in
-.PP
+.P
The first two messages about unfreed memory correspond to the two
.BR malloc (3)
calls inside the