From b2cfacd53a760a97e7921466ed9636bbb4e1d0d5 Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Thu, 13 Feb 2025 12:39:28 +0000 Subject: [PATCH 01/12] Optionally link in profiler library --- meson.build | 22 ++++++++++++++++++++-- meson_options.txt | 1 + 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index b600a80667..145ed35002 100644 --- a/meson.build +++ b/meson.build @@ -36,7 +36,7 @@ gtksourceview_dep = dependency('gtksourceview-4') peas_dep = dependency('libpeas-1.0') peasgtk_dep = dependency('libpeas-gtk-1.0') git_dep = dependency('libgit2-glib-1.0') -fontconfig_dep = dependency('fontconfig') +fontconfig_dep = dependency('fontconfig') pangofc_dep = dependency('pangoft2') posix_dep = meson.get_compiler('vala').find_library('posix') vte_dep = dependency('vte-2.91') @@ -65,7 +65,7 @@ dependencies = [ pangofc_dep, posix_dep, vala_dep, - vte_dep + vte_dep, ] git = find_program('git', required: false) @@ -75,6 +75,24 @@ if get_option('development') and git.found () branch = output.stdout().strip() endif +# Profiler linking code taken from https://github.com/RidgeRun/gst-inference/blob/master/meson.build +# 'libprofiler' is provided by installing (e.g.) 'gperf-tools' +# Profiling is not active unless the correct environment variables are set at runtime +# See https://github.com/gperftools/gperftools/blob/master/docs/cpuprofile.adoc +# and https://github.com/gperftools/gperftools/blob/master/docs/heapprofile.adoc +if get_option('enable-profiling').enabled() + profiler_dep = dependency('libprofiler') + if(profiler_dep.found()) + message('Profiling enabled: Building examples with profiling support.') + link_flags += ['-lprofiler'] + c_flags += ['-DPROFILING'] + # Update test test_deps to include profiler dependency + test_deps += [profiler_dep] + else + message('MESON_FAIL gperftools profiling library not found.') + endif +endif + subdir('data') subdir('src') if get_option('plugins') diff --git a/meson_options.txt b/meson_options.txt index a299238b52..b6e18eccc0 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,3 +1,4 @@ option ('plugins', type : 'boolean', value : true) option('have_pkexec', type : 'boolean', value : 'true', description : 'Allow launching with pkexec. Should not be used in FlatPak') option('development', type : 'boolean', value : false, description : 'Build is a development branch') +option('enable-profiling', type : 'feature', value : 'disabled', yield : true, description: 'Enable profiling building') From d8236bd1fe9d8fa9bb4a6ccd9a0a96870f817f1a Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Thu, 13 Feb 2025 16:59:40 +0000 Subject: [PATCH 02/12] Get profiler to link properly --- meson.build | 12 ++++++------ meson_options.txt | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/meson.build b/meson.build index 145ed35002..a83ae365ee 100644 --- a/meson.build +++ b/meson.build @@ -80,19 +80,19 @@ endif # Profiling is not active unless the correct environment variables are set at runtime # See https://github.com/gperftools/gperftools/blob/master/docs/cpuprofile.adoc # and https://github.com/gperftools/gperftools/blob/master/docs/heapprofile.adoc -if get_option('enable-profiling').enabled() - profiler_dep = dependency('libprofiler') +if get_option('profiling-enabled') + profiler_dep = dependency ('libprofiler') if(profiler_dep.found()) message('Profiling enabled: Building examples with profiling support.') - link_flags += ['-lprofiler'] - c_flags += ['-DPROFILING'] - # Update test test_deps to include profiler dependency - test_deps += [profiler_dep] + add_global_link_arguments ('-lprofiler', language: 'c') + add_project_arguments ('--define=PROFILING', language: 'vala') + dependencies += profiler_dep else message('MESON_FAIL gperftools profiling library not found.') endif endif + subdir('data') subdir('src') if get_option('plugins') diff --git a/meson_options.txt b/meson_options.txt index b6e18eccc0..9d098d9504 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,4 +1,4 @@ option ('plugins', type : 'boolean', value : true) option('have_pkexec', type : 'boolean', value : 'true', description : 'Allow launching with pkexec. Should not be used in FlatPak') option('development', type : 'boolean', value : false, description : 'Build is a development branch') -option('enable-profiling', type : 'feature', value : 'disabled', yield : true, description: 'Enable profiling building') +option('profiling-enabled', type : 'boolean', value : true, description: 'Enable profiling building') From e200988354402aed9c60164754438d9f944c08ac Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Thu, 13 Feb 2025 17:00:06 +0000 Subject: [PATCH 03/12] Add libprofiler.vapi and start/stop profiling in code --- src/Application.vala | 15 +++++++++++++++ vapi/libprofiler.vapi | 7 +++++++ 2 files changed, 22 insertions(+) create mode 100644 vapi/libprofiler.vapi diff --git a/src/Application.vala b/src/Application.vala index 10c131d380..84f3e7974e 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -197,7 +197,22 @@ namespace Scratch { } public static int main (string[] args) { +// By default, profile whole app when profiling is enabled in meson_options.txt +// These conditional statements can be moved to profile sections of code +// The gperftools library must be installed (libgoogle-perftools-dev) +// Amend the profile report path as required +// Visualize the profile with e.g. google-pprof --functions --text io.elementary.code +// Use --focus= and --ignore= to filter/prune nodes displayed +#if PROFILING + var profile_path = Path.build_filename (Environment.get_home_dir (), "Application.prof"); + Profiler.start (profile_path); + warning ("start profiling"); +#endif return new Application ().run (args); +#if PROFILING + Profiler.stop (); + warning ("stop profiling"); +#endif } } } diff --git a/vapi/libprofiler.vapi b/vapi/libprofiler.vapi new file mode 100644 index 0000000000..eec62cbc16 --- /dev/null +++ b/vapi/libprofiler.vapi @@ -0,0 +1,7 @@ +[CCode (cheader_filename = "gperftools/profiler.h")] +namespace Profiler { + [CCode (cname = "ProfilerStart")] + public static void start (string output); + [CCode (cname = "ProfilerStop")] + public static void stop (); +} From e09efa2929ee244dad57582400c2a9af9ae38fac Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Thu, 13 Feb 2025 17:08:28 +0000 Subject: [PATCH 04/12] Amend comment and message --- meson.build | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/meson.build b/meson.build index a83ae365ee..5c245771dd 100644 --- a/meson.build +++ b/meson.build @@ -77,13 +77,15 @@ endif # Profiler linking code taken from https://github.com/RidgeRun/gst-inference/blob/master/meson.build # 'libprofiler' is provided by installing (e.g.) 'gperf-tools' -# Profiling is not active unless the correct environment variables are set at runtime +# Profiling is not active unless either the correct environment variables are set at runtime +# or the profiling is switched on/off in the code using the PROFILING conditional compilation flag +# with the commands Profiler.start () and Profiler.stop () # See https://github.com/gperftools/gperftools/blob/master/docs/cpuprofile.adoc # and https://github.com/gperftools/gperftools/blob/master/docs/heapprofile.adoc if get_option('profiling-enabled') profiler_dep = dependency ('libprofiler') if(profiler_dep.found()) - message('Profiling enabled: Building examples with profiling support.') + message('Profiling enabled: Building with profiling support.') add_global_link_arguments ('-lprofiler', language: 'c') add_project_arguments ('--define=PROFILING', language: 'vala') dependencies += profiler_dep From f882e09eb4352594d16aa46a0cbb7dc380d9717f Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Thu, 13 Feb 2025 18:21:15 +0000 Subject: [PATCH 05/12] Add optional heap profiling --- meson.build | 19 +++++++++++++++---- meson_options.txt | 3 ++- src/Application.vala | 27 +++++++++++++++++++++------ vapi/libprofiler.vapi | 4 +++- vapi/libtcmalloc.vapi | 9 +++++++++ 5 files changed, 50 insertions(+), 12 deletions(-) create mode 100644 vapi/libtcmalloc.vapi diff --git a/meson.build b/meson.build index 5c245771dd..2f59660c1f 100644 --- a/meson.build +++ b/meson.build @@ -36,7 +36,7 @@ gtksourceview_dep = dependency('gtksourceview-4') peas_dep = dependency('libpeas-1.0') peasgtk_dep = dependency('libpeas-gtk-1.0') git_dep = dependency('libgit2-glib-1.0') -fontconfig_dep = dependency('fontconfig') +fontconfig_dep = dependency('fontconfig') pangofc_dep = dependency('pangoft2') posix_dep = meson.get_compiler('vala').find_library('posix') vte_dep = dependency('vte-2.91') @@ -82,15 +82,26 @@ endif # with the commands Profiler.start () and Profiler.stop () # See https://github.com/gperftools/gperftools/blob/master/docs/cpuprofile.adoc # and https://github.com/gperftools/gperftools/blob/master/docs/heapprofile.adoc -if get_option('profiling-enabled') +if get_option('cpu-profiling-enabled') profiler_dep = dependency ('libprofiler') + heap_profiler_dep = dependency ('libtcmalloc') if(profiler_dep.found()) - message('Profiling enabled: Building with profiling support.') + message('CPU profiling enabled: Building with profiling support.') add_global_link_arguments ('-lprofiler', language: 'c') add_project_arguments ('--define=PROFILING', language: 'vala') dependencies += profiler_dep else - message('MESON_FAIL gperftools profiling library not found.') + message('MESON_FAIL: CPU profiling requested but libprofiler (gperftools) not found.') + endif +endif +if get_option('heap-profiling-enabled') + if(heap_profiler_dep.found()) + message('Heap profiling enabled: Building with heap profiling support.') + add_global_link_arguments ('-ltcmalloc', language: 'c') + add_project_arguments ('--define=HEAP_PROFILING', language: 'vala') + dependencies += heap_profiler_dep + else + message('MESON_FAIL: Heap profiling requested but libtcmalloc (gperftools) not found.') endif endif diff --git a/meson_options.txt b/meson_options.txt index 9d098d9504..18b8870fd4 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,4 +1,5 @@ option ('plugins', type : 'boolean', value : true) option('have_pkexec', type : 'boolean', value : 'true', description : 'Allow launching with pkexec. Should not be used in FlatPak') option('development', type : 'boolean', value : false, description : 'Build is a development branch') -option('profiling-enabled', type : 'boolean', value : true, description: 'Enable profiling building') +option('cpu-profiling-enabled', type : 'boolean', value : true, description: 'Enable profiling building') +option('heap-profiling-enabled', type : 'boolean', value : true, description: 'Enable profiling building') diff --git a/src/Application.vala b/src/Application.vala index 84f3e7974e..dee00660c7 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -200,18 +200,33 @@ namespace Scratch { // By default, profile whole app when profiling is enabled in meson_options.txt // These conditional statements can be moved to profile sections of code // The gperftools library must be installed (libgoogle-perftools-dev) -// Amend the profile report path as required -// Visualize the profile with e.g. google-pprof --functions --text io.elementary.code -// Use --focus= and --ignore= to filter/prune nodes displayed +// Amend the profile report paths as required #if PROFILING - var profile_path = Path.build_filename (Environment.get_home_dir (), "Application.prof"); + // Visualize the cpu profile with e.g. google-pprof --functions --gv /usr/bin/io.elementary.code + // Use --focus= and --ignore= to filter/prune nodes displayed + var profile_path = Path.build_filename (Environment.get_home_dir (), "ApplicationCPU.prof"); + // Start CPU profiling Profiler.start (profile_path); - warning ("start profiling"); + warning ("start cpu profiling - output to %s", profile_path); #endif +#if HEAP_PROFILING + // Visualize the profile with e.g. google-pprof --gv /usr/bin/io.elementary.code + // Use --focus= and --ignore= to filter/prune nodes displayed + var heap_profile_path = Path.build_filename (Environment.get_home_dir (), "ApplicationHeap"); + // Start heap profiling + HeapProfiler.start (heap_profile_path); + warning ("start heap profiling - output to %s", heap_profile_path); +#endif + return new Application ().run (args); + #if PROFILING Profiler.stop (); - warning ("stop profiling"); + warning ("stop cpu profiling"); +#endif +#if HEAP_PROFILING + HeapProfiler.stop (); + warning ("stop heap profiling"); #endif } } diff --git a/vapi/libprofiler.vapi b/vapi/libprofiler.vapi index eec62cbc16..e597a147b5 100644 --- a/vapi/libprofiler.vapi +++ b/vapi/libprofiler.vapi @@ -1,7 +1,9 @@ [CCode (cheader_filename = "gperftools/profiler.h")] namespace Profiler { [CCode (cname = "ProfilerStart")] - public static void start (string output); + public static void start (string path_to_output_file); [CCode (cname = "ProfilerStop")] public static void stop (); + [CCode (cname = "ProfilerFlush")] + public static void flush (); } diff --git a/vapi/libtcmalloc.vapi b/vapi/libtcmalloc.vapi new file mode 100644 index 0000000000..35303b7b2a --- /dev/null +++ b/vapi/libtcmalloc.vapi @@ -0,0 +1,9 @@ +[CCode (cheader_filename = "gperftools/heap-profiler.h")] +namespace HeapProfiler { + [CCode (cname = "HeapProfilerStart")] + public static void start (string path_to_output_file_profix); + [CCode (cname = "HeapProfilerStop")] + public static void stop (); + [CCode (cname = "HeapProfilerDump")] + public static void dump (string reason); +} From 6fac0b7bcfbab39c076a0afbf5b9d021d574ac96 Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Thu, 13 Feb 2025 18:24:01 +0000 Subject: [PATCH 06/12] Default to profiling off --- meson_options.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 18b8870fd4..96faa9e2f1 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,5 +1,5 @@ option ('plugins', type : 'boolean', value : true) option('have_pkexec', type : 'boolean', value : 'true', description : 'Allow launching with pkexec. Should not be used in FlatPak') option('development', type : 'boolean', value : false, description : 'Build is a development branch') -option('cpu-profiling-enabled', type : 'boolean', value : true, description: 'Enable profiling building') -option('heap-profiling-enabled', type : 'boolean', value : true, description: 'Enable profiling building') +option('cpu-profiling-enabled', type : 'boolean', value : false, description: 'Enable profiling building') +option('heap-profiling-enabled', type : 'boolean', value : false, description: 'Enable profiling building') From 82bf65f9e2bb8abd8ba6d0cecb392e207e6af176 Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Thu, 13 Feb 2025 18:33:54 +0000 Subject: [PATCH 07/12] Amend comments, remove extra comma --- meson.build | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/meson.build b/meson.build index 2f59660c1f..df7a3ab6d1 100644 --- a/meson.build +++ b/meson.build @@ -65,7 +65,7 @@ dependencies = [ pangofc_dep, posix_dep, vala_dep, - vte_dep, + vte_dep ] git = find_program('git', required: false) @@ -76,10 +76,11 @@ if get_option('development') and git.found () endif # Profiler linking code taken from https://github.com/RidgeRun/gst-inference/blob/master/meson.build -# 'libprofiler' is provided by installing (e.g.) 'gperf-tools' +# with some amendments +# 'libprofiler' and 'libtcmalloc' are provided by installing (e.g.) 'google-perftools' and 'google-pertools-dev' # Profiling is not active unless either the correct environment variables are set at runtime -# or the profiling is switched on/off in the code using the PROFILING conditional compilation flag -# with the commands Profiler.start () and Profiler.stop () +# or the profiling is switched on/off in the code using the CPU_PROFILING and HEAP_PROFILING conditional compilation flags +# with the commands Profiler.start () and Profiler.stop () and the corresponding HeapProfiler functions # See https://github.com/gperftools/gperftools/blob/master/docs/cpuprofile.adoc # and https://github.com/gperftools/gperftools/blob/master/docs/heapprofile.adoc if get_option('cpu-profiling-enabled') From 68838713bfdc5f3039de589887a4d5320bd9c06d Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Thu, 13 Feb 2025 18:37:24 +0000 Subject: [PATCH 08/12] Amend option descriptions --- meson_options.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meson_options.txt b/meson_options.txt index 96faa9e2f1..5ad8468aff 100644 --- a/meson_options.txt +++ b/meson_options.txt @@ -1,5 +1,5 @@ option ('plugins', type : 'boolean', value : true) option('have_pkexec', type : 'boolean', value : 'true', description : 'Allow launching with pkexec. Should not be used in FlatPak') option('development', type : 'boolean', value : false, description : 'Build is a development branch') -option('cpu-profiling-enabled', type : 'boolean', value : false, description: 'Enable profiling building') -option('heap-profiling-enabled', type : 'boolean', value : false, description: 'Enable profiling building') +option('cpu-profiling-enabled', type : 'boolean', value : false, description: 'Enable cpu profiling') +option('heap-profiling-enabled', type : 'boolean', value : false, description: 'Enable heap profiling') From e7802918650871d69890d435fe46a46671217b00 Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Thu, 13 Feb 2025 18:37:39 +0000 Subject: [PATCH 09/12] Fix heap profiling withut cpu profiling --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index df7a3ab6d1..bf8f9301d2 100644 --- a/meson.build +++ b/meson.build @@ -85,7 +85,6 @@ endif # and https://github.com/gperftools/gperftools/blob/master/docs/heapprofile.adoc if get_option('cpu-profiling-enabled') profiler_dep = dependency ('libprofiler') - heap_profiler_dep = dependency ('libtcmalloc') if(profiler_dep.found()) message('CPU profiling enabled: Building with profiling support.') add_global_link_arguments ('-lprofiler', language: 'c') @@ -96,6 +95,7 @@ if get_option('cpu-profiling-enabled') endif endif if get_option('heap-profiling-enabled') + heap_profiler_dep = dependency ('libtcmalloc') if(heap_profiler_dep.found()) message('Heap profiling enabled: Building with heap profiling support.') add_global_link_arguments ('-ltcmalloc', language: 'c') From 8306f27b6f63dd38c74b75d745fa702880b34ad8 Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Thu, 13 Feb 2025 18:47:56 +0000 Subject: [PATCH 10/12] Amend comments and path names --- src/Application.vala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Application.vala b/src/Application.vala index dee00660c7..f4b93f9f4f 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -202,17 +202,20 @@ namespace Scratch { // The gperftools library must be installed (libgoogle-perftools-dev) // Amend the profile report paths as required #if PROFILING + // The output path will have the suffix '.prof' appended // Visualize the cpu profile with e.g. google-pprof --functions --gv /usr/bin/io.elementary.code // Use --focus= and --ignore= to filter/prune nodes displayed - var profile_path = Path.build_filename (Environment.get_home_dir (), "ApplicationCPU.prof"); + var profile_path = Path.build_filename (Environment.get_home_dir (), "Application"); // Start CPU profiling Profiler.start (profile_path); warning ("start cpu profiling - output to %s", profile_path); #endif #if HEAP_PROFILING + // NOTE: Heap profiling at this point slows the program down **a lot** It will take tens of seconds to load. + // The output path will have the suffix '.NNNN.heap' appended // Visualize the profile with e.g. google-pprof --gv /usr/bin/io.elementary.code // Use --focus= and --ignore= to filter/prune nodes displayed - var heap_profile_path = Path.build_filename (Environment.get_home_dir (), "ApplicationHeap"); + var heap_profile_path = Path.build_filename (Environment.get_home_dir (), "Application"); // Start heap profiling HeapProfiler.start (heap_profile_path); warning ("start heap profiling - output to %s", heap_profile_path); From f6c61dabd81ad9e486b8b9f1bbbc51b17179c50f Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Fri, 21 Feb 2025 18:11:39 +0000 Subject: [PATCH 11/12] Correct dev library --- meson.build | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/meson.build b/meson.build index bf8f9301d2..1e6991d359 100644 --- a/meson.build +++ b/meson.build @@ -77,7 +77,7 @@ endif # Profiler linking code taken from https://github.com/RidgeRun/gst-inference/blob/master/meson.build # with some amendments -# 'libprofiler' and 'libtcmalloc' are provided by installing (e.g.) 'google-perftools' and 'google-pertools-dev' +# 'libprofiler' and 'libtcmalloc' are provided by installing (e.g.) 'google-perftools' and 'libgoogle-pertools-dev' # Profiling is not active unless either the correct environment variables are set at runtime # or the profiling is switched on/off in the code using the CPU_PROFILING and HEAP_PROFILING conditional compilation flags # with the commands Profiler.start () and Profiler.stop () and the corresponding HeapProfiler functions From 44f0609cfa8b108e7dfd5aabb90da9298106fc03 Mon Sep 17 00:00:00 2001 From: Jeremy Wootten Date: Fri, 21 Feb 2025 18:16:36 +0000 Subject: [PATCH 12/12] More comments, customized output file names --- meson.build | 2 ++ src/Application.vala | 5 ++--- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/meson.build b/meson.build index 1e6991d359..79d58aade1 100644 --- a/meson.build +++ b/meson.build @@ -81,6 +81,8 @@ endif # Profiling is not active unless either the correct environment variables are set at runtime # or the profiling is switched on/off in the code using the CPU_PROFILING and HEAP_PROFILING conditional compilation flags # with the commands Profiler.start () and Profiler.stop () and the corresponding HeapProfiler functions +# It is advisable not to run cpu profiling at the same time as heap profiling +# If meson options are changed then rebuild with 'cd .. && sudo rm -R ./build && build' # See https://github.com/gperftools/gperftools/blob/master/docs/cpuprofile.adoc # and https://github.com/gperftools/gperftools/blob/master/docs/heapprofile.adoc if get_option('cpu-profiling-enabled') diff --git a/src/Application.vala b/src/Application.vala index f4b93f9f4f..b797a8e954 100644 --- a/src/Application.vala +++ b/src/Application.vala @@ -202,10 +202,9 @@ namespace Scratch { // The gperftools library must be installed (libgoogle-perftools-dev) // Amend the profile report paths as required #if PROFILING - // The output path will have the suffix '.prof' appended // Visualize the cpu profile with e.g. google-pprof --functions --gv /usr/bin/io.elementary.code // Use --focus= and --ignore= to filter/prune nodes displayed - var profile_path = Path.build_filename (Environment.get_home_dir (), "Application"); + var profile_path = Path.build_filename (Environment.get_home_dir (), "CpuProfileCodeApplication.prof"); // Start CPU profiling Profiler.start (profile_path); warning ("start cpu profiling - output to %s", profile_path); @@ -215,7 +214,7 @@ namespace Scratch { // The output path will have the suffix '.NNNN.heap' appended // Visualize the profile with e.g. google-pprof --gv /usr/bin/io.elementary.code // Use --focus= and --ignore= to filter/prune nodes displayed - var heap_profile_path = Path.build_filename (Environment.get_home_dir (), "Application"); + var heap_profile_path = Path.build_filename (Environment.get_home_dir (), "HeapProfileCodeApplication"); // Start heap profiling HeapProfiler.start (heap_profile_path); warning ("start heap profiling - output to %s", heap_profile_path);