aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/surface
diff options
context:
space:
mode:
authorGravatar Hongyu Chen <maxwell-demon@users.noreply.github.com>2015-07-29 11:14:35 -0700
committerGravatar Hongyu Chen <maxwell-demon@users.noreply.github.com>2015-07-29 11:14:35 -0700
commit96f1e5a08e7b086d85f27251ced60fe58544c029 (patch)
tree54f1a30d766ad0c2cdba226303582b832c4c7e1d /src/core/surface
parentef4aac6dae380ba6314847eef8457c928956f9ee (diff)
parenta4c4d3c446ea75506d9343b07e59942616c522a2 (diff)
Merge pull request #2669 from a-veitch/init_api_fix
Enrich census initialization and feature code
Diffstat (limited to 'src/core/surface')
-rw-r--r--src/core/surface/init.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/core/surface/init.c b/src/core/surface/init.c
index a015262612..442bc72f21 100644
--- a/src/core/surface/init.c
+++ b/src/core/surface/init.c
@@ -80,8 +80,11 @@ void grpc_init(void) {
grpc_security_pre_init();
grpc_iomgr_init();
grpc_tracer_init("GRPC_TRACE");
- if (census_initialize(CENSUS_NONE)) {
- gpr_log(GPR_ERROR, "Could not initialize census.");
+ /* Only initialize census if noone else has. */
+ if (census_enabled() == CENSUS_FEATURE_NONE) {
+ if (census_initialize(census_supported())) { /* enable all features. */
+ gpr_log(GPR_ERROR, "Could not initialize census.");
+ }
}
grpc_timers_global_init();
}