aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/codegen/core/gen_stats_data.py
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2018-05-01 09:45:01 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2018-05-01 09:45:01 -0700
commit4454af55e1eb3862534d8dfa3d0f5d1066b55328 (patch)
treea75f6595cc6526f619ba0d8cd6e3d6697a17178e /tools/codegen/core/gen_stats_data.py
parent47368045989a3b05a09af76e4634cc7bcab5c492 (diff)
Update stats generator
Diffstat (limited to 'tools/codegen/core/gen_stats_data.py')
-rwxr-xr-xtools/codegen/core/gen_stats_data.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/tools/codegen/core/gen_stats_data.py b/tools/codegen/core/gen_stats_data.py
index 5c9d9e5ea5..3ebd00d049 100755
--- a/tools/codegen/core/gen_stats_data.py
+++ b/tools/codegen/core/gen_stats_data.py
@@ -230,13 +230,11 @@ with open('src/core/lib/debug/stats_data.h', 'w') as H:
print >> H, "#ifndef GRPC_CORE_LIB_DEBUG_STATS_DATA_H"
print >> H, "#define GRPC_CORE_LIB_DEBUG_STATS_DATA_H"
print >> H
+ print >> H, "#include <grpc/support/port_platform.h>"
+ print >> H
print >> H, "#include <inttypes.h>"
print >> H, "#include \"src/core/lib/iomgr/exec_ctx.h\""
print >> H
- print >> H, "#ifdef __cplusplus"
- print >> H, "extern \"C\" {"
- print >> H, "#endif"
- print >> H
for typename, instances in sorted(inst_map.items()):
print >> H, "typedef enum {"
@@ -290,10 +288,6 @@ with open('src/core/lib/debug/stats_data.h', 'w') as H:
inst_map['Histogram'])
print >> H
- print >> H, "#ifdef __cplusplus"
- print >> H, "}"
- print >> H, "#endif"
- print >> H
print >> H, "#endif /* GRPC_CORE_LIB_DEBUG_STATS_DATA_H */"
with open('src/core/lib/debug/stats_data.cc', 'w') as C:
@@ -316,10 +310,13 @@ with open('src/core/lib/debug/stats_data.cc', 'w') as C:
[C],
["Automatically generated by tools/codegen/core/gen_stats_data.py"])
- print >> C, "#include \"src/core/lib/debug/stats_data.h\""
+ print >> C, "#include <grpc/support/port_platform.h>"
+ print >> C
print >> C, "#include \"src/core/lib/debug/stats.h\""
+ print >> C, "#include \"src/core/lib/debug/stats_data.h\""
+ print >> C, "#include \"src/core/lib/gpr/useful.h\""
print >> C, "#include \"src/core/lib/iomgr/exec_ctx.h\""
- print >> C, "#include <grpc/support/useful.h>"
+ print >> C
histo_code = []
for histogram in inst_map['Histogram']: