This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[RFC][13570] Suppress creation of gmon files.
- From: OndÅej BÃlka <neleai at seznam dot cz>
- To: libc-alpha at sourceware dot org
- Date: Fri, 25 Oct 2013 22:32:52 +0200
- Subject: [RFC][13570] Suppress creation of gmon files.
- Authentication-results: sourceware.org; auth=none
Hi, this bug ask if we could provide support of controling gmon.out
files. I would prefer to solve this issue by overriding _mcleanup with
LD_PRELOAD library like:
void _mcleanup (void)
{
if (user condition)
{
void (*p)() = dlsym (RTLD_NEXT, "_mcleanup");
p ();
}
}
This could cause problems when compiler decides not return plt version.
If that would not work then next solution could be adding a environment
variable for it.
Makes sense?
[BZ #13570]
* gmon/gmon.c (_mcleanup): Do not write gmon file when
GLIBC_NOGMON_OUT is defined.
diff --git a/gmon/gmon.c b/gmon/gmon.c
index 9774d57..35d0cee 100644
--- a/gmon/gmon.c
+++ b/gmon/gmon.c
@@ -424,7 +424,7 @@ _mcleanup (void)
{
__moncontrol (0);
- if (_gmonparam.state != GMON_PROF_ERROR)
+ if (!getenv ("GLIBC_NOGMON_OUT") && _gmonparam.state != GMON_PROF_ERROR)
write_gmon ();
/* free the memory. */