Go to the documentation of this file.
25 #include <type_traits>
33 "A comma separated list of tracers that provide additional insight into "
34 "how gRPC C core is processing requests via debug logs.");
44 if (0 == strcmp(
name,
"all")) {
46 t->set_enabled(enabled);
48 }
else if (0 == strcmp(
name,
"list_tracers")) {
50 }
else if (0 == strcmp(
name,
"refcount")) {
52 if (strstr(t->name_,
"refcount") !=
nullptr) {
53 t->set_enabled(enabled);
59 if (0 == strcmp(
name, t->name_)) {
60 t->set_enabled(enabled);
81 for (t =
root_tracer_; t !=
nullptr; t = t->next_tracer_) {
89 "TraceFlag needs to be trivially destructible.");
96 static void add(
const char* beg,
const char*
end,
char*** ss,
size_t*
ns) {
102 len =
static_cast<size_t>(
end - beg);
106 *ss =
static_cast<char**
>(
gpr_realloc(*ss,
sizeof(
char**) * np));
111 static void split(
const char* s,
char*** ss,
size_t*
ns) {
112 const char*
c = strchr(s,
',');
114 add(s, s + strlen(s), ss,
ns);
122 char** strings =
nullptr;
125 split(s, &strings, &nstrings);
127 for (
i = 0;
i < nstrings;
i++) {
128 if (strings[
i][0] ==
'-') {
135 for (
i = 0;
i < nstrings;
i++) {
#define GPR_GLOBAL_CONFIG_GET(name)
TraceFlag(bool default_enabled, const char *name)
GPRAPI void gpr_free(void *ptr)
GPRAPI void * gpr_malloc(size_t size)
void grpc_tracer_init(const char *env_var_name)
int grpc_tracer_set_enabled(const char *name, int enabled)
static void LogAllTracers()
GPR_GLOBAL_CONFIG_DEFINE_STRING(grpc_trace, "", "A comma separated list of tracers that provide additional insight into " "how gRPC C core is processing requests via debug logs.")
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
GPRAPI void * gpr_realloc(void *p, size_t size)
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
static TraceFlag * root_tracer_
static bool Set(const char *name, bool enabled)
std::unique_ptr< T, DefaultDeleteChar > UniquePtr
static void add(const char *beg, const char *end, char ***ss, size_t *ns)
static void parse(const char *s)
static void Add(TraceFlag *flag)
void set_enabled(bool enabled)
void grpc_tracer_shutdown(void)
static void split(const char *s, char ***ss, size_t *ns)
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:40