From 7c1e81c883aff4e2501fea6b855cb2fb0fecfa67 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 20 Sep 2021 23:25:12 +0900 Subject: 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 --- kmtrace/ktrace.c | 18 ------------------ 1 file changed, 18 deletions(-) diff --git a/kmtrace/ktrace.c b/kmtrace/ktrace.c index dcc321e5..699d1571 100644 --- a/kmtrace/ktrace.c +++ b/kmtrace/ktrace.c @@ -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() { -- cgit v1.2.1