Merge pull request #21661 from yashykt/odrsidestep

Sidestep multiple initialization issue of Tracers with Makefile
reviewable/pr21745/r1
Yash Tibrewal 5 years ago committed by GitHub
commit e96fa36cd7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/core/lib/debug/trace.cc

@ -70,6 +70,14 @@ bool TraceFlagList::Set(const char* name, bool enabled) {
}
void TraceFlagList::Add(TraceFlag* flag) {
// TODO(yashykt): This loop is present to sidestep
// https://github.com/grpc/grpc/issues/21213. Remove it when either Makefile
// is fixed, or it's deprecated.
for (TraceFlag* t = root_tracer_; t != nullptr; t = t->next_tracer_) {
if (t == flag) {
return;
}
}
flag->next_tracer_ = root_tracer_;
root_tracer_ = flag;
}

Loading…
Cancel
Save