summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremie Koenig <jk@jk.fr.eu.org>2010-08-25 05:47:08 +0000
committerJeremie Koenig <jk@jk.fr.eu.org>2010-08-30 14:31:33 +0200
commitf708dd1262df8033d4709dbba1da026e8b92f669 (patch)
treec8b44c3930fb7ba5da81605ea1c2c120d20c1506
parent2ceddf5449bb99683e096b39120a602a5de6a6ec (diff)
Add a PROFILE mode
* Makefile: Change FOOFLAGS defaults to appropriate values when $(PROFILE) is defined. * rootdir.c: Add an "exit" file, which causes exit to be called when looked up, so that profiling data can be written to disk.
-rw-r--r--rootdir.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/rootdir.c b/rootdir.c
index c6ddd87c..204bc02b 100644
--- a/rootdir.c
+++ b/rootdir.c
@@ -422,6 +422,15 @@ static const struct procfs_dir_entry rootdir_entries[] = {
.cleanup_contents = procfs_cleanup_contents_with_free,
},
},
+#ifdef PROFILE
+ /* In order to get a usable gmon.out file, we must apparently use exit(). */
+ {
+ .name = "exit",
+ .ops = {
+ .make_node = exit,
+ },
+ },
+#endif
{}
};