This is an automated email from the ASF dual-hosted git repository.
wwbmmm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brpc.git
The following commit(s) were added to refs/heads/master by this push:
new 00dcd13d Support max width of flame graph image (#2452)
00dcd13d is described below
commit 00dcd13da4bc7410cbd64a0cec5e785117d860d5
Author: Bright Chen <[email protected]>
AuthorDate: Mon Nov 27 17:24:12 2023 +0800
Support max width of flame graph image (#2452)
---
src/brpc/builtin/hotspots_service.cpp | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/brpc/builtin/hotspots_service.cpp
b/src/brpc/builtin/hotspots_service.cpp
index adb38d70..b70266f4 100644
--- a/src/brpc/builtin/hotspots_service.cpp
+++ b/src/brpc/builtin/hotspots_service.cpp
@@ -113,6 +113,9 @@ DEFINE_int32(max_profiles_kept, 32,
"max profiles kept for cpu/heap/growth/contention respectively");
BRPC_VALIDATE_GFLAG(max_profiles_kept, PassValidate);
+DEFINE_int32(max_flame_graph_width, 1200, "max width of flame graph image");
+BRPC_VALIDATE_GFLAG(max_flame_graph_width, PositiveInteger);
+
static const char* const PPROF_FILENAME = "pprof.pl";
static int DEFAULT_PROFILING_SECONDS = 10;
static size_t CONCURRENT_PROFILING_LIMIT = 256;
@@ -495,7 +498,8 @@ static void DisplayResult(Controller* cntl,
if (display_type == DisplayType::kFlameGraph) {
// For flamegraph, we don't care about pprof error msg,
// which will cause confusing messages in the final result.
- cmd_builder << " 2>/dev/null " << " | " << "perl " << flamegraph_tool;
+ cmd_builder << " 2>/dev/null | perl " << flamegraph_tool << "
--width "
+ << (FLAGS_max_flame_graph_width > 0 ?
FLAGS_max_flame_graph_width : 1200);
}
cmd_builder << " 2>&1 ";
#elif defined(OS_MACOSX)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]