summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/Makefile.config5
-rw-r--r--tools/perf/Makefile.perf2
2 files changed, 7 insertions, 0 deletions
diff --git a/tools/perf/Makefile.config b/tools/perf/Makefile.config
index 063202c53b64..1783427da9b0 100644
--- a/tools/perf/Makefile.config
+++ b/tools/perf/Makefile.config
@@ -265,6 +265,11 @@ LDFLAGS += -Wl,-z,noexecstack
EXTLIBS = -lpthread -lrt -lm -ldl
+ifneq ($(TCMALLOC),)
+ CFLAGS += -fno-builtin-malloc -fno-builtin-calloc -fno-builtin-realloc -fno-builtin-free
+ EXTLIBS += -ltcmalloc
+endif
+
ifeq ($(FEATURES_DUMP),)
include $(srctree)/tools/build/Makefile.feature
else
diff --git a/tools/perf/Makefile.perf b/tools/perf/Makefile.perf
index a099a8a89447..8f1ba986d3bf 100644
--- a/tools/perf/Makefile.perf
+++ b/tools/perf/Makefile.perf
@@ -114,6 +114,8 @@ include ../scripts/utilities.mak
# Define NO_LIBZSTD if you do not want support of Zstandard based runtime
# trace compression in record mode.
#
+# Define TCMALLOC to enable tcmalloc heap profiling.
+#
# As per kernel Makefile, avoid funny character set dependencies
unexport LC_ALL