ktrace: let both parent and child processes write into the log file.

This makes sure all malloc/realloc/free operations are correctly logged,
although there is a summary section for each process.

As a rule of thumb, when monitoring malloc operations it is recommended
to run the program with the '--nofork' argument to avoid the fork
operation in first place.

Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
pull/12/head
Michele Calgaro 3 years ago
parent cf63191672
commit 7c1e81c883
Signed by: MicheleC
GPG Key ID: 2A75B7CA8ADED5CF

@ -816,24 +816,6 @@ kuntrace()
write(2, "kuntrace()\n", 11);
}
int fork()
{
int result;
if (mallstream)
fflush(mallstream);
result = __fork();
if (result == 0)
{
if (mallstream)
{
close(fileno(mallstream));
mallstream = NULL;
}
}
return result;
}
static int my_mcount_lock = 0;
void mcount()
{

Loading…
Cancel
Save