代码拉取完成,页面将自动刷新
同步操作将从 OpenHarmony/third_party_grpc 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
diff -Naur grpc-1.41.1/src/core/lib/debug/stats_data.cc third_party_grpc_sxy/src/core/lib/debug/stats_data.cc
--- grpc-1.41.1/src/core/lib/debug/stats_data.cc 2021-10-20 04:14:40.000000000 +0800
+++ third_party_grpc_sxy/src/core/lib/debug/stats_data.cc 2023-04-20 14:24:54.000000000 +0800
@@ -282,8 +282,8 @@
"Number of streams terminated per TCP write",
"Number of flow control updates written per TCP write",
// NOLINTNEXTLINE(bugprone-suspicious-missing-comma)
- "How many completion queues were checked looking for a CQ that had "
- "requested the incoming call",
+ ("How many completion queues were checked looking for a CQ that had "
+ "requested the incoming call"),
};
const int grpc_stats_table_0[65] = {
0, 1, 2, 3, 4, 5, 7, 9, 11, 14,
diff -Naur grpc-1.41.1/src/core/lib/debug/trace.cc third_party_grpc_sxy/src/core/lib/debug/trace.cc
--- grpc-1.41.1/src/core/lib/debug/trace.cc 2021-10-20 04:14:40.000000000 +0800
+++ third_party_grpc_sxy/src/core/lib/debug/trace.cc 2023-04-20 14:24:54.000000000 +0800
@@ -40,45 +40,51 @@
TraceFlag* TraceFlagList::root_tracer_ = nullptr;
bool TraceFlagList::Set(const char* name, bool enabled) {
- TraceFlag* t;
- if (0 == strcmp(name, "all")) {
- for (t = root_tracer_; t; t = t->next_tracer_) {
+ if (0 == strlen(name)) {
+ gpr_log(GPR_DEBUG, "No trace flags are changed");
+ } else if (0 == strcmp(name, "all")) {
+ for (auto t = root_tracer_; t != nullptr; t = t->next_tracer_) {
t->set_enabled(enabled);
}
} else if (0 == strcmp(name, "list_tracers")) {
LogAllTracers();
} else if (0 == strcmp(name, "refcount")) {
- for (t = root_tracer_; t; t = t->next_tracer_) {
+ for (auto t = root_tracer_; t != nullptr; t = t->next_tracer_) {
if (strstr(t->name_, "refcount") != nullptr) {
t->set_enabled(enabled);
+ break;
}
}
} else {
- bool found = false;
- for (t = root_tracer_; t; t = t->next_tracer_) {
+ for (auto t = root_tracer_; t != nullptr; t = t->next_tracer_) {
if (0 == strcmp(name, t->name_)) {
t->set_enabled(enabled);
- found = true;
+ return true;
}
}
// check for unknowns, but ignore "", to allow to GRPC_TRACE=
- if (!found && 0 != strcmp(name, "")) {
- gpr_log(GPR_ERROR, "Unknown trace var: '%s'", name);
- return false; /* early return */
- }
+ gpr_log(GPR_ERROR, "Unknown trace var: '%s'", name);
+ return false; /* early return */
}
return true;
}
void TraceFlagList::Add(TraceFlag* flag) {
+ gpr_log(GPR_DEBUG, "Add tracer:\t%s", flag->name_);
+ // prevent cycles at 'Add' flag to 'root_tracer_'
+ for (auto t = root_tracer_; t != nullptr; t = t->next_tracer_) {
+ // check if flag is already part of 'root_tracer_'
+ if (t == flag) {
+ return;
+ }
+ }
flag->next_tracer_ = root_tracer_;
root_tracer_ = flag;
}
void TraceFlagList::LogAllTracers() {
gpr_log(GPR_DEBUG, "available tracers:");
- TraceFlag* t;
- for (t = root_tracer_; t != nullptr; t = t->next_tracer_) {
+ for (auto t = root_tracer_; t != nullptr; t = t->next_tracer_) {
gpr_log(GPR_DEBUG, "\t%s", t->name_);
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。