Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ COPTS = [
"//bazel/config:brpc_with_debug_lock": ["-DBRPC_DEBUG_LOCK=1"],
"//conditions:default": ["-DBRPC_DEBUG_LOCK=0"],
}) + select({
"@platforms//cpu:x86_64": ["-DBRPC_BTHREAD_TRACER"],
"//bazel/config:brpc_with_bthread_tracer": ["-DBRPC_BTHREAD_TRACER"],
"//conditions:default": [],
}) + select({
"//bazel/config:brpc_with_asan": ["-fsanitize=address"],
Expand Down Expand Up @@ -412,7 +412,7 @@ cc_library(
":butil",
":bvar",
] + select({
"@platforms//cpu:x86_64": ["@com_github_libunwind_libunwind//:libunwind"],
"//bazel/config:brpc_with_bthread_tracer": ["@com_github_libunwind_libunwind//:libunwind"],
"//conditions:default": [],
}),
)
Expand Down
10 changes: 10 additions & 0 deletions bazel/config/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -126,4 +126,14 @@ config_setting(
name = "brpc_with_asan",
define_values = {"with_asan": "true"},
visibility = ["//visibility:public"],
)

config_setting(
name = "brpc_with_bthread_tracer",
constraint_values = [
"@platforms//cpu:x86_64",
],
define_values = {
"with_bthread_tracer": "true",
},
)
2 changes: 1 addition & 1 deletion docs/cn/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ brpc会自动检测valgrind(然后注册bthread的栈)。不支持老版本

## libunwind: 1.3-1.8.1

bRPC默认**不**链接 [libunwind](https://github.com/libunwind/libunwind)。用户需要追踪bthread功能则链接libunwind,可以给config_brpc.sh增加`--with-bthread-tracer`选项或者给cmake增加`-DWITH_BTHREAD_TRACER=ON`选项。
bRPC默认**不**链接 [libunwind](https://github.com/libunwind/libunwind)。用户需要追踪bthread功能则链接libunwind,可以给config_brpc.sh增加`--with-bthread-tracer`选项或者给cmake增加`-DWITH_BTHREAD_TRACER=ON`选项,如果是用 bazel 构建,请添加 `--define with_bthread_tracer=true` 选项

建议使用最新版本的libunwind。

Expand Down
2 changes: 1 addition & 1 deletion docs/en/getting_started.md
Original file line number Diff line number Diff line change
Expand Up @@ -385,7 +385,7 @@ brpc detects valgrind automatically (and registers stacks of bthread). Older val

## libunwind: 1.3-1.8.1

brpc does **not** link [libunwind](https://github.com/libunwind/libunwind) by default. Users link libunwind on-demand by adding `--with-glog` to config_brpc.sh or adding `-DWITH_GLOG=ON` to cmake.
brpc does **not** link [libunwind](https://github.com/libunwind/libunwind) by default. Users link libunwind on-demand by adding `--with-bthread-tracer` to config_brpc.sh or adding `-DWITH_BTHREAD_TRACER=ON` to cmake, if building with Bazel, please add the `--define with_bthread_tracer=true` option.

It is recommended to use the latest possible version of libunwind.

Expand Down
Loading