summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAliaksey Kandratsenka <alkondratenko@gmail.com>2018-08-26 11:37:59 -0700
committerAliaksey Kandratsenka <alkondratenko@gmail.com>2018-08-26 11:37:59 -0700
commit954f9dc0e37ff46cb0cb24edfb39dc77fd2e7d0b (patch)
tree2bf6be31b4cefd51209b11cc084e838850719d26
parent893bff51bcf220b724a812d340d878b5fb8ce911 (diff)
downloadgperftools-954f9dc0e37ff46cb0cb24edfb39dc77fd2e7d0b.tar.gz
Add flag to disable installing unmaintained & deprecated pprof.
Everyone should be using golang pprof from github.com/google/pprof, but distros still ship our perl version and not everyone is aware of better pprof yet. This is another step in completely dropping perl pprof. We still default to installing it, but hopefully we'll be able to convince distros to disable this soon. We still install pprof under pprof-symbolize name because stack traces symbolization depends on it, and because golang pprof won't support this feature. This is related to issue #1038.
-rw-r--r--.gitignore1
-rwxr-xr-xMakefile.am11
-rw-r--r--configure.ac10
-rwxr-xr-xsrc/symbolize.cc2
4 files changed, 21 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 42328f2..1ce2460 100644
--- a/.gitignore
+++ b/.gitignore
@@ -89,6 +89,7 @@
/page_heap_test.exe
/pagemap_unittest
/pagemap_unittest.exe
+/pprof-symbolize
/profile_handler_unittest
/profiledata_unittest
/profiler1_unittest
diff --git a/Makefile.am b/Makefile.am
index 04ff5af..be1db83 100755
--- a/Makefile.am
+++ b/Makefile.am
@@ -392,7 +392,10 @@ endif WITH_STACK_TRACE
# If we are not compiling with stacktrace support, pprof is worthless
if WITH_STACK_TRACE
-bin_SCRIPTS = src/pprof
+bin_SCRIPTS = pprof-symbolize
+
+pprof-symbolize : $(top_srcdir)/src/pprof
+ cp -p $(top_srcdir)/src/pprof $@
### Unittests
@@ -403,9 +406,13 @@ pprof_unittest: $(top_srcdir)/src/pprof
# Let unittests find pprof if they need to run it
TESTS_ENVIRONMENT += PPROF_PATH=$(top_srcdir)/src/pprof
-### Documentation
+if INSTALL_PPROF
+bin_SCRIPTS += src/pprof
dist_man_MANS = docs/pprof.1
dist_doc_DATA += docs/pprof_remote_servers.html
+endif INSTALL_PPROF
+
+### Documentation
# On MSVC, we need our own versions of addr2line and nm to work with pprof.
WINDOWS_PROJECTS += vsprojects/nm-pdb/nm-pdb.vcxproj
diff --git a/configure.ac b/configure.ac
index ed69dca..c1c33e6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -346,6 +346,16 @@ AC_CACHE_CHECK([if the compiler supports -Wno-unused-result],
AM_CONDITIONAL(HAVE_W_NO_UNUSED_RESULT,
test "$perftools_cv_w_no_unused_result" = yes)
+AC_ARG_ENABLE([deprecated-pprof],
+ [AS_HELP_STRING([--disable-deprecated-pprof],
+ [do not install old deprecated and unmaintained bundled pprof
+(see github.com/google/pprof for supported version)])],
+ [enable_pprof="$enableval"],
+ [enable_pprof=yes])
+
+AM_CONDITIONAL(INSTALL_PPROF,
+ [test "x$enable_pprof" = xyes])
+
AC_ARG_ENABLE([dynamic-sized-delete-support],
[AS_HELP_STRING([--enable-dynamic-sized-delete-support],
[try to build run-time switch for sized delete operator])],
diff --git a/src/symbolize.cc b/src/symbolize.cc
index 4c71010..d28a10d 100755
--- a/src/symbolize.cc
+++ b/src/symbolize.cc
@@ -72,7 +72,7 @@ using tcmalloc::DumpProcSelfMaps; // from sysinfo.h
// a more-permanent copy that won't ever get destroyed.
static char* get_pprof_path() {
static char* result = ([] () {
- string pprof_string = EnvToString("PPROF_PATH", "pprof");
+ string pprof_string = EnvToString("PPROF_PATH", "pprof-symbolize");
return strdup(pprof_string.c_str());
})();