This is an automated email from the ASF dual-hosted git repository.

jiashunzhu pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-brpc.git


The following commit(s) were added to refs/heads/master by this push:
     new a2181ac  Fix build failure on macOS with FlameGraph
     new ebb8a6e  Merge pull request #1411 from gogdizzy/fix-flame-on-mac
a2181ac is described below

commit a2181ac80962f4c4a14ddb40dcd4348e35cece79
Author: gogdizzy <gogdi...@gmail.com>
AuthorDate: Sat May 22 18:01:25 2021 +0800

    Fix build failure on macOS with FlameGraph
---
 src/brpc/builtin/hotspots_service.cpp | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/brpc/builtin/hotspots_service.cpp 
b/src/brpc/builtin/hotspots_service.cpp
index b59f3f8..9d53881 100644
--- a/src/brpc/builtin/hotspots_service.cpp
+++ b/src/brpc/builtin/hotspots_service.cpp
@@ -416,11 +416,13 @@ static void DisplayResult(Controller* cntl,
         if (display_type == DisplayType::kUnknown) {
             return cntl->SetFailed(EINVAL, "Invalid display_type=%s", 
display_type_query->c_str());
         }
+#if defined(OS_LINUX)
         if (display_type == DisplayType::kFlameGraph && !flamegraph_tool) {
             return cntl->SetFailed(EINVAL, "Failed to find environment 
variable "
                 "FLAMEGRAPH_PL_PATH, please read cpu_profiler doc"
                 
"(https://github.com/brpc/brpc/blob/master/docs/cn/cpu_profiler.md)");
         }
+#endif
     }
     if (base_name != NULL) {
         if (!ValidProfilePath(*base_name)) {
@@ -885,11 +887,13 @@ static void StartProfiling(ProfilingType type,
         if (display_type == DisplayType::kUnknown) {
             return cntl->SetFailed(EINVAL, "Invalid display_type=%s", 
display_type_query->c_str());
         }
+#if defined(OS_LINUX)
         if (display_type == DisplayType::kFlameGraph && 
!getenv("FLAMEGRAPH_PL_PATH")) {
             return cntl->SetFailed(EINVAL, "Failed to find environment 
variable "
                 "FLAMEGRAPH_PL_PATH, please read cpu_profiler doc"
                 
"(https://github.com/brpc/brpc/blob/master/docs/cn/cpu_profiler.md)");
         }
+#endif
     }
 
     ProfilingClient profiling_client;

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@brpc.apache.org
For additional commands, e-mail: dev-h...@brpc.apache.org

Reply via email to