diff options
author | ncteisen <ncteisen@gmail.com> | 2017-07-12 23:10:37 -0700 |
---|---|---|
committer | ncteisen <ncteisen@gmail.com> | 2017-07-13 07:16:19 -0700 |
commit | 2e85f6891a978f9e036e42f54965d46d53f8487a (patch) | |
tree | bc6e61f9f28847f37fbca08919c4cc128b4e34b7 /src/core/lib | |
parent | 69191766473f835e53804f045823b9d9a638ae07 (diff) |
Add a list_tracer functionality
Diffstat (limited to 'src/core/lib')
-rw-r--r-- | src/core/lib/debug/trace.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core/lib/debug/trace.c b/src/core/lib/debug/trace.c index 4b9e3d20d2..4c9d2b8e2e 100644 --- a/src/core/lib/debug/trace.c +++ b/src/core/lib/debug/trace.c @@ -91,6 +91,14 @@ static void parse(const char *s) { gpr_free(strings); } +static void list_tracers() { + gpr_log(GPR_DEBUG, "available tracers:"); + tracer *t; + for (t = tracers; t; t = t->next) { + gpr_log(GPR_DEBUG, "\t%s", t->flag->name); + } +} + void grpc_tracer_init(const char *env_var) { char *e = gpr_getenv(env_var); if (e != NULL) { @@ -113,6 +121,8 @@ int grpc_tracer_set_enabled(const char *name, int enabled) { for (t = tracers; t; t = t->next) { TRACER_SET(*t->flag, enabled); } + } else if (0 == strcmp(name, "list_tracers")) { + list_tracers(); } else { int found = 0; for (t = tracers; t; t = t->next) { |