summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Weppner <harald.weppner@tidalscale.com>2014-03-18 07:00:14 (GMT)
committerHarald Weppner <harald.weppner@tidalscale.com>2014-03-28 20:47:59 (GMT)
commitc2da2591befa5574cf8c930a5a2cd7f56138658e (patch)
treeb594612b72f361a8627a90fd236567d76e3143f0
parent4bbf8181f384d6bd8a634b22543f83e5b949b609 (diff)
downloadjemalloc-c2da2591befa5574cf8c930a5a2cd7f56138658e.zip
jemalloc-c2da2591befa5574cf8c930a5a2cd7f56138658e.tar.gz
jemalloc-c2da2591befa5574cf8c930a5a2cd7f56138658e.tar.bz2
Consistently use debug lib(s) if present
Fixes a situation where nm uses the debug lib but addr2line does not, which completely messes up the symbol lookup.
-rw-r--r--src/prof.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/prof.c b/src/prof.c
index ede89a7..7722b7b 100644
--- a/src/prof.c
+++ b/src/prof.c
@@ -11,12 +11,6 @@
#include <unwind.h>
#endif
-#ifdef __FreeBSD__
-#define PROCESS_VMEM_MAP "/proc/curproc/map"
-#else
-#define PROCESS_VMEM_MAP "/proc/%d/maps"
-#endif
-
/******************************************************************************/
/* Data. */
@@ -941,9 +935,12 @@ prof_dump_maps(bool propagate_err)
char filename[PATH_MAX + 1];
cassert(config_prof);
-
- malloc_snprintf(filename, sizeof(filename), PROCESS_VMEM_MAP,
+#ifdef __FreeBSD__
+ malloc_snprintf(filename, sizeof(filename), "/proc/curproc/map");
+#else
+ malloc_snprintf(filename, sizeof(filename), "/proc/%d/maps",
(int)getpid());
+#endif
mfd = open(filename, O_RDONLY);
if (mfd != -1) {
ssize_t nread;