diff options
author | Harald Weppner <harald.weppner@tidalscale.com> | 2014-03-18 06:53:00 (GMT) |
---|---|---|
committer | Harald Weppner <harald.weppner@tidalscale.com> | 2014-03-18 06:53:00 (GMT) |
commit | bf543df20ccd9e2c422751908cabf073bc7f5d4b (patch) | |
tree | de8cdd4edcddb50d79f33c0c519d2eb57a018a21 /src | |
parent | 9e20df163c0c608026498b8fb5beab35e8a049c6 (diff) | |
download | jemalloc-bf543df20ccd9e2c422751908cabf073bc7f5d4b.zip jemalloc-bf543df20ccd9e2c422751908cabf073bc7f5d4b.tar.gz jemalloc-bf543df20ccd9e2c422751908cabf073bc7f5d4b.tar.bz2 |
Enable profiling / leak detection in FreeBSD
* Assumes procfs is mounted at /proc, cf.
<http://www.freebsd.org/doc/en/articles/linux-users/procfs.html>
Diffstat (limited to 'src')
-rw-r--r-- | src/prof.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -11,6 +11,12 @@ #include <unwind.h> #endif +#ifdef __FreeBSD__ +#define PROCESS_VMEM_MAP "/proc/curproc/map" +#else +#define PROCESS_VMEM_MAP "/proc/%d/maps" +#endif + /******************************************************************************/ /* Data. */ @@ -936,7 +942,7 @@ prof_dump_maps(bool propagate_err) cassert(config_prof); - malloc_snprintf(filename, sizeof(filename), "/proc/%d/maps", + malloc_snprintf(filename, sizeof(filename), PROCESS_VMEM_MAP, (int)getpid()); mfd = open(filename, O_RDONLY); if (mfd != -1) { |