aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/core
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-01-15 15:46:39 -0800
committerGravatar Craig Tiller <ctiller@google.com>2015-01-15 15:46:39 -0800
commit297fafa078a8a43a4ddb693129b8e25b9d0bf618 (patch)
treed02a54023ea8b9b56669b36c8b287f045998c202 /test/core
parentfbf4051ef2d08d53cdb486722c1111d614865d63 (diff)
Opportunistically use perftools if installed.
Allows us to collect profiles of the open source build using gprof.
Diffstat (limited to 'test/core')
-rw-r--r--test/core/util/grpc_profiler.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/test/core/util/grpc_profiler.c b/test/core/util/grpc_profiler.c
index 340b2d53b9..489d34396a 100644
--- a/test/core/util/grpc_profiler.c
+++ b/test/core/util/grpc_profiler.c
@@ -33,6 +33,15 @@
#include "test/core/util/grpc_profiler.h"
+#if GRPC_HAVE_PERFTOOLS
+#include <gperftools/profiler.h>
+
+void grpc_profiler_start(const char *filename) { ProfilerStart(filename); }
+
+void grpc_profiler_stop() { ProfilerStop(); }
+#else
+
void grpc_profiler_start(const char *filename) {}
void grpc_profiler_stop(void) {}
+#endif