You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@brpc.apache.org by ja...@apache.org on 2022/08/27 05:17:52 UTC

[incubator-brpc] branch master updated: minor fix

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

jamesge 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 33d4fe5a minor fix
33d4fe5a is described below

commit 33d4fe5a364574e2381d19042de640148ba174b4
Author: gejun.0 <ge...@bytedance.com>
AuthorDate: Sat Aug 27 13:17:30 2022 +0800

    minor fix
---
 src/brpc/builtin/hotspots_service.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/brpc/builtin/hotspots_service.cpp b/src/brpc/builtin/hotspots_service.cpp
index e6bb8944..500cb759 100644
--- a/src/brpc/builtin/hotspots_service.cpp
+++ b/src/brpc/builtin/hotspots_service.cpp
@@ -410,13 +410,15 @@ static void DisplayResult(Controller* cntl,
     const std::string* base_name = cntl->http_request().uri().GetQuery("base");
     const std::string* display_type_query = cntl->http_request().uri().GetQuery("display_type");
     DisplayType display_type = DisplayType::kDot;
+#if defined(OS_LINUX)
+    const char* flamegraph_tool = getenv("FLAMEGRAPH_PL_PATH");
+#endif
     if (display_type_query) {
         display_type = StringToDisplayType(*display_type_query);
         if (display_type == DisplayType::kUnknown) {
             return cntl->SetFailed(EINVAL, "Invalid display_type=%s", display_type_query->c_str());
         }
 #if defined(OS_LINUX)
-        const char* flamegraph_tool = getenv("FLAMEGRAPH_PL_PATH");
         if (display_type == DisplayType::kFlameGraph && !flamegraph_tool) {
             return cntl->SetFailed(EINVAL, "Failed to find environment variable "
                 "FLAMEGRAPH_PL_PATH, please read cpu_profiler doc"


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