From e1c831a43ac1945db5a52ee6873856b9399dca76 Mon Sep 17 00:00:00 2001 From: Jeremie Koenig Date: Wed, 25 Aug 2010 05:47:08 +0000 Subject: 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. --- rootdir.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'rootdir.c') 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 {} }; -- cgit v1.2.3