summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2021-09-20 23:25:12 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2021-09-23 17:11:39 +0900
commite03b85e865367ed930dd6464a5ac9714c2dcb66b (patch)
tree1a06755bf0f445329059946cc42e549232ff70a2
parent443e9d7cf59bb88f8920628405b2e1c6aaf770d0 (diff)
downloadtdesdk-e03b85e8.tar.gz
tdesdk-e03b85e8.zip
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> (cherry picked from commit 7c1e81c883aff4e2501fea6b855cb2fb0fecfa67)
-rw-r--r--kmtrace/ktrace.c18
1 files changed, 0 insertions, 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()
{