From 75743efcfc96fdeb78695ecb6480b936e17d6659 Mon Sep 17 00:00:00 2001
From: Chris Bacon
Date: Mon, 14 Mar 2016 15:10:44 +0000
Subject: [PATCH 001/218] Make flags field readonly
---
src/csharp/Grpc.Core/WriteOptions.cs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/csharp/Grpc.Core/WriteOptions.cs b/src/csharp/Grpc.Core/WriteOptions.cs
index 7523ada84a8ee..4c9706d966f60 100644
--- a/src/csharp/Grpc.Core/WriteOptions.cs
+++ b/src/csharp/Grpc.Core/WriteOptions.cs
@@ -1,6 +1,6 @@
#region Copyright notice and license
-// Copyright 2015, Google Inc.
+// Copyright 2015-2016, Google Inc.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without
@@ -64,7 +64,7 @@ public class WriteOptions
///
public static readonly WriteOptions Default = new WriteOptions();
- private WriteFlags flags;
+ private readonly WriteFlags flags;
///
/// Initializes a new instance of WriteOptions class.
From 862c8e9e50f9832b97745baeaf954e346e43f832 Mon Sep 17 00:00:00 2001
From: David Garcia Quintas
Date: Wed, 6 Apr 2016 16:30:51 -0700
Subject: [PATCH 002/218] Load Reporting hook and filter skeleton
---
BUILD | 12 ++
Makefile | 40 ++++
binding.gyp | 2 +
build.yaml | 14 ++
config.m4 | 4 +
gRPC.podspec | 6 +
grpc.gemspec | 4 +
package.json | 4 +
package.xml | 4 +
.../load_reporting/load_reporting_filter.c | 99 +++++++++
.../load_reporting/load_reporting_filter.h | 41 ++++
src/core/lib/load_reporting/load_reporting.c | 48 +++++
src/core/lib/load_reporting/load_reporting.h | 46 ++++
src/python/grpcio/grpc_core_dependencies.py | 2 +
.../load_reporting_registration.c | 73 +++++++
tools/doxygen/Doxyfile.core.internal | 4 +
tools/run_tests/sources_and_headers.json | 28 +++
tools/run_tests/tests.json | 21 ++
vsprojects/buildtests_c.sln | 27 +++
vsprojects/vcxproj/grpc/grpc.vcxproj | 6 +
vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 18 ++
.../grpc_unsecure/grpc_unsecure.vcxproj | 6 +
.../grpc_unsecure.vcxproj.filters | 18 ++
.../load_reporting_registration_test.vcxproj | 199 ++++++++++++++++++
...eporting_registration_test.vcxproj.filters | 21 ++
25 files changed, 747 insertions(+)
create mode 100644 src/core/ext/load_reporting/load_reporting_filter.c
create mode 100644 src/core/ext/load_reporting/load_reporting_filter.h
create mode 100644 src/core/lib/load_reporting/load_reporting.c
create mode 100644 src/core/lib/load_reporting/load_reporting.h
create mode 100644 test/core/load_reporting/load_reporting_registration.c
create mode 100644 vsprojects/vcxproj/test/load_reporting_registration_test/load_reporting_registration_test.vcxproj
create mode 100644 vsprojects/vcxproj/test/load_reporting_registration_test/load_reporting_registration_test.vcxproj.filters
diff --git a/BUILD b/BUILD
index 1335bdeb34cde..5b21c5c653ade 100644
--- a/BUILD
+++ b/BUILD
@@ -182,6 +182,7 @@ cc_library(
"src/core/ext/client_config/uri_parser.h",
"src/core/ext/lb_policy/grpclb/load_balancer_api.h",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h",
+ "src/core/ext/load_reporting/load_reporting_filter.h",
"src/core/ext/transport/chttp2/transport/alpn.h",
"src/core/ext/transport/chttp2/transport/bin_encoder.h",
"src/core/ext/transport/chttp2/transport/chttp2_transport.h",
@@ -257,6 +258,7 @@ cc_library(
"src/core/lib/json/json_common.h",
"src/core/lib/json/json_reader.h",
"src/core/lib/json/json_writer.h",
+ "src/core/lib/load_reporting/load_reporting.h",
"src/core/lib/security/auth_filters.h",
"src/core/lib/security/b64.h",
"src/core/lib/security/credentials.h",
@@ -320,6 +322,7 @@ cc_library(
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c",
"src/core/ext/lb_policy/pick_first/pick_first.c",
"src/core/ext/lb_policy/round_robin/round_robin.c",
+ "src/core/ext/load_reporting/load_reporting_filter.c",
"src/core/ext/resolver/dns/native/dns_resolver.c",
"src/core/ext/resolver/sockaddr/sockaddr_resolver.c",
"src/core/ext/transport/chttp2/client/insecure/channel_create.c",
@@ -404,6 +407,7 @@ cc_library(
"src/core/lib/json/json_reader.c",
"src/core/lib/json/json_string.c",
"src/core/lib/json/json_writer.c",
+ "src/core/lib/load_reporting/load_reporting.c",
"src/core/lib/security/b64.c",
"src/core/lib/security/client_auth_filter.c",
"src/core/lib/security/credentials.c",
@@ -545,6 +549,7 @@ cc_library(
"src/core/ext/client_config/uri_parser.h",
"src/core/ext/lb_policy/grpclb/load_balancer_api.h",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h",
+ "src/core/ext/load_reporting/load_reporting_filter.h",
"src/core/ext/transport/chttp2/transport/alpn.h",
"src/core/ext/transport/chttp2/transport/bin_encoder.h",
"src/core/ext/transport/chttp2/transport/chttp2_transport.h",
@@ -620,6 +625,7 @@ cc_library(
"src/core/lib/json/json_common.h",
"src/core/lib/json/json_reader.h",
"src/core/lib/json/json_writer.h",
+ "src/core/lib/load_reporting/load_reporting.h",
"src/core/lib/surface/api_trace.h",
"src/core/lib/surface/call.h",
"src/core/lib/surface/call_test_only.h",
@@ -669,6 +675,7 @@ cc_library(
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c",
"src/core/ext/lb_policy/pick_first/pick_first.c",
"src/core/ext/lb_policy/round_robin/round_robin.c",
+ "src/core/ext/load_reporting/load_reporting_filter.c",
"src/core/ext/resolver/dns/native/dns_resolver.c",
"src/core/ext/resolver/sockaddr/sockaddr_resolver.c",
"src/core/ext/transport/chttp2/client/insecure/channel_create.c",
@@ -750,6 +757,7 @@ cc_library(
"src/core/lib/json/json_reader.c",
"src/core/lib/json/json_string.c",
"src/core/lib/json/json_writer.c",
+ "src/core/lib/load_reporting/load_reporting.c",
"src/core/lib/surface/alarm.c",
"src/core/lib/surface/api_trace.c",
"src/core/lib/surface/byte_buffer.c",
@@ -1374,6 +1382,7 @@ objc_library(
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c",
"src/core/ext/lb_policy/pick_first/pick_first.c",
"src/core/ext/lb_policy/round_robin/round_robin.c",
+ "src/core/ext/load_reporting/load_reporting_filter.c",
"src/core/ext/resolver/dns/native/dns_resolver.c",
"src/core/ext/resolver/sockaddr/sockaddr_resolver.c",
"src/core/ext/transport/chttp2/client/insecure/channel_create.c",
@@ -1458,6 +1467,7 @@ objc_library(
"src/core/lib/json/json_reader.c",
"src/core/lib/json/json_string.c",
"src/core/lib/json/json_writer.c",
+ "src/core/lib/load_reporting/load_reporting.c",
"src/core/lib/security/b64.c",
"src/core/lib/security/client_auth_filter.c",
"src/core/lib/security/credentials.c",
@@ -1541,6 +1551,7 @@ objc_library(
"src/core/ext/client_config/uri_parser.h",
"src/core/ext/lb_policy/grpclb/load_balancer_api.h",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h",
+ "src/core/ext/load_reporting/load_reporting_filter.h",
"src/core/ext/transport/chttp2/transport/alpn.h",
"src/core/ext/transport/chttp2/transport/bin_encoder.h",
"src/core/ext/transport/chttp2/transport/chttp2_transport.h",
@@ -1616,6 +1627,7 @@ objc_library(
"src/core/lib/json/json_common.h",
"src/core/lib/json/json_reader.h",
"src/core/lib/json/json_writer.h",
+ "src/core/lib/load_reporting/load_reporting.h",
"src/core/lib/security/auth_filters.h",
"src/core/lib/security/b64.h",
"src/core/lib/security/credentials.h",
diff --git a/Makefile b/Makefile
index 1d78e65e9a0a6..4df2e0cc4f0f7 100644
--- a/Makefile
+++ b/Makefile
@@ -956,6 +956,7 @@ json_stream_error_test: $(BINDIR)/$(CONFIG)/json_stream_error_test
json_test: $(BINDIR)/$(CONFIG)/json_test
lame_client_test: $(BINDIR)/$(CONFIG)/lame_client_test
lb_policies_test: $(BINDIR)/$(CONFIG)/lb_policies_test
+load_reporting_registration_test: $(BINDIR)/$(CONFIG)/load_reporting_registration_test
low_level_ping_pong_benchmark: $(BINDIR)/$(CONFIG)/low_level_ping_pong_benchmark
message_compress_test: $(BINDIR)/$(CONFIG)/message_compress_test
mlog_test: $(BINDIR)/$(CONFIG)/mlog_test
@@ -1276,6 +1277,7 @@ buildtests_c: privatelibs_c \
$(BINDIR)/$(CONFIG)/json_test \
$(BINDIR)/$(CONFIG)/lame_client_test \
$(BINDIR)/$(CONFIG)/lb_policies_test \
+ $(BINDIR)/$(CONFIG)/load_reporting_registration_test \
$(BINDIR)/$(CONFIG)/message_compress_test \
$(BINDIR)/$(CONFIG)/mlog_test \
$(BINDIR)/$(CONFIG)/multiple_server_queues_test \
@@ -1576,6 +1578,8 @@ test_c: buildtests_c
$(Q) $(BINDIR)/$(CONFIG)/json_test || ( echo test json_test failed ; exit 1 )
$(E) "[RUN] Testing lame_client_test"
$(Q) $(BINDIR)/$(CONFIG)/lame_client_test || ( echo test lame_client_test failed ; exit 1 )
+ $(E) "[RUN] Testing load_reporting_registration_test"
+ $(Q) $(BINDIR)/$(CONFIG)/load_reporting_registration_test || ( echo test load_reporting_registration_test failed ; exit 1 )
$(E) "[RUN] Testing message_compress_test"
$(Q) $(BINDIR)/$(CONFIG)/message_compress_test || ( echo test message_compress_test failed ; exit 1 )
$(E) "[RUN] Testing multiple_server_queues_test"
@@ -2486,6 +2490,7 @@ LIBGRPC_SRC = \
src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \
src/core/ext/lb_policy/pick_first/pick_first.c \
src/core/ext/lb_policy/round_robin/round_robin.c \
+ src/core/ext/load_reporting/load_reporting_filter.c \
src/core/ext/resolver/dns/native/dns_resolver.c \
src/core/ext/resolver/sockaddr/sockaddr_resolver.c \
src/core/ext/transport/chttp2/client/insecure/channel_create.c \
@@ -2570,6 +2575,7 @@ LIBGRPC_SRC = \
src/core/lib/json/json_reader.c \
src/core/lib/json/json_string.c \
src/core/lib/json/json_writer.c \
+ src/core/lib/load_reporting/load_reporting.c \
src/core/lib/security/b64.c \
src/core/lib/security/client_auth_filter.c \
src/core/lib/security/credentials.c \
@@ -2847,6 +2853,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \
src/core/ext/lb_policy/pick_first/pick_first.c \
src/core/ext/lb_policy/round_robin/round_robin.c \
+ src/core/ext/load_reporting/load_reporting_filter.c \
src/core/ext/resolver/dns/native/dns_resolver.c \
src/core/ext/resolver/sockaddr/sockaddr_resolver.c \
src/core/ext/transport/chttp2/client/insecure/channel_create.c \
@@ -2928,6 +2935,7 @@ LIBGRPC_UNSECURE_SRC = \
src/core/lib/json/json_reader.c \
src/core/lib/json/json_string.c \
src/core/lib/json/json_writer.c \
+ src/core/lib/load_reporting/load_reporting.c \
src/core/lib/surface/alarm.c \
src/core/lib/surface/api_trace.c \
src/core/lib/surface/byte_buffer.c \
@@ -8521,6 +8529,38 @@ endif
endif
+LOAD_REPORTING_REGISTRATION_TEST_SRC = \
+ test/core/load_reporting/load_reporting_registration.c \
+
+LOAD_REPORTING_REGISTRATION_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LOAD_REPORTING_REGISTRATION_TEST_SRC))))
+ifeq ($(NO_SECURE),true)
+
+# You can't build secure targets if you don't have OpenSSL.
+
+$(BINDIR)/$(CONFIG)/load_reporting_registration_test: openssl_dep_error
+
+else
+
+
+
+$(BINDIR)/$(CONFIG)/load_reporting_registration_test: $(LOAD_REPORTING_REGISTRATION_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+ $(E) "[LD] Linking $@"
+ $(Q) mkdir -p `dirname $@`
+ $(Q) $(LD) $(LDFLAGS) $(LOAD_REPORTING_REGISTRATION_TEST_OBJS) $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a $(LDLIBS) $(LDLIBS_SECURE) -o $(BINDIR)/$(CONFIG)/load_reporting_registration_test
+
+endif
+
+$(OBJDIR)/$(CONFIG)/test/core/load_reporting/load_reporting_registration.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a
+
+deps_load_reporting_registration_test: $(LOAD_REPORTING_REGISTRATION_TEST_OBJS:.o=.dep)
+
+ifneq ($(NO_SECURE),true)
+ifneq ($(NO_DEPS),true)
+-include $(LOAD_REPORTING_REGISTRATION_TEST_OBJS:.o=.dep)
+endif
+endif
+
+
LOW_LEVEL_PING_PONG_BENCHMARK_SRC = \
test/core/network_benchmarks/low_level_ping_pong.c \
diff --git a/binding.gyp b/binding.gyp
index d6d559dd58388..f99ce39057c3d 100644
--- a/binding.gyp
+++ b/binding.gyp
@@ -588,6 +588,7 @@
'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c',
'src/core/ext/lb_policy/pick_first/pick_first.c',
'src/core/ext/lb_policy/round_robin/round_robin.c',
+ 'src/core/ext/load_reporting/load_reporting_filter.c',
'src/core/ext/resolver/dns/native/dns_resolver.c',
'src/core/ext/resolver/sockaddr/sockaddr_resolver.c',
'src/core/ext/transport/chttp2/client/insecure/channel_create.c',
@@ -672,6 +673,7 @@
'src/core/lib/json/json_reader.c',
'src/core/lib/json/json_string.c',
'src/core/lib/json/json_writer.c',
+ 'src/core/lib/load_reporting/load_reporting.c',
'src/core/lib/security/b64.c',
'src/core/lib/security/client_auth_filter.c',
'src/core/lib/security/credentials.c',
diff --git a/build.yaml b/build.yaml
index 76e512c6d0187..6d1941967db83 100644
--- a/build.yaml
+++ b/build.yaml
@@ -254,6 +254,7 @@ filegroups:
- include/grpc/grpc.h
- include/grpc/status.h
headers:
+ - src/core/ext/load_reporting/load_reporting_filter.h
- src/core/lib/channel/channel_args.h
- src/core/lib/channel/channel_stack.h
- src/core/lib/channel/channel_stack_builder.h
@@ -308,6 +309,7 @@ filegroups:
- src/core/lib/json/json_common.h
- src/core/lib/json/json_reader.h
- src/core/lib/json/json_writer.h
+ - src/core/lib/load_reporting/load_reporting.h
- src/core/lib/surface/api_trace.h
- src/core/lib/surface/call.h
- src/core/lib/surface/call_test_only.h
@@ -328,6 +330,7 @@ filegroups:
- src/core/lib/transport/transport.h
- src/core/lib/transport/transport_impl.h
src:
+ - src/core/ext/load_reporting/load_reporting_filter.c
- src/core/lib/channel/channel_args.c
- src/core/lib/channel/channel_stack.c
- src/core/lib/channel/channel_stack_builder.c
@@ -384,6 +387,7 @@ filegroups:
- src/core/lib/json/json_reader.c
- src/core/lib/json/json_string.c
- src/core/lib/json/json_writer.c
+ - src/core/lib/load_reporting/load_reporting.c
- src/core/lib/surface/alarm.c
- src/core/lib/surface/api_trace.c
- src/core/lib/surface/byte_buffer.c
@@ -1855,6 +1859,16 @@ targets:
- grpc
- gpr_test_util
- gpr
+- name: load_reporting_registration_test
+ build: test
+ language: c
+ src:
+ - test/core/load_reporting/load_reporting_registration.c
+ deps:
+ - grpc_test_util
+ - grpc
+ - gpr_test_util
+ - gpr
- name: low_level_ping_pong_benchmark
build: benchmark
language: c
diff --git a/config.m4 b/config.m4
index dae142dd40275..caa7c7b91af66 100644
--- a/config.m4
+++ b/config.m4
@@ -110,6 +110,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \
src/core/ext/lb_policy/pick_first/pick_first.c \
src/core/ext/lb_policy/round_robin/round_robin.c \
+ src/core/ext/load_reporting/load_reporting_filter.c \
src/core/ext/resolver/dns/native/dns_resolver.c \
src/core/ext/resolver/sockaddr/sockaddr_resolver.c \
src/core/ext/transport/chttp2/client/insecure/channel_create.c \
@@ -194,6 +195,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/json/json_reader.c \
src/core/lib/json/json_string.c \
src/core/lib/json/json_writer.c \
+ src/core/lib/load_reporting/load_reporting.c \
src/core/lib/security/b64.c \
src/core/lib/security/client_auth_filter.c \
src/core/lib/security/credentials.c \
@@ -550,6 +552,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/pick_first)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/lb_policy/round_robin)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/load_reporting)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/resolver/dns/native)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/resolver/sockaddr)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/ext/transport/chttp2/client/insecure)
@@ -563,6 +566,7 @@ if test "$PHP_GRPC" != "no"; then
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/http)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/iomgr)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/json)
+ PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/load_reporting)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/profiling)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/security)
PHP_ADD_BUILD_DIR($ext_builddir/src/core/lib/support)
diff --git a/gRPC.podspec b/gRPC.podspec
index 93346df38244e..ca9a1227be8be 100644
--- a/gRPC.podspec
+++ b/gRPC.podspec
@@ -184,6 +184,7 @@ Pod::Spec.new do |s|
'src/core/ext/client_config/uri_parser.h',
'src/core/ext/lb_policy/grpclb/load_balancer_api.h',
'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h',
+ 'src/core/ext/load_reporting/load_reporting_filter.h',
'src/core/ext/transport/chttp2/transport/alpn.h',
'src/core/ext/transport/chttp2/transport/bin_encoder.h',
'src/core/ext/transport/chttp2/transport/chttp2_transport.h',
@@ -259,6 +260,7 @@ Pod::Spec.new do |s|
'src/core/lib/json/json_common.h',
'src/core/lib/json/json_reader.h',
'src/core/lib/json/json_writer.h',
+ 'src/core/lib/load_reporting/load_reporting.h',
'src/core/lib/security/auth_filters.h',
'src/core/lib/security/b64.h',
'src/core/lib/security/credentials.h',
@@ -339,6 +341,7 @@ Pod::Spec.new do |s|
'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c',
'src/core/ext/lb_policy/pick_first/pick_first.c',
'src/core/ext/lb_policy/round_robin/round_robin.c',
+ 'src/core/ext/load_reporting/load_reporting_filter.c',
'src/core/ext/resolver/dns/native/dns_resolver.c',
'src/core/ext/resolver/sockaddr/sockaddr_resolver.c',
'src/core/ext/transport/chttp2/client/insecure/channel_create.c',
@@ -423,6 +426,7 @@ Pod::Spec.new do |s|
'src/core/lib/json/json_reader.c',
'src/core/lib/json/json_string.c',
'src/core/lib/json/json_writer.c',
+ 'src/core/lib/load_reporting/load_reporting.c',
'src/core/lib/security/b64.c',
'src/core/lib/security/client_auth_filter.c',
'src/core/lib/security/credentials.c',
@@ -507,6 +511,7 @@ Pod::Spec.new do |s|
'src/core/ext/client_config/uri_parser.h',
'src/core/ext/lb_policy/grpclb/load_balancer_api.h',
'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h',
+ 'src/core/ext/load_reporting/load_reporting_filter.h',
'src/core/ext/transport/chttp2/transport/alpn.h',
'src/core/ext/transport/chttp2/transport/bin_encoder.h',
'src/core/ext/transport/chttp2/transport/chttp2_transport.h',
@@ -582,6 +587,7 @@ Pod::Spec.new do |s|
'src/core/lib/json/json_common.h',
'src/core/lib/json/json_reader.h',
'src/core/lib/json/json_writer.h',
+ 'src/core/lib/load_reporting/load_reporting.h',
'src/core/lib/security/auth_filters.h',
'src/core/lib/security/b64.h',
'src/core/lib/security/credentials.h',
diff --git a/grpc.gemspec b/grpc.gemspec
index 03192c42ddd2a..ebcf5aa8f5ef7 100755
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -180,6 +180,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/client_config/uri_parser.h )
s.files += %w( src/core/ext/lb_policy/grpclb/load_balancer_api.h )
s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h )
+ s.files += %w( src/core/ext/load_reporting/load_reporting_filter.h )
s.files += %w( src/core/ext/transport/chttp2/transport/alpn.h )
s.files += %w( src/core/ext/transport/chttp2/transport/bin_encoder.h )
s.files += %w( src/core/ext/transport/chttp2/transport/chttp2_transport.h )
@@ -255,6 +256,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/json/json_common.h )
s.files += %w( src/core/lib/json/json_reader.h )
s.files += %w( src/core/lib/json/json_writer.h )
+ s.files += %w( src/core/lib/load_reporting/load_reporting.h )
s.files += %w( src/core/lib/security/auth_filters.h )
s.files += %w( src/core/lib/security/b64.h )
s.files += %w( src/core/lib/security/credentials.h )
@@ -322,6 +324,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c )
s.files += %w( src/core/ext/lb_policy/pick_first/pick_first.c )
s.files += %w( src/core/ext/lb_policy/round_robin/round_robin.c )
+ s.files += %w( src/core/ext/load_reporting/load_reporting_filter.c )
s.files += %w( src/core/ext/resolver/dns/native/dns_resolver.c )
s.files += %w( src/core/ext/resolver/sockaddr/sockaddr_resolver.c )
s.files += %w( src/core/ext/transport/chttp2/client/insecure/channel_create.c )
@@ -406,6 +409,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/json/json_reader.c )
s.files += %w( src/core/lib/json/json_string.c )
s.files += %w( src/core/lib/json/json_writer.c )
+ s.files += %w( src/core/lib/load_reporting/load_reporting.c )
s.files += %w( src/core/lib/security/b64.c )
s.files += %w( src/core/lib/security/client_auth_filter.c )
s.files += %w( src/core/lib/security/credentials.c )
diff --git a/package.json b/package.json
index 11f703f3f3c96..ddbe4bf227f32 100644
--- a/package.json
+++ b/package.json
@@ -123,6 +123,7 @@
"src/core/ext/client_config/uri_parser.h",
"src/core/ext/lb_policy/grpclb/load_balancer_api.h",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h",
+ "src/core/ext/load_reporting/load_reporting_filter.h",
"src/core/ext/transport/chttp2/transport/alpn.h",
"src/core/ext/transport/chttp2/transport/bin_encoder.h",
"src/core/ext/transport/chttp2/transport/chttp2_transport.h",
@@ -198,6 +199,7 @@
"src/core/lib/json/json_common.h",
"src/core/lib/json/json_reader.h",
"src/core/lib/json/json_writer.h",
+ "src/core/lib/load_reporting/load_reporting.h",
"src/core/lib/security/auth_filters.h",
"src/core/lib/security/b64.h",
"src/core/lib/security/credentials.h",
@@ -265,6 +267,7 @@
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c",
"src/core/ext/lb_policy/pick_first/pick_first.c",
"src/core/ext/lb_policy/round_robin/round_robin.c",
+ "src/core/ext/load_reporting/load_reporting_filter.c",
"src/core/ext/resolver/dns/native/dns_resolver.c",
"src/core/ext/resolver/sockaddr/sockaddr_resolver.c",
"src/core/ext/transport/chttp2/client/insecure/channel_create.c",
@@ -349,6 +352,7 @@
"src/core/lib/json/json_reader.c",
"src/core/lib/json/json_string.c",
"src/core/lib/json/json_writer.c",
+ "src/core/lib/load_reporting/load_reporting.c",
"src/core/lib/security/b64.c",
"src/core/lib/security/client_auth_filter.c",
"src/core/lib/security/credentials.c",
diff --git a/package.xml b/package.xml
index 7730187ba1ee1..e68d44d085c32 100644
--- a/package.xml
+++ b/package.xml
@@ -184,6 +184,7 @@
+
@@ -259,6 +260,7 @@
+
@@ -326,6 +328,7 @@
+
@@ -410,6 +413,7 @@
+
diff --git a/src/core/ext/load_reporting/load_reporting_filter.c b/src/core/ext/load_reporting/load_reporting_filter.c
new file mode 100644
index 0000000000000..7b029ae3eed20
--- /dev/null
+++ b/src/core/ext/load_reporting/load_reporting_filter.c
@@ -0,0 +1,99 @@
+/*
+ *
+ * Copyright 2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include
+
+#include
+
+#include "src/core/ext/load_reporting/load_reporting_filter.h"
+#include "src/core/lib/channel/channel_args.h"
+#include "src/core/lib/load_reporting/load_reporting.h"
+#include "src/core/lib/profiling/timers.h"
+#include "src/core/lib/support/string.h"
+
+typedef struct call_data { load_reporting_data lr_data; } call_data;
+
+typedef struct channel_data { void *dummy; } channel_data;
+
+static void load_reporting_start_transport_stream_op(
+ grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
+ grpc_transport_stream_op *op) {
+ call_data *calld = elem->call_data;
+
+ GPR_TIMER_BEGIN("load_reporting_start_transport_stream_op", 0);
+ grpc_load_reporting_call(&calld->lr_data);
+ grpc_call_next_op(exec_ctx, elem, op);
+ GPR_TIMER_END("load_reporting_start_transport_stream_op", 0);
+}
+
+/* Constructor for call_data */
+static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
+ grpc_call_element_args *args) {
+ /* grab pointers to our data from the call element */
+ call_data *calld = elem->call_data;
+
+ /* initialize members */
+ memset(&calld->lr_data, 0, sizeof(load_reporting_data));
+}
+
+/* Destructor for call_data */
+static void destroy_call_elem(grpc_exec_ctx *exec_ctx,
+ grpc_call_element *elem) {
+ /* grab pointers to our data from the call element */
+ /*call_data *calld = elem->call_data;*/
+}
+
+/* Constructor for channel_data */
+static void init_channel_elem(grpc_exec_ctx *exec_ctx,
+ grpc_channel_element *elem,
+ grpc_channel_element_args *args) {
+ /*channel_data *channeld = elem->channel_data;*/
+ GPR_ASSERT(!args->is_last);
+}
+
+/* Destructor for channel data */
+static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
+ grpc_channel_element *elem) {}
+
+const grpc_channel_filter grpc_load_reporting_filter = {
+ load_reporting_start_transport_stream_op,
+ grpc_channel_next_op,
+ sizeof(call_data),
+ init_call_elem,
+ grpc_call_stack_ignore_set_pollset,
+ destroy_call_elem,
+ sizeof(channel_data),
+ init_channel_elem,
+ destroy_channel_elem,
+ grpc_call_next_get_peer,
+ "load_reporting"};
diff --git a/src/core/ext/load_reporting/load_reporting_filter.h b/src/core/ext/load_reporting/load_reporting_filter.h
new file mode 100644
index 0000000000000..f69cd6fdc6dc6
--- /dev/null
+++ b/src/core/ext/load_reporting/load_reporting_filter.h
@@ -0,0 +1,41 @@
+/*
+ *
+ * Copyright 2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_FILTER_H
+#define GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_FILTER_H
+
+#include "src/core/lib/channel/channel_stack.h"
+
+extern const grpc_channel_filter grpc_load_reporting_filter;
+
+#endif /* GRPC_CORE_EXT_LOAD_REPORTING_LOAD_REPORTING_FILTER_H */
diff --git a/src/core/lib/load_reporting/load_reporting.c b/src/core/lib/load_reporting/load_reporting.c
new file mode 100644
index 0000000000000..2ac8b97efcf27
--- /dev/null
+++ b/src/core/lib/load_reporting/load_reporting.c
@@ -0,0 +1,48 @@
+/*
+ *
+ * Copyright 2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include "src/core/lib/load_reporting/load_reporting.h"
+
+#include
+
+static load_reporting_fn g_load_reporting_fn;
+
+void grpc_load_reporting_init(load_reporting_fn fn) {
+ g_load_reporting_fn = fn;
+}
+
+void grpc_load_reporting_call(load_reporting_data *lr_data) {
+ if (g_load_reporting_fn != NULL) {
+ g_load_reporting_fn(lr_data);
+ }
+}
diff --git a/src/core/lib/load_reporting/load_reporting.h b/src/core/lib/load_reporting/load_reporting.h
new file mode 100644
index 0000000000000..65465ef940a49
--- /dev/null
+++ b/src/core/lib/load_reporting/load_reporting.h
@@ -0,0 +1,46 @@
+/*
+ *
+ * Copyright 2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#ifndef GRPC_CORE_LIB_LOAD_REPORTING_LOAD_REPORTING_H
+#define GRPC_CORE_LIB_LOAD_REPORTING_LOAD_REPORTING_H
+
+typedef struct load_reporting_data { void *data; } load_reporting_data;
+
+typedef void (*load_reporting_fn)(load_reporting_data *lr_data);
+
+/** To be called only from a plugin init function */
+void grpc_load_reporting_init(load_reporting_fn fn);
+
+void grpc_load_reporting_call(load_reporting_data *lr_data);
+
+#endif /* GRPC_CORE_LIB_LOAD_REPORTING_LOAD_REPORTING_H */
diff --git a/src/python/grpcio/grpc_core_dependencies.py b/src/python/grpcio/grpc_core_dependencies.py
index 2ed0b1e520c85..d02a4cd57c059 100644
--- a/src/python/grpcio/grpc_core_dependencies.py
+++ b/src/python/grpcio/grpc_core_dependencies.py
@@ -104,6 +104,7 @@
'src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c',
'src/core/ext/lb_policy/pick_first/pick_first.c',
'src/core/ext/lb_policy/round_robin/round_robin.c',
+ 'src/core/ext/load_reporting/load_reporting_filter.c',
'src/core/ext/resolver/dns/native/dns_resolver.c',
'src/core/ext/resolver/sockaddr/sockaddr_resolver.c',
'src/core/ext/transport/chttp2/client/insecure/channel_create.c',
@@ -188,6 +189,7 @@
'src/core/lib/json/json_reader.c',
'src/core/lib/json/json_string.c',
'src/core/lib/json/json_writer.c',
+ 'src/core/lib/load_reporting/load_reporting.c',
'src/core/lib/security/b64.c',
'src/core/lib/security/client_auth_filter.c',
'src/core/lib/security/credentials.c',
diff --git a/test/core/load_reporting/load_reporting_registration.c b/test/core/load_reporting/load_reporting_registration.c
new file mode 100644
index 0000000000000..fa3b568781206
--- /dev/null
+++ b/test/core/load_reporting/load_reporting_registration.c
@@ -0,0 +1,73 @@
+/*
+ *
+ * Copyright 2015-2016, Google Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ * * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ * * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ *
+ */
+
+#include
+#include
+#include
+#include
+
+#include "src/core/lib/load_reporting/load_reporting.h"
+#include "src/core/lib/surface/api_trace.h"
+#include "test/core/util/test_config.h"
+
+static void noop(load_reporting_data *lr_data) {
+ uintptr_t *d = (uintptr_t *)(lr_data->data);
+ *d = 0xdeadbeef;
+}
+
+static void lr_plugin_init(void) { grpc_load_reporting_init(noop); }
+
+static void lr_plugin_destroy(void) {}
+
+static void load_reporting_register() {
+ grpc_register_plugin(lr_plugin_init, lr_plugin_destroy);
+}
+
+static void test_load_reporter_registration(void) {
+ load_reporting_data lr_data;
+ lr_data.data = gpr_malloc(sizeof(uint32_t));
+ grpc_load_reporting_call(&lr_data);
+
+ GPR_ASSERT(*((uintptr_t *)lr_data.data) == 0xdeadbeef);
+
+ gpr_free(lr_data.data);
+}
+
+int main(int argc, char **argv) {
+ load_reporting_register();
+ grpc_init();
+ test_load_reporter_registration();
+ grpc_shutdown();
+
+ return 0;
+}
diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal
index bbb464d865661..7d802c6e37e4a 100644
--- a/tools/doxygen/Doxyfile.core.internal
+++ b/tools/doxygen/Doxyfile.core.internal
@@ -796,6 +796,7 @@ src/core/ext/client_config/subchannel_index.h \
src/core/ext/client_config/uri_parser.h \
src/core/ext/lb_policy/grpclb/load_balancer_api.h \
src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h \
+src/core/ext/load_reporting/load_reporting_filter.h \
src/core/ext/transport/chttp2/transport/alpn.h \
src/core/ext/transport/chttp2/transport/bin_encoder.h \
src/core/ext/transport/chttp2/transport/chttp2_transport.h \
@@ -871,6 +872,7 @@ src/core/lib/json/json.h \
src/core/lib/json/json_common.h \
src/core/lib/json/json_reader.h \
src/core/lib/json/json_writer.h \
+src/core/lib/load_reporting/load_reporting.h \
src/core/lib/security/auth_filters.h \
src/core/lib/security/b64.h \
src/core/lib/security/credentials.h \
@@ -938,6 +940,7 @@ src/core/ext/lb_policy/grpclb/load_balancer_api.c \
src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.c \
src/core/ext/lb_policy/pick_first/pick_first.c \
src/core/ext/lb_policy/round_robin/round_robin.c \
+src/core/ext/load_reporting/load_reporting_filter.c \
src/core/ext/resolver/dns/native/dns_resolver.c \
src/core/ext/resolver/sockaddr/sockaddr_resolver.c \
src/core/ext/transport/chttp2/client/insecure/channel_create.c \
@@ -1022,6 +1025,7 @@ src/core/lib/json/json.c \
src/core/lib/json/json_reader.c \
src/core/lib/json/json_string.c \
src/core/lib/json/json_writer.c \
+src/core/lib/load_reporting/load_reporting.c \
src/core/lib/security/b64.c \
src/core/lib/security/client_auth_filter.c \
src/core/lib/security/credentials.c \
diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json
index 96f63556575d9..da6c2ce308d61 100644
--- a/tools/run_tests/sources_and_headers.json
+++ b/tools/run_tests/sources_and_headers.json
@@ -1216,6 +1216,22 @@
"third_party": false,
"type": "target"
},
+ {
+ "deps": [
+ "gpr",
+ "gpr_test_util",
+ "grpc",
+ "grpc_test_util"
+ ],
+ "headers": [],
+ "language": "c",
+ "name": "load_reporting_registration_test",
+ "src": [
+ "test/core/load_reporting/load_reporting_registration.c"
+ ],
+ "third_party": false,
+ "type": "target"
+ },
{
"deps": [
"gpr",
@@ -4179,6 +4195,7 @@
"src/core/ext/client_config/uri_parser.h",
"src/core/ext/lb_policy/grpclb/load_balancer_api.h",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h",
+ "src/core/ext/load_reporting/load_reporting_filter.h",
"src/core/ext/transport/chttp2/transport/alpn.h",
"src/core/ext/transport/chttp2/transport/bin_encoder.h",
"src/core/ext/transport/chttp2/transport/chttp2_transport.h",
@@ -4254,6 +4271,7 @@
"src/core/lib/json/json_common.h",
"src/core/lib/json/json_reader.h",
"src/core/lib/json/json_writer.h",
+ "src/core/lib/load_reporting/load_reporting.h",
"src/core/lib/security/auth_filters.h",
"src/core/lib/security/b64.h",
"src/core/lib/security/credentials.h",
@@ -4361,6 +4379,8 @@
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h",
"src/core/ext/lb_policy/pick_first/pick_first.c",
"src/core/ext/lb_policy/round_robin/round_robin.c",
+ "src/core/ext/load_reporting/load_reporting_filter.c",
+ "src/core/ext/load_reporting/load_reporting_filter.h",
"src/core/ext/resolver/dns/native/dns_resolver.c",
"src/core/ext/resolver/sockaddr/sockaddr_resolver.c",
"src/core/ext/transport/chttp2/client/insecure/channel_create.c",
@@ -4520,6 +4540,8 @@
"src/core/lib/json/json_string.c",
"src/core/lib/json/json_writer.c",
"src/core/lib/json/json_writer.h",
+ "src/core/lib/load_reporting/load_reporting.c",
+ "src/core/lib/load_reporting/load_reporting.h",
"src/core/lib/security/auth_filters.h",
"src/core/lib/security/b64.c",
"src/core/lib/security/b64.h",
@@ -4799,6 +4821,7 @@
"src/core/ext/client_config/uri_parser.h",
"src/core/ext/lb_policy/grpclb/load_balancer_api.h",
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h",
+ "src/core/ext/load_reporting/load_reporting_filter.h",
"src/core/ext/transport/chttp2/transport/alpn.h",
"src/core/ext/transport/chttp2/transport/bin_encoder.h",
"src/core/ext/transport/chttp2/transport/chttp2_transport.h",
@@ -4874,6 +4897,7 @@
"src/core/lib/json/json_common.h",
"src/core/lib/json/json_reader.h",
"src/core/lib/json/json_writer.h",
+ "src/core/lib/load_reporting/load_reporting.h",
"src/core/lib/surface/api_trace.h",
"src/core/lib/surface/call.h",
"src/core/lib/surface/call_test_only.h",
@@ -4966,6 +4990,8 @@
"src/core/ext/lb_policy/grpclb/proto/grpc/lb/v0/load_balancer.pb.h",
"src/core/ext/lb_policy/pick_first/pick_first.c",
"src/core/ext/lb_policy/round_robin/round_robin.c",
+ "src/core/ext/load_reporting/load_reporting_filter.c",
+ "src/core/ext/load_reporting/load_reporting_filter.h",
"src/core/ext/resolver/dns/native/dns_resolver.c",
"src/core/ext/resolver/sockaddr/sockaddr_resolver.c",
"src/core/ext/transport/chttp2/client/insecure/channel_create.c",
@@ -5122,6 +5148,8 @@
"src/core/lib/json/json_string.c",
"src/core/lib/json/json_writer.c",
"src/core/lib/json/json_writer.h",
+ "src/core/lib/load_reporting/load_reporting.c",
+ "src/core/lib/load_reporting/load_reporting.h",
"src/core/lib/surface/alarm.c",
"src/core/lib/surface/api_trace.c",
"src/core/lib/surface/api_trace.h",
diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json
index ebf82186450a2..a29a6eccaea86 100644
--- a/tools/run_tests/tests.json
+++ b/tools/run_tests/tests.json
@@ -1323,6 +1323,27 @@
"windows"
]
},
+ {
+ "args": [],
+ "ci_platforms": [
+ "linux",
+ "mac",
+ "posix",
+ "windows"
+ ],
+ "cpu_cost": 1.0,
+ "exclude_configs": [],
+ "flaky": false,
+ "gtest": false,
+ "language": "c",
+ "name": "load_reporting_registration_test",
+ "platforms": [
+ "linux",
+ "mac",
+ "posix",
+ "windows"
+ ]
+ },
{
"args": [],
"ci_platforms": [
diff --git a/vsprojects/buildtests_c.sln b/vsprojects/buildtests_c.sln
index a582f2b719660..25f332059ff49 100644
--- a/vsprojects/buildtests_c.sln
+++ b/vsprojects/buildtests_c.sln
@@ -812,6 +812,17 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "lb_policies_test", "vcxproj
{B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
EndProjectSection
EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "load_reporting_registration_test", "vcxproj\test\load_reporting_registration_test\load_reporting_registration_test.vcxproj", "{2C80EA2B-46FC-0997-E01A-F29EC3968799}"
+ ProjectSection(myProperties) = preProject
+ lib = "False"
+ EndProjectSection
+ ProjectSection(ProjectDependencies) = postProject
+ {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B} = {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}
+ {29D16885-7228-4C31-81ED-5F9187C7F2A9} = {29D16885-7228-4C31-81ED-5F9187C7F2A9}
+ {EAB0A629-17A9-44DB-B5FF-E91A721FE037} = {EAB0A629-17A9-44DB-B5FF-E91A721FE037}
+ {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
+ EndProjectSection
+EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "message_compress_test", "vcxproj\test\message_compress_test\message_compress_test.vcxproj", "{07170557-CCB0-D23C-8018-C2909D115DF9}"
ProjectSection(myProperties) = preProject
lib = "False"
@@ -2682,6 +2693,22 @@ Global
{62D58A08-3B5E-D6A8-ABBB-77995AA0A8C6}.Release-DLL|Win32.Build.0 = Release|Win32
{62D58A08-3B5E-D6A8-ABBB-77995AA0A8C6}.Release-DLL|x64.ActiveCfg = Release|x64
{62D58A08-3B5E-D6A8-ABBB-77995AA0A8C6}.Release-DLL|x64.Build.0 = Release|x64
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}.Debug|Win32.ActiveCfg = Debug|Win32
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}.Debug|x64.ActiveCfg = Debug|x64
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}.Release|Win32.ActiveCfg = Release|Win32
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}.Release|x64.ActiveCfg = Release|x64
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}.Debug|Win32.Build.0 = Debug|Win32
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}.Debug|x64.Build.0 = Debug|x64
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}.Release|Win32.Build.0 = Release|Win32
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}.Release|x64.Build.0 = Release|x64
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}.Debug-DLL|Win32.ActiveCfg = Debug|Win32
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}.Debug-DLL|Win32.Build.0 = Debug|Win32
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}.Debug-DLL|x64.ActiveCfg = Debug|x64
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}.Debug-DLL|x64.Build.0 = Debug|x64
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}.Release-DLL|Win32.ActiveCfg = Release|Win32
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}.Release-DLL|Win32.Build.0 = Release|Win32
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}.Release-DLL|x64.ActiveCfg = Release|x64
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}.Release-DLL|x64.Build.0 = Release|x64
{07170557-CCB0-D23C-8018-C2909D115DF9}.Debug|Win32.ActiveCfg = Debug|Win32
{07170557-CCB0-D23C-8018-C2909D115DF9}.Debug|x64.ActiveCfg = Debug|x64
{07170557-CCB0-D23C-8018-C2909D115DF9}.Release|Win32.ActiveCfg = Release|Win32
diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj
index 5599e0ecd6a88..defc6fe828849 100644
--- a/vsprojects/vcxproj/grpc/grpc.vcxproj
+++ b/vsprojects/vcxproj/grpc/grpc.vcxproj
@@ -305,6 +305,7 @@
+
@@ -380,6 +381,7 @@
+
@@ -479,6 +481,8 @@
+
+
@@ -647,6 +651,8 @@
+
+
diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters
index e49b8447d8738..189fd7142fad6 100644
--- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters
+++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters
@@ -91,6 +91,9 @@
src\core\ext\lb_policy\round_robin
+
+ src\core\ext\load_reporting
+
src\core\ext\resolver\dns\native
@@ -343,6 +346,9 @@
src\core\lib\json
+
+ src\core\lib\load_reporting
+
src\core\lib\security
@@ -599,6 +605,9 @@
src\core\ext\lb_policy\grpclb\proto\grpc\lb\v0
+
+ src\core\ext\load_reporting
+
src\core\ext\transport\chttp2\transport
@@ -824,6 +833,9 @@
src\core\lib\json
+
+ src\core\lib\load_reporting
+
src\core\lib\security
@@ -989,6 +1001,9 @@
{2472d352-cf94-f317-646e-72b769cea846}
+
+ {b6c863cd-a135-32e8-df03-02365f526f0d}
+
{6bfa6808-9dcb-8990-deed-5cf58a149dda}
@@ -1049,6 +1064,9 @@
{cb2b0073-f2a7-5c63-d182-8874b24bdf36}
+
+ {0048bb64-a4b2-9f8e-c029-b43c8c207264}
+
{c4661d64-349f-01c1-1ba8-0602f9047595}
diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
index ad9589d3475aa..d74b755f36ba7 100644
--- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
+++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj
@@ -295,6 +295,7 @@
+
@@ -370,6 +371,7 @@
+
@@ -455,6 +457,8 @@
+
+
@@ -617,6 +621,8 @@
+
+
diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters
index c26b8befd8ae0..c669a243c8657 100644
--- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters
+++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters
@@ -91,6 +91,9 @@
src\core\ext\lb_policy\round_robin
+
+ src\core\ext\load_reporting
+
src\core\ext\resolver\dns\native
@@ -334,6 +337,9 @@
src\core\lib\json
+
+ src\core\lib\load_reporting
+
src\core\lib\surface
@@ -536,6 +542,9 @@
src\core\ext\lb_policy\grpclb\proto\grpc\lb\v0
+
+ src\core\ext\load_reporting
+
src\core\ext\transport\chttp2\transport
@@ -761,6 +770,9 @@
src\core\lib\json
+
+ src\core\lib\load_reporting
+
src\core\lib\surface
@@ -884,6 +896,9 @@
{e5fc1091-5d60-404f-775b-686ef4b3266f}
+
+ {2d6e3879-24c7-06e2-b415-40ab18a3b918}
+
{88c78e27-267a-95df-07c5-50e5fbc2f40c}
@@ -938,6 +953,9 @@
{681cdaeb-c47f-8853-d985-bf13c2873947}
+
+ {2d492e12-b2aa-48d8-8e90-c55a605fb34a}
+
{506dc3b3-d884-2b59-0dfa-57ed6affa2d3}
diff --git a/vsprojects/vcxproj/test/load_reporting_registration_test/load_reporting_registration_test.vcxproj b/vsprojects/vcxproj/test/load_reporting_registration_test/load_reporting_registration_test.vcxproj
new file mode 100644
index 0000000000000..d1e3d703c72c5
--- /dev/null
+++ b/vsprojects/vcxproj/test/load_reporting_registration_test/load_reporting_registration_test.vcxproj
@@ -0,0 +1,199 @@
+
+
+
+
+
+ Debug
+ Win32
+
+
+ Debug
+ x64
+
+
+ Release
+ Win32
+
+
+ Release
+ x64
+
+
+
+ {2C80EA2B-46FC-0997-E01A-F29EC3968799}
+ true
+ $(SolutionDir)IntDir\$(MSBuildProjectName)\
+
+
+
+ v100
+
+
+ v110
+
+
+ v120
+
+
+ v140
+
+
+ Application
+ true
+ Unicode
+
+
+ Application
+ false
+ true
+ Unicode
+
+
+
+
+
+
+
+
+
+
+
+
+
+ load_reporting_registration_test
+ static
+ Debug
+ static
+ Debug
+
+
+ load_reporting_registration_test
+ static
+ Release
+ static
+ Release
+
+
+
+ NotUsing
+ Level3
+ Disabled
+ WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDebug
+ true
+ None
+ false
+
+
+ Console
+ true
+ false
+
+
+
+
+
+ NotUsing
+ Level3
+ Disabled
+ WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)
+ true
+ MultiThreadedDebug
+ true
+ None
+ false
+
+
+ Console
+ true
+ false
+
+
+
+
+
+ NotUsing
+ Level3
+ MaxSpeed
+ WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+ true
+ true
+ true
+ MultiThreaded
+ true
+ None
+ false
+
+
+ Console
+ true
+ false
+ true
+ true
+
+
+
+
+
+ NotUsing
+ Level3
+ MaxSpeed
+ WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)
+ true
+ true
+ true
+ MultiThreaded
+ true
+ None
+ false
+
+
+ Console
+ true
+ false
+ true
+ true
+
+
+
+
+
+
+
+
+
+ {17BCAFC0-5FDC-4C94-AEB9-95F3E220614B}
+
+
+ {29D16885-7228-4C31-81ED-5F9187C7F2A9}
+
+
+ {EAB0A629-17A9-44DB-B5FF-E91A721FE037}
+
+
+ {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.
+
+
+
+
+
+
+
+
+
diff --git a/vsprojects/vcxproj/test/load_reporting_registration_test/load_reporting_registration_test.vcxproj.filters b/vsprojects/vcxproj/test/load_reporting_registration_test/load_reporting_registration_test.vcxproj.filters
new file mode 100644
index 0000000000000..69b5cd5af4bc8
--- /dev/null
+++ b/vsprojects/vcxproj/test/load_reporting_registration_test/load_reporting_registration_test.vcxproj.filters
@@ -0,0 +1,21 @@
+
+
+
+
+ test\core\load_reporting
+
+
+
+
+
+ {950938ee-82ca-61f1-2c15-25af9a3cae2f}
+
+
+ {23ff812e-a51d-2d43-3a02-fd70dce0f5cf}
+
+
+ {0ddb1f19-8a9e-1216-4470-3449d37480db}
+
+
+
+
From d658b4c926182ab0affe986e1fe03bbc44d93224 Mon Sep 17 00:00:00 2001
From: David Garcia Quintas
Date: Wed, 6 Apr 2016 18:17:00 -0700
Subject: [PATCH 003/218] fixed test
---
test/core/load_reporting/load_reporting_registration.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/core/load_reporting/load_reporting_registration.c b/test/core/load_reporting/load_reporting_registration.c
index fa3b568781206..4361682781722 100644
--- a/test/core/load_reporting/load_reporting_registration.c
+++ b/test/core/load_reporting/load_reporting_registration.c
@@ -41,7 +41,7 @@
#include "test/core/util/test_config.h"
static void noop(load_reporting_data *lr_data) {
- uintptr_t *d = (uintptr_t *)(lr_data->data);
+ uint32_t *d = (uint32_t *)(lr_data->data);
*d = 0xdeadbeef;
}
@@ -58,7 +58,7 @@ static void test_load_reporter_registration(void) {
lr_data.data = gpr_malloc(sizeof(uint32_t));
grpc_load_reporting_call(&lr_data);
- GPR_ASSERT(*((uintptr_t *)lr_data.data) == 0xdeadbeef);
+ GPR_ASSERT(*((uint32_t *)lr_data.data) == 0xdeadbeef);
gpr_free(lr_data.data);
}
From 76cfc6ac97cd542f331aff60aaa273fccdaed815 Mon Sep 17 00:00:00 2001
From: Sree Kuchibhotla
Date: Thu, 7 Apr 2016 18:32:44 -0700
Subject: [PATCH 004/218] Some comments
---
src/core/lib/iomgr/ev_poll_and_epoll_posix.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/core/lib/iomgr/ev_poll_and_epoll_posix.c b/src/core/lib/iomgr/ev_poll_and_epoll_posix.c
index 3c8127e1a8c13..306d312dc4e36 100644
--- a/src/core/lib/iomgr/ev_poll_and_epoll_posix.c
+++ b/src/core/lib/iomgr/ev_poll_and_epoll_posix.c
@@ -756,9 +756,14 @@ static void pollset_kick_ext(grpc_pollset *p,
specific_worker = pop_front_worker(p);
if (specific_worker != NULL) {
if (gpr_tls_get(&g_current_thread_worker) == (intptr_t)specific_worker) {
+ /* Prefer not to kick self. Push the worker to the end of the list and
+ * pop the one from front */
GPR_TIMER_MARK("kick_anonymous_not_self", 0);
push_back_worker(p, specific_worker);
specific_worker = pop_front_worker(p);
+ /* If there was only one worker on the pollset, we would get the same
+ * worker we pushed (the one set on current thread local) back. If so,
+ * kick it only if GRPC_POLLSET_CAN_KICK_SELF flag is set */
if ((flags & GRPC_POLLSET_CAN_KICK_SELF) == 0 &&
gpr_tls_get(&g_current_thread_worker) ==
(intptr_t)specific_worker) {
From 42b004a2a5f785094f6c9bccaf4090e2c7c6e9b5 Mon Sep 17 00:00:00 2001
From: Sree Kuchibhotla
Date: Fri, 8 Apr 2016 14:41:49 -0700
Subject: [PATCH 005/218] first cut of changes
---
src/core/lib/iomgr/ev_poll_and_epoll_posix.c | 130 ++++++++++++++++---
src/core/lib/iomgr/ev_posix.c | 4 +
src/core/lib/iomgr/ev_posix.h | 6 +
src/core/lib/iomgr/tcp_server_posix.c | 29 ++++-
src/core/lib/surface/server.c | 5 +-
5 files changed, 151 insertions(+), 23 deletions(-)
diff --git a/src/core/lib/iomgr/ev_poll_and_epoll_posix.c b/src/core/lib/iomgr/ev_poll_and_epoll_posix.c
index 306d312dc4e36..77a67d2007881 100644
--- a/src/core/lib/iomgr/ev_poll_and_epoll_posix.c
+++ b/src/core/lib/iomgr/ev_poll_and_epoll_posix.c
@@ -126,6 +126,9 @@ struct grpc_fd {
grpc_closure *on_done_closure;
grpc_iomgr_object iomgr_object;
+
+ /* The pollset that last noticed and notified that the fd is readable */
+ grpc_pollset *read_notifier_pollset;
};
/* Begin polling on an fd.
@@ -147,7 +150,8 @@ static uint32_t fd_begin_poll(grpc_fd *fd, grpc_pollset *pollset,
if got_read or got_write are 1, also does the become_{readable,writable} as
appropriate. */
static void fd_end_poll(grpc_exec_ctx *exec_ctx, grpc_fd_watcher *rec,
- int got_read, int got_write);
+ int got_read, int got_write,
+ grpc_pollset *read_notifier_pollset);
/* Return 1 if this fd is orphaned, 0 otherwise */
static bool fd_is_orphaned(grpc_fd *fd);
@@ -342,6 +346,7 @@ static grpc_fd *alloc_fd(int fd) {
r->on_done_closure = NULL;
r->closed = 0;
r->released = 0;
+ r->read_notifier_pollset = NULL;
gpr_mu_unlock(&r->mu);
return r;
}
@@ -511,9 +516,17 @@ static void fd_unref(grpc_fd *fd) { unref_by(fd, 2); }
static void notify_on_locked(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
grpc_closure **st, grpc_closure *closure) {
if (*st == CLOSURE_NOT_READY) {
+ /* TODO (sreek): Remove following log line */
+ gpr_log(GPR_INFO, "\t>> notify_on_locked: (fd:%d) CLOSURE_NOT_READY -> %p",
+ fd->fd, closure);
/* not ready ==> switch to a waiting state by setting the closure */
*st = closure;
} else if (*st == CLOSURE_READY) {
+ /* TODO (sreek): Remove following log line */
+ gpr_log(GPR_INFO,
+ "\t>> notify_on_locked: (fd:%d) CLOSURE_READY -> CLOSURE_NOT_READY "
+ "(enqueue: %p)",
+ fd->fd, closure);
/* already ready ==> queue the closure to run immediately */
*st = CLOSURE_NOT_READY;
grpc_exec_ctx_enqueue(exec_ctx, closure, !fd->shutdown, NULL);
@@ -532,19 +545,41 @@ static int set_ready_locked(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
grpc_closure **st) {
if (*st == CLOSURE_READY) {
/* duplicate ready ==> ignore */
+ /* TODO (sreek): Remove following log line */
+ gpr_log(GPR_INFO,
+ "\t>> set_ready_locked: (fd:%d) CLOSURE_READY -> CLOSURE_READY (no "
+ "change)",
+ fd->fd);
return 0;
} else if (*st == CLOSURE_NOT_READY) {
/* not ready, and not waiting ==> flag ready */
+ /* TODO (sreek): Remove following log line */
+ gpr_log(GPR_INFO,
+ "\t>> set_ready_locked: (fd:%d) CLOSURE_NOT_READY -> CLOSURE_READY",
+ fd->fd);
*st = CLOSURE_READY;
return 0;
} else {
/* waiting ==> queue closure */
+ /* TODO (sreek): Remove following log line */
+ gpr_log(GPR_INFO,
+ "\t>> set_ready_locked: (fd:%d) Enqueue %p -> CLOSURE_NOT_READY",
+ fd->fd, *st);
grpc_exec_ctx_enqueue(exec_ctx, *st, !fd->shutdown, NULL);
*st = CLOSURE_NOT_READY;
return 1;
}
}
+static void set_read_notifier_pollset_locked(
+ grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_pollset *read_notifier_pollset) {
+ /* TODO(sreek): Remove the following log line */
+ gpr_log(GPR_INFO, "\t>> Set read notifier (fd:%d): %p --> %p", fd->fd,
+ fd->read_notifier_pollset, read_notifier_pollset);
+
+ fd->read_notifier_pollset = read_notifier_pollset;
+}
+
static void fd_shutdown(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
gpr_mu_lock(&fd->mu);
GPR_ASSERT(!fd->shutdown);
@@ -568,6 +603,18 @@ static void fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
gpr_mu_unlock(&fd->mu);
}
+/* Return the read-notifier pollset */
+static grpc_pollset *fd_get_read_notifier_pollset(grpc_exec_ctx *exec_ctx,
+ grpc_fd *fd) {
+ grpc_pollset *notifier = NULL;
+
+ gpr_mu_lock(&fd->mu);
+ notifier = fd->read_notifier_pollset;
+ gpr_mu_unlock(&fd->mu);
+
+ return notifier;
+}
+
static uint32_t fd_begin_poll(grpc_fd *fd, grpc_pollset *pollset,
grpc_pollset_worker *worker, uint32_t read_mask,
uint32_t write_mask, grpc_fd_watcher *watcher) {
@@ -620,7 +667,8 @@ static uint32_t fd_begin_poll(grpc_fd *fd, grpc_pollset *pollset,
}
static void fd_end_poll(grpc_exec_ctx *exec_ctx, grpc_fd_watcher *watcher,
- int got_read, int got_write) {
+ int got_read, int got_write,
+ grpc_pollset *read_notifier_pollset) {
int was_polling = 0;
int kick = 0;
grpc_fd *fd = watcher->fd;
@@ -653,11 +701,27 @@ static void fd_end_poll(grpc_exec_ctx *exec_ctx, grpc_fd_watcher *watcher,
watcher->prev->next = watcher->next;
}
if (got_read) {
+ /*TODO(sreek): Delete this log line */
+ gpr_log(GPR_INFO,
+ "\t>> fd_end_poll(): GOT READ Calling set_ready_locked. fd: %d, "
+ "fd->read_closure: %p, "
+ "notifier_pollset: %p",
+ fd->fd, fd->read_closure, read_notifier_pollset);
+
if (set_ready_locked(exec_ctx, fd, &fd->read_closure)) {
kick = 1;
}
+
+ if (read_notifier_pollset != NULL) {
+ set_read_notifier_pollset_locked(exec_ctx, fd, read_notifier_pollset);
+ }
}
if (got_write) {
+ /*TODO(sreek): Delete this log line */
+ gpr_log(GPR_INFO,
+ "\t>> fd_end_poll(): GOT WRITE set_ready_locked. fd: %d, "
+ "fd->write_closure: %p",
+ fd->fd, fd->write_closure);
if (set_ready_locked(exec_ctx, fd, &fd->write_closure)) {
kick = 1;
}
@@ -1208,11 +1272,11 @@ static void basic_pollset_maybe_work_and_unlock(grpc_exec_ctx *exec_ctx,
gpr_log(GPR_ERROR, "poll() failed: %s", strerror(errno));
}
if (fd) {
- fd_end_poll(exec_ctx, &fd_watcher, 0, 0);
+ fd_end_poll(exec_ctx, &fd_watcher, 0, 0, NULL);
}
} else if (r == 0) {
if (fd) {
- fd_end_poll(exec_ctx, &fd_watcher, 0, 0);
+ fd_end_poll(exec_ctx, &fd_watcher, 0, 0, NULL);
}
} else {
if (pfd[0].revents & POLLIN_CHECK) {
@@ -1222,10 +1286,16 @@ static void basic_pollset_maybe_work_and_unlock(grpc_exec_ctx *exec_ctx,
grpc_wakeup_fd_consume_wakeup(&worker->wakeup_fd->fd);
}
if (nfds > 2) {
+ /* TODO(sreek): delete the following comment line */
+ gpr_log(
+ GPR_INFO,
+ "\t>> basic_pollset_maybe_work_and_unlock(): fd->fd: %d, pollset: %p "
+ "is readable (calling fd_end_poll()) -------------------------------",
+ pfd[2].fd, pollset);
fd_end_poll(exec_ctx, &fd_watcher, pfd[2].revents & POLLIN_CHECK,
- pfd[2].revents & POLLOUT_CHECK);
+ pfd[2].revents & POLLOUT_CHECK, pollset);
} else if (fd) {
- fd_end_poll(exec_ctx, &fd_watcher, 0, 0);
+ fd_end_poll(exec_ctx, &fd_watcher, 0, 0, NULL);
}
}
@@ -1361,11 +1431,11 @@ static void multipoll_with_poll_pollset_maybe_work_and_unlock(
gpr_log(GPR_ERROR, "poll() failed: %s", strerror(errno));
}
for (i = 2; i < pfd_count; i++) {
- fd_end_poll(exec_ctx, &watchers[i], 0, 0);
+ fd_end_poll(exec_ctx, &watchers[i], 0, 0, NULL);
}
} else if (r == 0) {
for (i = 2; i < pfd_count; i++) {
- fd_end_poll(exec_ctx, &watchers[i], 0, 0);
+ fd_end_poll(exec_ctx, &watchers[i], 0, 0, NULL);
}
} else {
if (pfds[0].revents & POLLIN_CHECK) {
@@ -1376,11 +1446,16 @@ static void multipoll_with_poll_pollset_maybe_work_and_unlock(
}
for (i = 2; i < pfd_count; i++) {
if (watchers[i].fd == NULL) {
- fd_end_poll(exec_ctx, &watchers[i], 0, 0);
+ fd_end_poll(exec_ctx, &watchers[i], 0, 0, NULL);
continue;
}
+ /*TODO(sree) - Delete this log line*/
+ gpr_log(GPR_INFO,
+ "multipoll_with_poll_pollset(). fd: %d became redable. Pollset: "
+ "%p (calling fd_end_poll())*************",
+ pfds[i].fd, pollset);
fd_end_poll(exec_ctx, &watchers[i], pfds[i].revents & POLLIN_CHECK,
- pfds[i].revents & POLLOUT_CHECK);
+ pfds[i].revents & POLLOUT_CHECK, pollset);
}
}
@@ -1456,20 +1531,31 @@ static void poll_become_multipoller(grpc_exec_ctx *exec_ctx,
#include "src/core/lib/profiling/timers.h"
#include "src/core/lib/support/block_annotate.h"
-static void set_ready(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure **st) {
+static void set_ready(grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_closure **st,
+ grpc_pollset *read_notifier_pollset) {
/* only one set_ready can be active at once (but there may be a racing
notify_on) */
gpr_mu_lock(&fd->mu);
set_ready_locked(exec_ctx, fd, st);
+
+ /* A non-NULL read_notifier_pollset means that the fd is readable. */
+ if (read_notifier_pollset != NULL) {
+ /* Note: Since the fd might be a part of multiple pollsets, this might be
+ * called multiple times (for each time the fd becomes readable) and it is
+ * okay to set the fd's read-notifier pollset to anyone of these pollsets */
+ set_read_notifier_pollset_locked(exec_ctx, fd, read_notifier_pollset);
+ }
+
gpr_mu_unlock(&fd->mu);
}
-static void fd_become_readable(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
- set_ready(exec_ctx, fd, &fd->read_closure);
+static void fd_become_readable(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
+ grpc_pollset *notifier_pollset) {
+ set_ready(exec_ctx, fd, &fd->read_closure, notifier_pollset);
}
static void fd_become_writable(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
- set_ready(exec_ctx, fd, &fd->write_closure);
+ set_ready(exec_ctx, fd, &fd->write_closure, NULL);
}
struct epoll_fd_list {
@@ -1561,7 +1647,7 @@ static void finally_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
}
}
}
- fd_end_poll(exec_ctx, &watcher, 0, 0);
+ fd_end_poll(exec_ctx, &watcher, 0, 0, NULL);
}
static void perform_delayed_add(grpc_exec_ctx *exec_ctx, void *arg,
@@ -1675,9 +1761,20 @@ static void multipoll_with_epoll_pollset_maybe_work_and_unlock(
grpc_wakeup_fd_consume_wakeup(&grpc_global_wakeup_fd);
} else {
if (read_ev || cancel) {
- fd_become_readable(exec_ctx, fd);
+ /* TODO(sreek): Delete this once the issue #5470 is resolved */
+ gpr_log(
+ GPR_INFO,
+ "\t>> multipoll_with_epoll_pollset: Calling "
+ "fd_become_readable(fd->fd: %d, pollset: %p) ++++++++++++",
+ fd->fd, pollset);
+ fd_become_readable(exec_ctx, fd, pollset);
}
if (write_ev || cancel) {
+ /* TODO(sreek): Delete the following log line */
+ gpr_log(GPR_INFO,
+ "\t>> multipoll_with_epoll_pollset: Calling "
+ "fd_become_writable(fd: %d)",
+ fd->fd);
fd_become_writable(exec_ctx, fd);
}
}
@@ -1904,6 +2001,7 @@ static const grpc_event_engine_vtable vtable = {
.fd_shutdown = fd_shutdown,
.fd_notify_on_read = fd_notify_on_read,
.fd_notify_on_write = fd_notify_on_write,
+ .fd_get_read_notifier_pollset = fd_get_read_notifier_pollset,
.pollset_init = pollset_init,
.pollset_shutdown = pollset_shutdown,
diff --git a/src/core/lib/iomgr/ev_posix.c b/src/core/lib/iomgr/ev_posix.c
index 0eb95a2e091a0..af4126c900ce8 100644
--- a/src/core/lib/iomgr/ev_posix.c
+++ b/src/core/lib/iomgr/ev_posix.c
@@ -83,6 +83,10 @@ void grpc_fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
g_event_engine->fd_notify_on_write(exec_ctx, fd, closure);
}
+grpc_pollset *grpc_fd_get_read_notifier_pollset(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
+ return g_event_engine->fd_get_read_notifier_pollset(exec_ctx, fd);
+}
+
size_t grpc_pollset_size(void) { return g_event_engine->pollset_size; }
void grpc_pollset_init(grpc_pollset *pollset, gpr_mu **mu) {
diff --git a/src/core/lib/iomgr/ev_posix.h b/src/core/lib/iomgr/ev_posix.h
index 1fa9f5ef2d69f..4cfa83e6a23d5 100644
--- a/src/core/lib/iomgr/ev_posix.h
+++ b/src/core/lib/iomgr/ev_posix.h
@@ -55,6 +55,8 @@ typedef struct grpc_event_engine_vtable {
grpc_closure *closure);
void (*fd_notify_on_write)(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
grpc_closure *closure);
+ grpc_pollset *(*fd_get_read_notifier_pollset)(grpc_exec_ctx *exec_ctx,
+ grpc_fd *fd);
void (*pollset_init)(grpc_pollset *pollset, gpr_mu **mu);
void (*pollset_shutdown)(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
@@ -137,6 +139,10 @@ void grpc_fd_notify_on_read(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
void grpc_fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
grpc_closure *closure);
+/* Return the read notifier pollset from the fd */
+grpc_pollset *grpc_fd_get_read_notifier_pollset(grpc_exec_ctx *exec_ctx,
+ grpc_fd *fd);
+
/* pollset_posix functions */
/* Add an fd to a pollset */
diff --git a/src/core/lib/iomgr/tcp_server_posix.c b/src/core/lib/iomgr/tcp_server_posix.c
index cfb5251684503..03318151ccf73 100644
--- a/src/core/lib/iomgr/tcp_server_posix.c
+++ b/src/core/lib/iomgr/tcp_server_posix.c
@@ -310,13 +310,20 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *arg, bool success) {
grpc_tcp_listener *sp = arg;
grpc_tcp_server_acceptor acceptor = {sp->server, sp->port_index,
sp->fd_index};
+ grpc_pollset *read_notifier_pollset = NULL;
grpc_fd *fdobj;
- size_t i;
if (!success) {
goto error;
}
+ /* TODO(sreek): Delete the following log line */
+ gpr_log(GPR_INFO, "\t\t** tcp_server_posix.on_read(): Getting read notifier");
+ read_notifier_pollset = grpc_fd_get_read_notifier_pollset(exec_ctx, sp->emfd);
+ /* TODO(sreek): Delete the following log line */
+ gpr_log(GPR_INFO, "\t\t** tcp_server_posix.on_read(): Got read notifier: %p",
+ read_notifier_pollset);
+
/* loop until accept4 returns EAGAIN, and then re-arm notification */
for (;;) {
struct sockaddr_storage addr;
@@ -349,12 +356,22 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *arg, bool success) {
}
fdobj = grpc_fd_create(fd, name);
- /* TODO(ctiller): revise this when we have server-side sharding
- of channels -- we certainly should not be automatically adding every
- incoming channel to every pollset owned by the server */
- for (i = 0; i < sp->server->pollset_count; i++) {
- grpc_pollset_add_fd(exec_ctx, sp->server->pollsets[i], fdobj);
+
+ if (read_notifier_pollset == NULL) {
+ /* TODO(sreek): Check when this would happen - Ideally this should not
+ * happen. Remove the next log-line once this is resolved */
+ gpr_log(GPR_INFO, "\t** *******!!! tcp_server_posix.on_read(): "
+ "read_notifier_pollset is NULL. !!!**********************");
+
+ gpr_log(GPR_ERROR, "Read notifier pollset is not set on the fd");
+ goto error;
}
+
+ /* TODO(sreek): Delete the following log line */
+ gpr_log(GPR_INFO, "\t\t** tcp_server_posix.on_read(): Adding fd %d *only* to pollset %p",
+ fd, read_notifier_pollset);
+ grpc_pollset_add_fd(exec_ctx, read_notifier_pollset, fdobj);
+
sp->server->on_accept_cb(
exec_ctx, sp->server->on_accept_cb_arg,
grpc_tcp_create(fdobj, GRPC_TCP_DEFAULT_READ_SLICE_SIZE, addr_str),
diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c
index ad8ee8c7a99ef..25b6886f24151 100644
--- a/src/core/lib/surface/server.c
+++ b/src/core/lib/surface/server.c
@@ -1018,7 +1018,6 @@ void grpc_server_start(grpc_server *server) {
void grpc_server_setup_transport(grpc_exec_ctx *exec_ctx, grpc_server *s,
grpc_transport *transport,
const grpc_channel_args *args) {
- size_t i;
size_t num_registered_methods;
size_t alloc;
registered_method *rm;
@@ -1033,11 +1032,15 @@ void grpc_server_setup_transport(grpc_exec_ctx *exec_ctx, grpc_server *s,
uint32_t max_probes = 0;
grpc_transport_op op;
+ /* TODO(sreek): Delete this commented block once issue #5470 is resolved */
+ /*
+ size_t i;
for (i = 0; i < s->cq_count; i++) {
memset(&op, 0, sizeof(op));
op.bind_pollset = grpc_cq_pollset(s->cqs[i]);
grpc_transport_perform_op(exec_ctx, transport, &op);
}
+ */
channel =
grpc_channel_create(exec_ctx, NULL, args, GRPC_SERVER_CHANNEL, transport);
From 47ef37a9ad495a09ffe4820c9b46963796ff3370 Mon Sep 17 00:00:00 2001
From: Sree Kuchibhotla
Date: Mon, 11 Apr 2016 18:59:23 -0700
Subject: [PATCH 006/218] test cases
---
test/core/iomgr/fd_posix_test.c | 98 +++++++++++++++++++++++++++++++++
1 file changed, 98 insertions(+)
diff --git a/test/core/iomgr/fd_posix_test.c b/test/core/iomgr/fd_posix_test.c
index f97f33712eb17..18cd825df0010 100644
--- a/test/core/iomgr/fd_posix_test.c
+++ b/test/core/iomgr/fd_posix_test.c
@@ -518,6 +518,103 @@ static void destroy_pollset(grpc_exec_ctx *exec_ctx, void *p, bool success) {
grpc_pollset_destroy(p);
}
+typedef struct read_notifier_test_fd_context {
+ grpc_fd *fd;
+ bool is_cb_called;
+} read_notifier_test_fd_context;
+
+static void read_notifier_test_callback(
+ grpc_exec_ctx *exec_ctx, void *arg /* (read_notifier_test_fd_context *) */,
+ bool success) {
+ read_notifier_test_fd_context *fd_context = arg;
+ grpc_fd *fd = fd_context->fd;
+
+ /* Verify that the read notifier pollset is set */
+ GPR_ASSERT(grpc_fd_get_read_notifier_pollset(exec_ctx, fd) != NULL);
+ fd_context->is_cb_called = true;
+}
+
+/* sv MUST to be an array of size 2 */
+static void get_socket_pair(int sv[]) {
+ int flags = 0;
+ GPR_ASSERT(socketpair(AF_UNIX, SOCK_STREAM, 0, sv) == 0);
+ flags = fcntl(sv[0], F_GETFL, 0);
+ GPR_ASSERT(fcntl(sv[0], F_SETFL, flags | O_NONBLOCK) == 0);
+ flags = fcntl(sv[1], F_GETFL, 0);
+ GPR_ASSERT(fcntl(sv[1], F_SETFL, flags | O_NONBLOCK) == 0);
+}
+
+static grpc_pollset *create_grpc_pollset(gpr_mu **mu) {
+ grpc_pollset *pollset = gpr_malloc(grpc_pollset_size());
+ grpc_pollset_init(pollset, mu);
+ return pollset;
+}
+
+static void free_grpc_pollset(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset) {
+ grpc_closure destroyed;
+ grpc_closure_init(&destroyed, destroy_pollset, pollset);
+ grpc_pollset_shutdown(exec_ctx, pollset, &destroyed);
+ grpc_exec_ctx_finish(exec_ctx);
+ gpr_free(pollset);
+}
+
+static void test_grpc_fd_read_notifier_pollset(void) {
+ grpc_fd *em_fd[2];
+ read_notifier_test_fd_context fd_context;
+ int sv[2][2];
+ char data;
+ ssize_t result;
+ int i;
+ grpc_closure on_read_closure;
+ gpr_mu *mu;
+ grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+
+ grpc_pollset *pollset = create_grpc_pollset(&mu);
+
+ for (i = 0; i < 2; i++) {
+ get_socket_pair(sv[i]);
+
+ em_fd[i] = grpc_fd_create(sv[i][0], "test_grpc_fd_1_read_notifier_pollset");
+
+ grpc_pollset_add_fd(&exec_ctx, pollset, em_fd[i]);
+
+ on_read_closure.cb = read_notifier_test_callback;
+ fd_context.fd = em_fd[i];
+ fd_context.is_cb_called = false;
+ on_read_closure.cb_arg = &fd_context;
+ grpc_fd_notify_on_read(&exec_ctx, em_fd[i], &on_read_closure);
+
+ data = 0;
+ result = write(sv[i][1], &data, sizeof(data));
+ GPR_ASSERT(result == 1);
+
+ gpr_mu_lock(mu);
+ while (!fd_context.is_cb_called) {
+ grpc_pollset_worker *worker = NULL;
+ grpc_pollset_work(&exec_ctx, pollset, &worker,
+ gpr_now(GPR_CLOCK_MONOTONIC),
+ gpr_inf_future(GPR_CLOCK_MONOTONIC));
+ gpr_mu_unlock(mu);
+ grpc_exec_ctx_finish(&exec_ctx);
+ gpr_mu_lock(mu);
+ }
+ gpr_mu_unlock(mu);
+
+ /* Drain the socket (Not really needed for the test) */
+ result = read(sv[i][0], &data, 1);
+ GPR_ASSERT(result == 1);
+ }
+
+
+ for (i = 0; i < 2; i++) {
+ grpc_fd_orphan(&exec_ctx, em_fd[i], NULL, NULL, "");
+ close(sv[i][1]);
+ }
+
+ free_grpc_pollset(&exec_ctx, pollset);
+ grpc_exec_ctx_finish(&exec_ctx);
+}
+
int main(int argc, char **argv) {
grpc_closure destroyed;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
@@ -527,6 +624,7 @@ int main(int argc, char **argv) {
grpc_pollset_init(g_pollset, &g_mu);
test_grpc_fd();
test_grpc_fd_change();
+ test_grpc_fd_read_notifier_pollset();
grpc_closure_init(&destroyed, destroy_pollset, g_pollset);
grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
grpc_exec_ctx_finish(&exec_ctx);
From 89bbc7817a7e68d9bbc6207af34614e1610c70e6 Mon Sep 17 00:00:00 2001
From: Sree Kuchibhotla
Date: Mon, 11 Apr 2016 23:10:13 -0700
Subject: [PATCH 007/218] Rewrite test case to handle more scenarios
---
test/core/iomgr/fd_posix_test.c | 78 +++++++++++++++++++++++----------
1 file changed, 55 insertions(+), 23 deletions(-)
diff --git a/test/core/iomgr/fd_posix_test.c b/test/core/iomgr/fd_posix_test.c
index 18cd825df0010..187720e1de2e3 100644
--- a/test/core/iomgr/fd_posix_test.c
+++ b/test/core/iomgr/fd_posix_test.c
@@ -554,64 +554,95 @@ static void free_grpc_pollset(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset) {
grpc_closure destroyed;
grpc_closure_init(&destroyed, destroy_pollset, pollset);
grpc_pollset_shutdown(exec_ctx, pollset, &destroyed);
- grpc_exec_ctx_finish(exec_ctx);
+ grpc_exec_ctx_flush(exec_ctx);
gpr_free(pollset);
}
-static void test_grpc_fd_read_notifier_pollset(void) {
+/* This tests that the read_notifier_pollset field of a grpc_fd is properly
+ set when the grpc_fd becomes readable
+ - This tests both basic and multi pollsets
+ - The parameter register_cb_after_read_event controls whether the on-read
+ callback registration (i.e the one done by grpc_fd_notify_on_read()) is
+ done either before or after the fd becomes readable
+ */
+static void test_grpc_fd_read_notifier_pollset(
+ bool register_cb_after_read_event) {
grpc_fd *em_fd[2];
- read_notifier_test_fd_context fd_context;
int sv[2][2];
+ gpr_mu *mu[2];
+ grpc_pollset *pollset[2];
char data;
ssize_t result;
int i;
+ grpc_pollset_worker *worker;
+ read_notifier_test_fd_context fd_context;
grpc_closure on_read_closure;
- gpr_mu *mu;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
- grpc_pollset *pollset = create_grpc_pollset(&mu);
-
for (i = 0; i < 2; i++) {
- get_socket_pair(sv[i]);
+ pollset[i] = create_grpc_pollset(&mu[i]);
+ get_socket_pair(sv[i]); /* sv[i][0] & sv[i][1] will have the socket pair */
+ em_fd[i] = grpc_fd_create(sv[i][0], "test_grpc_fd_read_notifier_pollset");
+ grpc_pollset_add_fd(&exec_ctx, pollset[i], em_fd[i]);
+ }
- em_fd[i] = grpc_fd_create(sv[i][0], "test_grpc_fd_1_read_notifier_pollset");
+ /* At this point pollset[0] has em_fd[0] and pollset[1] has em_fd[1] and both
+ are basic pollsets. Make pollset[1] a multi-pollset by adding em_fd[0] to
+ it */
+ grpc_pollset_add_fd(&exec_ctx, pollset[1], em_fd[0]);
+ grpc_exec_ctx_flush(&exec_ctx);
- grpc_pollset_add_fd(&exec_ctx, pollset, em_fd[i]);
+ /* The following tests that the read_notifier_pollset is correctly set on the
+ grpc_fd structure in both basic pollset and multi pollset cases.
+ pollset[0] is a basic pollset containing just em_fd[0]
+ pollset[1] is a multi pollset containing em_fd[0] and em_fd[1] */
+ for (i = 0; i < 2; i++) {
on_read_closure.cb = read_notifier_test_callback;
fd_context.fd = em_fd[i];
fd_context.is_cb_called = false;
on_read_closure.cb_arg = &fd_context;
- grpc_fd_notify_on_read(&exec_ctx, em_fd[i], &on_read_closure);
+
+ if (!register_cb_after_read_event) {
+ /* Registering the callback BEFORE the fd is readable */
+ grpc_fd_notify_on_read(&exec_ctx, em_fd[i], &on_read_closure);
+ }
data = 0;
result = write(sv[i][1], &data, sizeof(data));
GPR_ASSERT(result == 1);
- gpr_mu_lock(mu);
- while (!fd_context.is_cb_called) {
- grpc_pollset_worker *worker = NULL;
- grpc_pollset_work(&exec_ctx, pollset, &worker,
- gpr_now(GPR_CLOCK_MONOTONIC),
- gpr_inf_future(GPR_CLOCK_MONOTONIC));
- gpr_mu_unlock(mu);
- grpc_exec_ctx_finish(&exec_ctx);
- gpr_mu_lock(mu);
+ /* grpc_pollset_work requires the caller to hold the pollset mutex */
+ gpr_mu_lock(mu[i]);
+ worker = NULL;
+ grpc_pollset_work(&exec_ctx, pollset[i], &worker,
+ gpr_now(GPR_CLOCK_MONOTONIC),
+ gpr_inf_future(GPR_CLOCK_MONOTONIC));
+ gpr_mu_unlock(mu[i]);
+ grpc_exec_ctx_flush(&exec_ctx);
+
+ if (register_cb_after_read_event) {
+ /* Registering the callback after the fd is readable. In this case, the
+ callback should be executed right away. */
+ grpc_fd_notify_on_read(&exec_ctx, em_fd[i], &on_read_closure);
+ grpc_exec_ctx_flush(&exec_ctx);
}
- gpr_mu_unlock(mu);
+
+ /* The callback should have been called by now */
+ GPR_ASSERT(fd_context.is_cb_called);
/* Drain the socket (Not really needed for the test) */
result = read(sv[i][0], &data, 1);
GPR_ASSERT(result == 1);
}
-
+ /* Clean up */
for (i = 0; i < 2; i++) {
grpc_fd_orphan(&exec_ctx, em_fd[i], NULL, NULL, "");
close(sv[i][1]);
+ free_grpc_pollset(&exec_ctx, pollset[i]);
}
- free_grpc_pollset(&exec_ctx, pollset);
grpc_exec_ctx_finish(&exec_ctx);
}
@@ -624,7 +655,8 @@ int main(int argc, char **argv) {
grpc_pollset_init(g_pollset, &g_mu);
test_grpc_fd();
test_grpc_fd_change();
- test_grpc_fd_read_notifier_pollset();
+ test_grpc_fd_read_notifier_pollset(false);
+ test_grpc_fd_read_notifier_pollset(true);
grpc_closure_init(&destroyed, destroy_pollset, g_pollset);
grpc_pollset_shutdown(&exec_ctx, g_pollset, &destroyed);
grpc_exec_ctx_finish(&exec_ctx);
From fe115892d52b96946f3e661616468de059347e5c Mon Sep 17 00:00:00 2001
From: Sree Kuchibhotla
Date: Tue, 12 Apr 2016 09:24:38 -0700
Subject: [PATCH 008/218] Delete debug log lines
---
src/core/lib/iomgr/ev_poll_and_epoll_posix.c | 59 --------------------
src/core/lib/iomgr/tcp_server_posix.c | 13 -----
src/core/lib/surface/server.c | 10 ----
3 files changed, 82 deletions(-)
diff --git a/src/core/lib/iomgr/ev_poll_and_epoll_posix.c b/src/core/lib/iomgr/ev_poll_and_epoll_posix.c
index 77a67d2007881..5800b3721068f 100644
--- a/src/core/lib/iomgr/ev_poll_and_epoll_posix.c
+++ b/src/core/lib/iomgr/ev_poll_and_epoll_posix.c
@@ -516,17 +516,9 @@ static void fd_unref(grpc_fd *fd) { unref_by(fd, 2); }
static void notify_on_locked(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
grpc_closure **st, grpc_closure *closure) {
if (*st == CLOSURE_NOT_READY) {
- /* TODO (sreek): Remove following log line */
- gpr_log(GPR_INFO, "\t>> notify_on_locked: (fd:%d) CLOSURE_NOT_READY -> %p",
- fd->fd, closure);
/* not ready ==> switch to a waiting state by setting the closure */
*st = closure;
} else if (*st == CLOSURE_READY) {
- /* TODO (sreek): Remove following log line */
- gpr_log(GPR_INFO,
- "\t>> notify_on_locked: (fd:%d) CLOSURE_READY -> CLOSURE_NOT_READY "
- "(enqueue: %p)",
- fd->fd, closure);
/* already ready ==> queue the closure to run immediately */
*st = CLOSURE_NOT_READY;
grpc_exec_ctx_enqueue(exec_ctx, closure, !fd->shutdown, NULL);
@@ -545,26 +537,13 @@ static int set_ready_locked(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
grpc_closure **st) {
if (*st == CLOSURE_READY) {
/* duplicate ready ==> ignore */
- /* TODO (sreek): Remove following log line */
- gpr_log(GPR_INFO,
- "\t>> set_ready_locked: (fd:%d) CLOSURE_READY -> CLOSURE_READY (no "
- "change)",
- fd->fd);
return 0;
} else if (*st == CLOSURE_NOT_READY) {
/* not ready, and not waiting ==> flag ready */
- /* TODO (sreek): Remove following log line */
- gpr_log(GPR_INFO,
- "\t>> set_ready_locked: (fd:%d) CLOSURE_NOT_READY -> CLOSURE_READY",
- fd->fd);
*st = CLOSURE_READY;
return 0;
} else {
/* waiting ==> queue closure */
- /* TODO (sreek): Remove following log line */
- gpr_log(GPR_INFO,
- "\t>> set_ready_locked: (fd:%d) Enqueue %p -> CLOSURE_NOT_READY",
- fd->fd, *st);
grpc_exec_ctx_enqueue(exec_ctx, *st, !fd->shutdown, NULL);
*st = CLOSURE_NOT_READY;
return 1;
@@ -573,10 +552,6 @@ static int set_ready_locked(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
static void set_read_notifier_pollset_locked(
grpc_exec_ctx *exec_ctx, grpc_fd *fd, grpc_pollset *read_notifier_pollset) {
- /* TODO(sreek): Remove the following log line */
- gpr_log(GPR_INFO, "\t>> Set read notifier (fd:%d): %p --> %p", fd->fd,
- fd->read_notifier_pollset, read_notifier_pollset);
-
fd->read_notifier_pollset = read_notifier_pollset;
}
@@ -701,13 +676,6 @@ static void fd_end_poll(grpc_exec_ctx *exec_ctx, grpc_fd_watcher *watcher,
watcher->prev->next = watcher->next;
}
if (got_read) {
- /*TODO(sreek): Delete this log line */
- gpr_log(GPR_INFO,
- "\t>> fd_end_poll(): GOT READ Calling set_ready_locked. fd: %d, "
- "fd->read_closure: %p, "
- "notifier_pollset: %p",
- fd->fd, fd->read_closure, read_notifier_pollset);
-
if (set_ready_locked(exec_ctx, fd, &fd->read_closure)) {
kick = 1;
}
@@ -717,11 +685,6 @@ static void fd_end_poll(grpc_exec_ctx *exec_ctx, grpc_fd_watcher *watcher,
}
}
if (got_write) {
- /*TODO(sreek): Delete this log line */
- gpr_log(GPR_INFO,
- "\t>> fd_end_poll(): GOT WRITE set_ready_locked. fd: %d, "
- "fd->write_closure: %p",
- fd->fd, fd->write_closure);
if (set_ready_locked(exec_ctx, fd, &fd->write_closure)) {
kick = 1;
}
@@ -1286,12 +1249,6 @@ static void basic_pollset_maybe_work_and_unlock(grpc_exec_ctx *exec_ctx,
grpc_wakeup_fd_consume_wakeup(&worker->wakeup_fd->fd);
}
if (nfds > 2) {
- /* TODO(sreek): delete the following comment line */
- gpr_log(
- GPR_INFO,
- "\t>> basic_pollset_maybe_work_and_unlock(): fd->fd: %d, pollset: %p "
- "is readable (calling fd_end_poll()) -------------------------------",
- pfd[2].fd, pollset);
fd_end_poll(exec_ctx, &fd_watcher, pfd[2].revents & POLLIN_CHECK,
pfd[2].revents & POLLOUT_CHECK, pollset);
} else if (fd) {
@@ -1449,11 +1406,6 @@ static void multipoll_with_poll_pollset_maybe_work_and_unlock(
fd_end_poll(exec_ctx, &watchers[i], 0, 0, NULL);
continue;
}
- /*TODO(sree) - Delete this log line*/
- gpr_log(GPR_INFO,
- "multipoll_with_poll_pollset(). fd: %d became redable. Pollset: "
- "%p (calling fd_end_poll())*************",
- pfds[i].fd, pollset);
fd_end_poll(exec_ctx, &watchers[i], pfds[i].revents & POLLIN_CHECK,
pfds[i].revents & POLLOUT_CHECK, pollset);
}
@@ -1761,20 +1713,9 @@ static void multipoll_with_epoll_pollset_maybe_work_and_unlock(
grpc_wakeup_fd_consume_wakeup(&grpc_global_wakeup_fd);
} else {
if (read_ev || cancel) {
- /* TODO(sreek): Delete this once the issue #5470 is resolved */
- gpr_log(
- GPR_INFO,
- "\t>> multipoll_with_epoll_pollset: Calling "
- "fd_become_readable(fd->fd: %d, pollset: %p) ++++++++++++",
- fd->fd, pollset);
fd_become_readable(exec_ctx, fd, pollset);
}
if (write_ev || cancel) {
- /* TODO(sreek): Delete the following log line */
- gpr_log(GPR_INFO,
- "\t>> multipoll_with_epoll_pollset: Calling "
- "fd_become_writable(fd: %d)",
- fd->fd);
fd_become_writable(exec_ctx, fd);
}
}
diff --git a/src/core/lib/iomgr/tcp_server_posix.c b/src/core/lib/iomgr/tcp_server_posix.c
index 03318151ccf73..7045a26052027 100644
--- a/src/core/lib/iomgr/tcp_server_posix.c
+++ b/src/core/lib/iomgr/tcp_server_posix.c
@@ -317,12 +317,7 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *arg, bool success) {
goto error;
}
- /* TODO(sreek): Delete the following log line */
- gpr_log(GPR_INFO, "\t\t** tcp_server_posix.on_read(): Getting read notifier");
read_notifier_pollset = grpc_fd_get_read_notifier_pollset(exec_ctx, sp->emfd);
- /* TODO(sreek): Delete the following log line */
- gpr_log(GPR_INFO, "\t\t** tcp_server_posix.on_read(): Got read notifier: %p",
- read_notifier_pollset);
/* loop until accept4 returns EAGAIN, and then re-arm notification */
for (;;) {
@@ -358,18 +353,10 @@ static void on_read(grpc_exec_ctx *exec_ctx, void *arg, bool success) {
fdobj = grpc_fd_create(fd, name);
if (read_notifier_pollset == NULL) {
- /* TODO(sreek): Check when this would happen - Ideally this should not
- * happen. Remove the next log-line once this is resolved */
- gpr_log(GPR_INFO, "\t** *******!!! tcp_server_posix.on_read(): "
- "read_notifier_pollset is NULL. !!!**********************");
-
gpr_log(GPR_ERROR, "Read notifier pollset is not set on the fd");
goto error;
}
- /* TODO(sreek): Delete the following log line */
- gpr_log(GPR_INFO, "\t\t** tcp_server_posix.on_read(): Adding fd %d *only* to pollset %p",
- fd, read_notifier_pollset);
grpc_pollset_add_fd(exec_ctx, read_notifier_pollset, fdobj);
sp->server->on_accept_cb(
diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c
index 25b6886f24151..cbfd245874198 100644
--- a/src/core/lib/surface/server.c
+++ b/src/core/lib/surface/server.c
@@ -1032,16 +1032,6 @@ void grpc_server_setup_transport(grpc_exec_ctx *exec_ctx, grpc_server *s,
uint32_t max_probes = 0;
grpc_transport_op op;
- /* TODO(sreek): Delete this commented block once issue #5470 is resolved */
- /*
- size_t i;
- for (i = 0; i < s->cq_count; i++) {
- memset(&op, 0, sizeof(op));
- op.bind_pollset = grpc_cq_pollset(s->cqs[i]);
- grpc_transport_perform_op(exec_ctx, transport, &op);
- }
- */
-
channel =
grpc_channel_create(exec_ctx, NULL, args, GRPC_SERVER_CHANNEL, transport);
chand = (channel_data *)grpc_channel_stack_element(
From 5e28d71f3de6e4edc72b703e07b43709d8cc783f Mon Sep 17 00:00:00 2001
From: Sree Kuchibhotla
Date: Tue, 12 Apr 2016 10:45:07 -0700
Subject: [PATCH 009/218] fix formatting
---
src/core/lib/iomgr/ev_posix.c | 3 ++-
src/core/lib/iomgr/ev_posix.h | 4 ++--
2 files changed, 4 insertions(+), 3 deletions(-)
diff --git a/src/core/lib/iomgr/ev_posix.c b/src/core/lib/iomgr/ev_posix.c
index af4126c900ce8..8c6ec90684f13 100644
--- a/src/core/lib/iomgr/ev_posix.c
+++ b/src/core/lib/iomgr/ev_posix.c
@@ -83,7 +83,8 @@ void grpc_fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
g_event_engine->fd_notify_on_write(exec_ctx, fd, closure);
}
-grpc_pollset *grpc_fd_get_read_notifier_pollset(grpc_exec_ctx *exec_ctx, grpc_fd *fd) {
+grpc_pollset *grpc_fd_get_read_notifier_pollset(grpc_exec_ctx *exec_ctx,
+ grpc_fd *fd) {
return g_event_engine->fd_get_read_notifier_pollset(exec_ctx, fd);
}
diff --git a/src/core/lib/iomgr/ev_posix.h b/src/core/lib/iomgr/ev_posix.h
index 4cfa83e6a23d5..344bf63438aaa 100644
--- a/src/core/lib/iomgr/ev_posix.h
+++ b/src/core/lib/iomgr/ev_posix.h
@@ -56,7 +56,7 @@ typedef struct grpc_event_engine_vtable {
void (*fd_notify_on_write)(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
grpc_closure *closure);
grpc_pollset *(*fd_get_read_notifier_pollset)(grpc_exec_ctx *exec_ctx,
- grpc_fd *fd);
+ grpc_fd *fd);
void (*pollset_init)(grpc_pollset *pollset, gpr_mu **mu);
void (*pollset_shutdown)(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
@@ -141,7 +141,7 @@ void grpc_fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd,
/* Return the read notifier pollset from the fd */
grpc_pollset *grpc_fd_get_read_notifier_pollset(grpc_exec_ctx *exec_ctx,
- grpc_fd *fd);
+ grpc_fd *fd);
/* pollset_posix functions */
From 9e926e8408803fcfdb5380caa28bdef73a6ddb5f Mon Sep 17 00:00:00 2001
From: Sree Kuchibhotla
Date: Thu, 14 Apr 2016 10:54:14 -0700
Subject: [PATCH 010/218] Test failures fix
---
test/core/end2end/fixtures/h2_sockpair+trace.c | 3 +++
test/core/end2end/fixtures/h2_sockpair.c | 3 +++
test/core/end2end/fixtures/h2_sockpair_1byte.c | 3 +++
3 files changed, 9 insertions(+)
diff --git a/test/core/end2end/fixtures/h2_sockpair+trace.c b/test/core/end2end/fixtures/h2_sockpair+trace.c
index 87533a9b7f37e..b730df753ca8f 100644
--- a/test/core/end2end/fixtures/h2_sockpair+trace.c
+++ b/test/core/end2end/fixtures/h2_sockpair+trace.c
@@ -50,6 +50,7 @@
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/support/env.h"
#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/surface/server.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
@@ -60,6 +61,8 @@
static void server_setup_transport(void *ts, grpc_transport *transport) {
grpc_end2end_test_fixture *f = ts;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_endpoint_pair *sfd = f->fixture_data;
+ grpc_endpoint_add_to_pollset(&exec_ctx, sfd->server, grpc_cq_pollset(f->cq));
grpc_server_setup_transport(&exec_ctx, f->server, transport,
grpc_server_get_channel_args(f->server));
grpc_exec_ctx_finish(&exec_ctx);
diff --git a/test/core/end2end/fixtures/h2_sockpair.c b/test/core/end2end/fixtures/h2_sockpair.c
index f28147cf40a99..41fcc1d631320 100644
--- a/test/core/end2end/fixtures/h2_sockpair.c
+++ b/test/core/end2end/fixtures/h2_sockpair.c
@@ -49,6 +49,7 @@
#include "src/core/lib/iomgr/endpoint_pair.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/surface/server.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
@@ -59,6 +60,8 @@
static void server_setup_transport(void *ts, grpc_transport *transport) {
grpc_end2end_test_fixture *f = ts;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_endpoint_pair *sfd = f->fixture_data;
+ grpc_endpoint_add_to_pollset(&exec_ctx, sfd->server, grpc_cq_pollset(f->cq));
grpc_server_setup_transport(&exec_ctx, f->server, transport,
grpc_server_get_channel_args(f->server));
grpc_exec_ctx_finish(&exec_ctx);
diff --git a/test/core/end2end/fixtures/h2_sockpair_1byte.c b/test/core/end2end/fixtures/h2_sockpair_1byte.c
index 302b16b372dd2..4c805c43706f7 100644
--- a/test/core/end2end/fixtures/h2_sockpair_1byte.c
+++ b/test/core/end2end/fixtures/h2_sockpair_1byte.c
@@ -49,6 +49,7 @@
#include "src/core/lib/iomgr/endpoint_pair.h"
#include "src/core/lib/iomgr/iomgr.h"
#include "src/core/lib/surface/channel.h"
+#include "src/core/lib/surface/completion_queue.h"
#include "src/core/lib/surface/server.h"
#include "test/core/util/port.h"
#include "test/core/util/test_config.h"
@@ -59,6 +60,8 @@
static void server_setup_transport(void *ts, grpc_transport *transport) {
grpc_end2end_test_fixture *f = ts;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
+ grpc_endpoint_pair* sfd = f->fixture_data;
+ grpc_endpoint_add_to_pollset(&exec_ctx, sfd->server, grpc_cq_pollset(f->cq));
grpc_server_setup_transport(&exec_ctx, f->server, transport,
grpc_server_get_channel_args(f->server));
grpc_exec_ctx_finish(&exec_ctx);
From 9ef0e1cfd4116b901f55410cad1c4425e59eaac1 Mon Sep 17 00:00:00 2001
From: David Garcia Quintas
Date: Thu, 14 Apr 2016 12:44:30 -0700
Subject: [PATCH 011/218] Added grpc_call_stats to the call stack
---
src/core/ext/census/grpc_filter.c | 6 ++++--
src/core/ext/client_config/client_channel.c | 4 ++--
src/core/lib/channel/channel_stack.c | 3 ++-
src/core/lib/channel/channel_stack.h | 13 ++++++++++++-
src/core/lib/channel/compress_filter.c | 4 ++--
src/core/lib/channel/connected_channel.c | 4 ++--
src/core/lib/channel/http_client_filter.c | 4 ++--
src/core/lib/channel/http_server_filter.c | 4 ++--
src/core/lib/security/client_auth_filter.c | 4 ++--
src/core/lib/security/server_auth_filter.c | 4 ++--
src/core/lib/surface/lame_client.c | 4 ++--
src/core/lib/surface/server.c | 4 ++--
test/core/channel/channel_stack_test.c | 4 ++--
test/core/end2end/tests/filter_causes_close.c | 4 ++--
14 files changed, 40 insertions(+), 26 deletions(-)
diff --git a/src/core/ext/census/grpc_filter.c b/src/core/ext/census/grpc_filter.c
index abfb3bb5f0e16..f1dc0eab61b01 100644
--- a/src/core/ext/census/grpc_filter.c
+++ b/src/core/ext/census/grpc_filter.c
@@ -134,7 +134,8 @@ static void client_init_call_elem(grpc_exec_ctx *exec_ctx,
}
static void client_destroy_call_elem(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem) {
+ grpc_call_element *elem,
+ const grpc_call_stats *stats) {
call_data *d = elem->call_data;
GPR_ASSERT(d != NULL);
/* TODO(hongyu): record rpc client stats and census_rpc_end_op here */
@@ -152,7 +153,8 @@ static void server_init_call_elem(grpc_exec_ctx *exec_ctx,
}
static void server_destroy_call_elem(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem) {
+ grpc_call_element *elem,
+ const grpc_call_stats *stats) {
call_data *d = elem->call_data;
GPR_ASSERT(d != NULL);
/* TODO(hongyu): record rpc server stats and census_tracing_end_op here */
diff --git a/src/core/ext/client_config/client_channel.c b/src/core/ext/client_config/client_channel.c
index 93d54fdcfebd2..3ec0ab43876f3 100644
--- a/src/core/ext/client_config/client_channel.c
+++ b/src/core/ext/client_config/client_channel.c
@@ -401,8 +401,8 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
}
/* Destructor for call_data */
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem) {
+static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
+ const grpc_call_stats *stats) {
grpc_subchannel_call_holder_destroy(exec_ctx, elem->call_data);
}
diff --git a/src/core/lib/channel/channel_stack.c b/src/core/lib/channel/channel_stack.c
index e36066d8639d6..cc8d413d1d33b 100644
--- a/src/core/lib/channel/channel_stack.c
+++ b/src/core/lib/channel/channel_stack.c
@@ -169,6 +169,7 @@ void grpc_call_stack_init(grpc_exec_ctx *exec_ctx,
size_t i;
call_stack->count = count;
+ memset(&call_stack->stats, 0, sizeof(grpc_call_stats));
GRPC_STREAM_REF_INIT(&call_stack->refcount, initial_refs, destroy,
destroy_arg, "CALL_STACK");
call_elems = CALL_ELEMS_FROM_STACK(call_stack);
@@ -220,7 +221,7 @@ void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *stack) {
/* destroy per-filter data */
for (i = 0; i < count; i++) {
- elems[i].filter->destroy_call_elem(exec_ctx, &elems[i]);
+ elems[i].filter->destroy_call_elem(exec_ctx, &elems[i], &stack->stats);
}
}
diff --git a/src/core/lib/channel/channel_stack.h b/src/core/lib/channel/channel_stack.h
index 9e3a25a152d64..3d9e72ef16ccc 100644
--- a/src/core/lib/channel/channel_stack.h
+++ b/src/core/lib/channel/channel_stack.h
@@ -45,6 +45,8 @@
#include
#include
+#include
+
#include "src/core/lib/debug/trace.h"
#include "src/core/lib/transport/transport.h"
@@ -67,6 +69,13 @@ typedef struct {
grpc_call_context_element *context;
} grpc_call_element_args;
+typedef struct {
+ uint64_t bytes_in;
+ uint64_t bytes_out;
+ gpr_timespec latency; /* TODO(dgq): per op? */
+ grpc_status_code final_status;
+} grpc_call_stats;
+
/* Channel filters specify:
1. the amount of memory needed in the channel & call (via the sizeof_XXX
members)
@@ -105,7 +114,8 @@ typedef struct {
grpc_pollset *pollset);
/* Destroy per call data.
The filter does not need to do any chaining */
- void (*destroy_call_elem)(grpc_exec_ctx *exec_ctx, grpc_call_element *elem);
+ void (*destroy_call_elem)(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
+ const grpc_call_stats *stats);
/* sizeof(per channel data) */
size_t sizeof_channel_data;
@@ -164,6 +174,7 @@ struct grpc_call_stack {
about the address of the call stack itself. */
grpc_stream_refcount refcount;
size_t count;
+ grpc_call_stats stats;
};
/* Get a channel element given a channel stack and its index */
diff --git a/src/core/lib/channel/compress_filter.c b/src/core/lib/channel/compress_filter.c
index 229fdb5ef6023..31f1ac43fe969 100644
--- a/src/core/lib/channel/compress_filter.c
+++ b/src/core/lib/channel/compress_filter.c
@@ -246,8 +246,8 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
}
/* Destructor for call_data */
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem) {
+static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
+ const grpc_call_stats *stats) {
/* grab pointers to our data from the call element */
call_data *calld = elem->call_data;
gpr_slice_buffer_destroy(&calld->slices);
diff --git a/src/core/lib/channel/connected_channel.c b/src/core/lib/channel/connected_channel.c
index c1debab4c620f..eb699a63e46d1 100644
--- a/src/core/lib/channel/connected_channel.c
+++ b/src/core/lib/channel/connected_channel.c
@@ -102,8 +102,8 @@ static void set_pollset(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
}
/* Destructor for call_data */
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem) {
+static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
+ const grpc_call_stats *stats) {
call_data *calld = elem->call_data;
channel_data *chand = elem->channel_data;
grpc_transport_destroy_stream(exec_ctx, chand->transport,
diff --git a/src/core/lib/channel/http_client_filter.c b/src/core/lib/channel/http_client_filter.c
index 211f537c6919b..e1afaf51864cd 100644
--- a/src/core/lib/channel/http_client_filter.c
+++ b/src/core/lib/channel/http_client_filter.c
@@ -155,8 +155,8 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
}
/* Destructor for call_data */
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem) {}
+static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
+ const grpc_call_stats *stats) {}
static grpc_mdelem *scheme_from_args(const grpc_channel_args *args) {
unsigned i;
diff --git a/src/core/lib/channel/http_server_filter.c b/src/core/lib/channel/http_server_filter.c
index c140c61b8f330..d4bac1493d82e 100644
--- a/src/core/lib/channel/http_server_filter.c
+++ b/src/core/lib/channel/http_server_filter.c
@@ -220,8 +220,8 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
}
/* Destructor for call_data */
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem) {}
+static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
+ const grpc_call_stats *stats) {}
/* Constructor for channel_data */
static void init_channel_elem(grpc_exec_ctx *exec_ctx,
diff --git a/src/core/lib/security/client_auth_filter.c b/src/core/lib/security/client_auth_filter.c
index 943b1da85c60d..aa025d477eb1c 100644
--- a/src/core/lib/security/client_auth_filter.c
+++ b/src/core/lib/security/client_auth_filter.c
@@ -277,8 +277,8 @@ static void set_pollset(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
}
/* Destructor for call_data */
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem) {
+static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
+ const grpc_call_stats *stats) {
call_data *calld = elem->call_data;
grpc_call_credentials_unref(calld->creds);
if (calld->host != NULL) {
diff --git a/src/core/lib/security/server_auth_filter.c b/src/core/lib/security/server_auth_filter.c
index 7844dc87cb588..0ca39cc3e343e 100644
--- a/src/core/lib/security/server_auth_filter.c
+++ b/src/core/lib/security/server_auth_filter.c
@@ -224,8 +224,8 @@ static void set_pollset(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_pollset *pollset) {}
/* Destructor for call_data */
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem) {}
+static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
+ const grpc_call_stats *stats) {}
/* Constructor for channel_data */
static void init_channel_elem(grpc_exec_ctx *exec_ctx,
diff --git a/src/core/lib/surface/lame_client.c b/src/core/lib/surface/lame_client.c
index c1f6812c4e100..596e142860d96 100644
--- a/src/core/lib/surface/lame_client.c
+++ b/src/core/lib/surface/lame_client.c
@@ -104,8 +104,8 @@ static void lame_start_transport_op(grpc_exec_ctx *exec_ctx,
static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_call_element_args *args) {}
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem) {}
+static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
+ const grpc_call_stats *stats) {}
static void init_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem,
diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c
index ad8ee8c7a99ef..e7cdaf1f62d26 100644
--- a/src/core/lib/surface/server.c
+++ b/src/core/lib/surface/server.c
@@ -820,8 +820,8 @@ static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
server_ref(chand->server);
}
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem) {
+static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
+ const grpc_call_stats *stats) {
channel_data *chand = elem->channel_data;
call_data *calld = elem->call_data;
diff --git a/test/core/channel/channel_stack_test.c b/test/core/channel/channel_stack_test.c
index 81e3927a00646..cce35ec58f743 100644
--- a/test/core/channel/channel_stack_test.c
+++ b/test/core/channel/channel_stack_test.c
@@ -62,8 +62,8 @@ static void call_init_func(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
static void channel_destroy_func(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem) {}
-static void call_destroy_func(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem) {
+static void call_destroy_func(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
+ const grpc_call_stats *stats) {
++*(int *)(elem->channel_data);
}
diff --git a/test/core/end2end/tests/filter_causes_close.c b/test/core/end2end/tests/filter_causes_close.c
index e74d3239de9d6..3f503f9a0a838 100644
--- a/test/core/end2end/tests/filter_causes_close.c
+++ b/test/core/end2end/tests/filter_causes_close.c
@@ -235,8 +235,8 @@ static void start_transport_stream_op(grpc_exec_ctx *exec_ctx,
static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
grpc_call_element_args *args) {}
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem) {}
+static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
+ const grpc_call_stats *stats) {}
static void init_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem,
From c9bb983c9c50be37bae9bf6a79bd9e70fbbe8b23 Mon Sep 17 00:00:00 2001
From: David Garcia Quintas
Date: Thu, 14 Apr 2016 12:52:31 -0700
Subject: [PATCH 012/218] pr comments
---
src/core/lib/channel/channel_stack.h | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/src/core/lib/channel/channel_stack.h b/src/core/lib/channel/channel_stack.h
index 3d9e72ef16ccc..f5f57fac0eac3 100644
--- a/src/core/lib/channel/channel_stack.h
+++ b/src/core/lib/channel/channel_stack.h
@@ -70,9 +70,8 @@ typedef struct {
} grpc_call_element_args;
typedef struct {
- uint64_t bytes_in;
- uint64_t bytes_out;
- gpr_timespec latency; /* TODO(dgq): per op? */
+ grpc_transport_stream_stats transport_stream_stats;
+ gpr_timespec latency; /* From call creating to enqueing of received status */
grpc_status_code final_status;
} grpc_call_stats;
From da0beaf408c037d2c17379aee6f04cd8c69664d6 Mon Sep 17 00:00:00 2001
From: David Garcia Quintas
Date: Thu, 14 Apr 2016 14:37:06 -0700
Subject: [PATCH 013/218] Done right this time...
---
src/core/ext/client_config/subchannel.c | 2 +-
src/core/lib/channel/channel_stack.c | 6 +++---
src/core/lib/channel/channel_stack.h | 4 ++--
src/core/lib/surface/call.c | 8 ++++----
test/core/channel/channel_stack_test.c | 2 +-
5 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/src/core/ext/client_config/subchannel.c b/src/core/ext/client_config/subchannel.c
index 125a291f211f4..0aa94ca8fb59c 100644
--- a/src/core/ext/client_config/subchannel.c
+++ b/src/core/ext/client_config/subchannel.c
@@ -651,7 +651,7 @@ static void subchannel_call_destroy(grpc_exec_ctx *exec_ctx, void *call,
bool success) {
grpc_subchannel_call *c = call;
GPR_TIMER_BEGIN("grpc_subchannel_call_unref.destroy", 0);
- grpc_call_stack_destroy(exec_ctx, SUBCHANNEL_CALL_TO_CALL_STACK(c));
+ grpc_call_stack_destroy(exec_ctx, SUBCHANNEL_CALL_TO_CALL_STACK(c), NULL);
GRPC_CONNECTED_SUBCHANNEL_UNREF(exec_ctx, c->connection, "subchannel_call");
gpr_free(c);
GPR_TIMER_END("grpc_subchannel_call_unref.destroy", 0);
diff --git a/src/core/lib/channel/channel_stack.c b/src/core/lib/channel/channel_stack.c
index cc8d413d1d33b..5c1086a03f5f5 100644
--- a/src/core/lib/channel/channel_stack.c
+++ b/src/core/lib/channel/channel_stack.c
@@ -169,7 +169,6 @@ void grpc_call_stack_init(grpc_exec_ctx *exec_ctx,
size_t i;
call_stack->count = count;
- memset(&call_stack->stats, 0, sizeof(grpc_call_stats));
GRPC_STREAM_REF_INIT(&call_stack->refcount, initial_refs, destroy,
destroy_arg, "CALL_STACK");
call_elems = CALL_ELEMS_FROM_STACK(call_stack);
@@ -214,14 +213,15 @@ void grpc_call_stack_ignore_set_pollset(grpc_exec_ctx *exec_ctx,
grpc_call_element *elem,
grpc_pollset *pollset) {}
-void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *stack) {
+void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *stack,
+ const grpc_call_stats *call_stats) {
grpc_call_element *elems = CALL_ELEMS_FROM_STACK(stack);
size_t count = stack->count;
size_t i;
/* destroy per-filter data */
for (i = 0; i < count; i++) {
- elems[i].filter->destroy_call_elem(exec_ctx, &elems[i], &stack->stats);
+ elems[i].filter->destroy_call_elem(exec_ctx, &elems[i], call_stats);
}
}
diff --git a/src/core/lib/channel/channel_stack.h b/src/core/lib/channel/channel_stack.h
index f5f57fac0eac3..3c7c65ab3f499 100644
--- a/src/core/lib/channel/channel_stack.h
+++ b/src/core/lib/channel/channel_stack.h
@@ -173,7 +173,6 @@ struct grpc_call_stack {
about the address of the call stack itself. */
grpc_stream_refcount refcount;
size_t count;
- grpc_call_stats stats;
};
/* Get a channel element given a channel stack and its index */
@@ -233,7 +232,8 @@ void grpc_call_stack_set_pollset(grpc_exec_ctx *exec_ctx,
#endif
/* Destroy a call stack */
-void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *stack);
+void grpc_call_stack_destroy(grpc_exec_ctx *exec_ctx, grpc_call_stack *stack,
+ const grpc_call_stats *call_stats);
/* Ignore set pollset - used by filters to implement the set_pollset method
if they don't care about pollsets at all. Does nothing. */
diff --git a/src/core/lib/surface/call.c b/src/core/lib/surface/call.c
index 6581bbd3d1d2d..a60f93f25e731 100644
--- a/src/core/lib/surface/call.c
+++ b/src/core/lib/surface/call.c
@@ -175,7 +175,7 @@ struct grpc_call {
received_status status[STATUS_SOURCE_COUNT];
/* Call stats: only valid after trailing metadata received */
- grpc_transport_stream_stats stats;
+ grpc_call_stats stats;
/* Compression algorithm for the call */
grpc_compression_algorithm compression_algorithm;
@@ -375,7 +375,7 @@ static void destroy_call(grpc_exec_ctx *exec_ctx, void *call, bool success) {
if (c->receiving_stream != NULL) {
grpc_byte_stream_destroy(exec_ctx, c->receiving_stream);
}
- grpc_call_stack_destroy(exec_ctx, CALL_STACK_FROM_CALL(c));
+ grpc_call_stack_destroy(exec_ctx, CALL_STACK_FROM_CALL(c), &c->stats);
GRPC_CHANNEL_INTERNAL_UNREF(exec_ctx, c->channel, "call");
gpr_mu_destroy(&c->mu);
for (i = 0; i < STATUS_SOURCE_COUNT; i++) {
@@ -1392,7 +1392,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
bctl->recv_final_op = 1;
stream_op.recv_trailing_metadata =
&call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */];
- stream_op.collect_stats = &call->stats;
+ stream_op.collect_stats = &call->stats.transport_stream_stats;
break;
case GRPC_OP_RECV_CLOSE_ON_SERVER:
/* Flag validation: currently allow no flags */
@@ -1414,7 +1414,7 @@ static grpc_call_error call_start_batch(grpc_exec_ctx *exec_ctx,
bctl->recv_final_op = 1;
stream_op.recv_trailing_metadata =
&call->metadata_batch[1 /* is_receiving */][1 /* is_trailing */];
- stream_op.collect_stats = &call->stats;
+ stream_op.collect_stats = &call->stats.transport_stream_stats;
break;
}
}
diff --git a/test/core/channel/channel_stack_test.c b/test/core/channel/channel_stack_test.c
index cce35ec58f743..54f9fce14bac4 100644
--- a/test/core/channel/channel_stack_test.c
+++ b/test/core/channel/channel_stack_test.c
@@ -87,7 +87,7 @@ static void free_channel(grpc_exec_ctx *exec_ctx, void *arg, bool success) {
}
static void free_call(grpc_exec_ctx *exec_ctx, void *arg, bool success) {
- grpc_call_stack_destroy(exec_ctx, arg);
+ grpc_call_stack_destroy(exec_ctx, arg, NULL);
gpr_free(arg);
}
From a52348625a4e802e5275b609d257375dac9f5274 Mon Sep 17 00:00:00 2001
From: David Garcia Quintas
Date: Thu, 14 Apr 2016 15:08:43 -0700
Subject: [PATCH 014/218] After addition of grpc_call_stats
---
.../load_reporting/load_reporting_filter.c | 37 ++++--------------
src/core/lib/load_reporting/load_reporting.c | 38 +++++++++++++++----
src/core/lib/load_reporting/load_reporting.h | 29 +++++++++++---
.../load_reporting_registration.c | 28 +++++++++-----
4 files changed, 81 insertions(+), 51 deletions(-)
diff --git a/src/core/ext/load_reporting/load_reporting_filter.c b/src/core/ext/load_reporting/load_reporting_filter.c
index 7b029ae3eed20..fc62a4dd0a8f3 100644
--- a/src/core/ext/load_reporting/load_reporting_filter.c
+++ b/src/core/ext/load_reporting/load_reporting_filter.c
@@ -31,53 +31,32 @@
*
*/
-#include
-
#include
#include "src/core/ext/load_reporting/load_reporting_filter.h"
#include "src/core/lib/channel/channel_args.h"
#include "src/core/lib/load_reporting/load_reporting.h"
#include "src/core/lib/profiling/timers.h"
-#include "src/core/lib/support/string.h"
-
-typedef struct call_data { load_reporting_data lr_data; } call_data;
+typedef struct call_data { void *dummy; } call_data;
typedef struct channel_data { void *dummy; } channel_data;
-static void load_reporting_start_transport_stream_op(
- grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
- grpc_transport_stream_op *op) {
- call_data *calld = elem->call_data;
-
- GPR_TIMER_BEGIN("load_reporting_start_transport_stream_op", 0);
- grpc_load_reporting_call(&calld->lr_data);
- grpc_call_next_op(exec_ctx, elem, op);
- GPR_TIMER_END("load_reporting_start_transport_stream_op", 0);
-}
-
/* Constructor for call_data */
static void init_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
- grpc_call_element_args *args) {
- /* grab pointers to our data from the call element */
- call_data *calld = elem->call_data;
-
- /* initialize members */
- memset(&calld->lr_data, 0, sizeof(load_reporting_data));
-}
+ grpc_call_element_args *args) {}
/* Destructor for call_data */
-static void destroy_call_elem(grpc_exec_ctx *exec_ctx,
- grpc_call_element *elem) {
- /* grab pointers to our data from the call element */
- /*call_data *calld = elem->call_data;*/
+static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem,
+ const grpc_call_stats *stats) {
+ GPR_TIMER_BEGIN("load_reporting_filter", 0);
+ grpc_load_reporting_call(stats);
+ GPR_TIMER_END("load_reporting_filter", 0);
}
/* Constructor for channel_data */
static void init_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem,
grpc_channel_element_args *args) {
- /*channel_data *channeld = elem->channel_data;*/
GPR_ASSERT(!args->is_last);
}
@@ -86,7 +65,7 @@ static void destroy_channel_elem(grpc_exec_ctx *exec_ctx,
grpc_channel_element *elem) {}
const grpc_channel_filter grpc_load_reporting_filter = {
- load_reporting_start_transport_stream_op,
+ grpc_call_next_op,
grpc_channel_next_op,
sizeof(call_data),
init_call_elem,
diff --git a/src/core/lib/load_reporting/load_reporting.c b/src/core/lib/load_reporting/load_reporting.c
index 2ac8b97efcf27..dbb1ba5c6316f 100644
--- a/src/core/lib/load_reporting/load_reporting.c
+++ b/src/core/lib/load_reporting/load_reporting.c
@@ -31,18 +31,42 @@
*
*/
+#include
+#include
+
#include "src/core/lib/load_reporting/load_reporting.h"
-#include
+typedef struct load_reporting {
+ gpr_mu mu;
+ load_reporting_fn fn;
+ void *data;
+} load_reporting;
+
+static load_reporting g_load_reporting;
-static load_reporting_fn g_load_reporting_fn;
+void grpc_load_reporting_init(load_reporting_fn fn, void *data) {
+ gpr_mu_init(&g_load_reporting.mu);
+ g_load_reporting.fn = fn;
+ g_load_reporting.data = data;
+}
-void grpc_load_reporting_init(load_reporting_fn fn) {
- g_load_reporting_fn = fn;
+void grpc_load_reporting_destroy() {
+ gpr_free(g_load_reporting.data);
+ g_load_reporting.data = NULL;
+ gpr_mu_destroy(&g_load_reporting.mu);
}
-void grpc_load_reporting_call(load_reporting_data *lr_data) {
- if (g_load_reporting_fn != NULL) {
- g_load_reporting_fn(lr_data);
+void grpc_load_reporting_call(const grpc_call_stats *stats) {
+ if (g_load_reporting.fn != NULL) {
+ gpr_mu_lock(&g_load_reporting.mu);
+ g_load_reporting.fn(g_load_reporting.data, stats);
+ gpr_mu_unlock(&g_load_reporting.mu);
}
}
+
+void *grpc_load_reporting_data() {
+ gpr_mu_lock(&g_load_reporting.mu);
+ void *data = g_load_reporting.data;
+ gpr_mu_unlock(&g_load_reporting.mu);
+ return data;
+}
diff --git a/src/core/lib/load_reporting/load_reporting.h b/src/core/lib/load_reporting/load_reporting.h
index 65465ef940a49..afc9090d0cf16 100644
--- a/src/core/lib/load_reporting/load_reporting.h
+++ b/src/core/lib/load_reporting/load_reporting.h
@@ -34,13 +34,32 @@
#ifndef GRPC_CORE_LIB_LOAD_REPORTING_LOAD_REPORTING_H
#define GRPC_CORE_LIB_LOAD_REPORTING_LOAD_REPORTING_H
-typedef struct load_reporting_data { void *data; } load_reporting_data;
+#include "src/core/lib/iomgr/closure.h"
+#include "src/core/lib/surface/call.h"
-typedef void (*load_reporting_fn)(load_reporting_data *lr_data);
+/** Custom function to be called by the load reporting filter.
+ *
+ * The \a data pointer is the same as the one passed to \a
+ * grpc_load_reporting_init. \a stats are the final per-call statistics gathered
+ * by the gRPC runtime. */
+typedef void (*load_reporting_fn)(void *data, const grpc_call_stats *stats);
+
+/** Register \a fn as the function to be invoked by the load reporting filter,
+ * passing \a data as its namesake argument. To be called only from a plugin
+ * init function. */
+void grpc_load_reporting_init(load_reporting_fn fn, void *data);
+
+/** Takes care of freeing the memory allocated for \a data (see \a
+ * grpc_load_reporting_init), if any. To be called only from a plugin destroy
+ * function. */
+void grpc_load_reporting_destroy();
-/** To be called only from a plugin init function */
-void grpc_load_reporting_init(load_reporting_fn fn);
+/** Invoke the function registered by \a grpc_load_reporting_init, passing it \a
+ * stats as one of the arguments (see \a load_reporting_fn). */
+void grpc_load_reporting_call(const grpc_call_stats *stats);
-void grpc_load_reporting_call(load_reporting_data *lr_data);
+/** Returns the custom load reporting data, as registered in \a
+ * grpc_load_reporting_init. */
+void *grpc_load_reporting_data();
#endif /* GRPC_CORE_LIB_LOAD_REPORTING_LOAD_REPORTING_H */
diff --git a/test/core/load_reporting/load_reporting_registration.c b/test/core/load_reporting/load_reporting_registration.c
index 4361682781722..e3d52b250c5fb 100644
--- a/test/core/load_reporting/load_reporting_registration.c
+++ b/test/core/load_reporting/load_reporting_registration.c
@@ -40,27 +40,35 @@
#include "src/core/lib/surface/api_trace.h"
#include "test/core/util/test_config.h"
-static void noop(load_reporting_data *lr_data) {
- uint32_t *d = (uint32_t *)(lr_data->data);
- *d = 0xdeadbeef;
+typedef struct { uint64_t total_bytes; } aggregated_bw_stats;
+
+static void sample_fn(void *lr_data, const grpc_call_stats *stats) {
+ aggregated_bw_stats *custom_stats = (aggregated_bw_stats *)lr_data;
+ custom_stats->total_bytes =
+ stats->transport_stream_stats.outgoing.data_bytes +
+ stats->transport_stream_stats.incoming.data_bytes;
}
-static void lr_plugin_init(void) { grpc_load_reporting_init(noop); }
+static void lr_plugin_init(void) {
+ aggregated_bw_stats *data = gpr_malloc(sizeof(aggregated_bw_stats));
+ grpc_load_reporting_init(sample_fn, data);
+}
-static void lr_plugin_destroy(void) {}
+static void lr_plugin_destroy(void) { grpc_load_reporting_destroy(); }
static void load_reporting_register() {
grpc_register_plugin(lr_plugin_init, lr_plugin_destroy);
}
static void test_load_reporter_registration(void) {
- load_reporting_data lr_data;
- lr_data.data = gpr_malloc(sizeof(uint32_t));
- grpc_load_reporting_call(&lr_data);
+ grpc_call_stats stats;
+ stats.transport_stream_stats.outgoing.data_bytes = 123;
+ stats.transport_stream_stats.incoming.data_bytes = 456;
- GPR_ASSERT(*((uint32_t *)lr_data.data) == 0xdeadbeef);
+ grpc_load_reporting_call(&stats);
- gpr_free(lr_data.data);
+ GPR_ASSERT(((aggregated_bw_stats *)grpc_load_reporting_data())->total_bytes ==
+ 123 + 456);
}
int main(int argc, char **argv) {
From 1f5e262589c84c2b5eb9416211bffd1f32998009 Mon Sep 17 00:00:00 2001
From: Sree Kuchibhotla
Date: Thu, 21 Apr 2016 12:28:09 -0700
Subject: [PATCH 015/218] Add the option of adding a non-listening server
completion queue. This makes writing certain test cases (like hybrid_end2end
tests) easier
---
.../grpc++/impl/codegen/completion_queue.h | 11 ++++-
include/grpc++/server_builder.h | 10 ++++-
include/grpc/grpc.h | 9 ++++
src/core/lib/surface/completion_queue.c | 11 +++++
src/core/lib/surface/completion_queue.h | 2 +
src/core/lib/surface/server.c | 44 ++++++++++++++-----
src/cpp/server/server_builder.cc | 18 ++++++--
test/cpp/end2end/hybrid_end2end_test.cc | 2 +-
8 files changed, 89 insertions(+), 18 deletions(-)
diff --git a/include/grpc++/impl/codegen/completion_queue.h b/include/grpc++/impl/codegen/completion_queue.h
index 56864d6d53633..d489a90c69c9f 100644
--- a/include/grpc++/impl/codegen/completion_queue.h
+++ b/include/grpc++/impl/codegen/completion_queue.h
@@ -222,9 +222,18 @@ class CompletionQueue : private GrpcLibraryCodegen {
/// A specific type of completion queue used by the processing of notifications
/// by servers. Instantiated by \a ServerBuilder.
class ServerCompletionQueue : public CompletionQueue {
+ public:
+ bool IsFrequentlyPolled() { return is_frequently_polled_; }
+
private:
+ bool is_frequently_polled_;
friend class ServerBuilder;
- ServerCompletionQueue() {}
+ /// \param is_frequently_polled Informs the GPRC library about whether the
+ /// server completion queue would be actively polled (by calling Next() or
+ /// AsyncNext()). By default all server completion queues are assumed to be
+ /// frequently polled.
+ ServerCompletionQueue(bool is_frequently_polled = true)
+ : is_frequently_polled_(is_frequently_polled) {}
};
} // namespace grpc
diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h
index 86c7fecef59f5..85af9aa57fba9 100644
--- a/include/grpc++/server_builder.h
+++ b/include/grpc++/server_builder.h
@@ -102,7 +102,15 @@ class ServerBuilder {
/// Add a completion queue for handling asynchronous services
/// Caller is required to keep this completion queue live until
/// the server is destroyed.
- std::unique_ptr AddCompletionQueue();
+ ///
+ /// \param is_frequently_polled This is an optional parameter to inform GRPC
+ /// library about whether this completion queue would be frequently polled
+ /// (i.e by calling Next() or AsyncNext()). The default value is 'true' and is
+ /// the recommended setting. Setting this to 'false' (i.e not polling the
+ /// completion queue frequently) will have a significantly negative
+ /// performance impact and hence should not be used in production use cases.
+ std::unique_ptr AddCompletionQueue(
+ bool is_frequently_polled = true);
/// Return a running server which is ready for processing calls.
std::unique_ptr BuildAndStart();
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h
index 5c868aece372b..059bd2ebc74e4 100644
--- a/include/grpc/grpc.h
+++ b/include/grpc/grpc.h
@@ -334,6 +334,15 @@ GRPCAPI void grpc_server_register_completion_queue(grpc_server *server,
grpc_completion_queue *cq,
void *reserved);
+/** Register a non-listening completion queue with the server. This API is
+ similar to grpc_server_register_completion_queue except that the server will
+ not use this completion_queue to listen to any incoming channels.
+
+ Registering a non-listening completion queue will have negative performance
+ impact and hence this API is not recommended for production use cases. */
+GRPCAPI void grpc_server_register_non_listening_completion_queue(
+ grpc_server *server, grpc_completion_queue *q, void *reserved);
+
/** Add a HTTP2 over plaintext over tcp listener.
Returns bound port number on success, 0 on failure.
REQUIRES: server not started */
diff --git a/src/core/lib/surface/completion_queue.c b/src/core/lib/surface/completion_queue.c
index 5ec8808b50852..f6f7ac880ccf0 100644
--- a/src/core/lib/surface/completion_queue.c
+++ b/src/core/lib/surface/completion_queue.c
@@ -70,6 +70,8 @@ struct grpc_completion_queue {
int shutdown;
int shutdown_called;
int is_server_cq;
+ /** Can the server cq accept incoming channels */
+ int is_non_listening_server_cq;
int num_pluckers;
plucker pluckers[GRPC_MAX_COMPLETION_QUEUE_PLUCKERS];
grpc_closure pollset_shutdown_done;
@@ -149,6 +151,7 @@ grpc_completion_queue *grpc_completion_queue_create(void *reserved) {
cc->shutdown = 0;
cc->shutdown_called = 0;
cc->is_server_cq = 0;
+ cc->is_non_listening_server_cq = 0;
cc->num_pluckers = 0;
#ifndef NDEBUG
cc->outstanding_tag_count = 0;
@@ -507,6 +510,14 @@ grpc_pollset *grpc_cq_pollset(grpc_completion_queue *cc) {
return POLLSET_FROM_CQ(cc);
}
+void grpc_cq_mark_non_listening_server_cq(grpc_completion_queue *cc) {
+ cc->is_non_listening_server_cq = 1;
+}
+
+bool grpc_cq_is_non_listening_server_cq(grpc_completion_queue *cc) {
+ return (cc->is_non_listening_server_cq == 1);
+}
+
void grpc_cq_mark_server_cq(grpc_completion_queue *cc) { cc->is_server_cq = 1; }
int grpc_cq_is_server_cq(grpc_completion_queue *cc) { return cc->is_server_cq; }
diff --git a/src/core/lib/surface/completion_queue.h b/src/core/lib/surface/completion_queue.h
index eef82cf014826..ee3e044840133 100644
--- a/src/core/lib/surface/completion_queue.h
+++ b/src/core/lib/surface/completion_queue.h
@@ -82,6 +82,8 @@ void grpc_cq_end_op(grpc_exec_ctx *exec_ctx, grpc_completion_queue *cc,
grpc_pollset *grpc_cq_pollset(grpc_completion_queue *cc);
+void grpc_cq_mark_non_listening_server_cq(grpc_completion_queue *cc);
+bool grpc_cq_is_non_listening_server_cq(grpc_completion_queue *cc);
void grpc_cq_mark_server_cq(grpc_completion_queue *cc);
int grpc_cq_is_server_cq(grpc_completion_queue *cc);
diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c
index cbfd245874198..c34ec04d2d34c 100644
--- a/src/core/lib/surface/server.c
+++ b/src/core/lib/surface/server.c
@@ -895,23 +895,45 @@ const grpc_channel_filter grpc_server_top_filter = {
"server",
};
-void grpc_server_register_completion_queue(grpc_server *server,
- grpc_completion_queue *cq,
- void *reserved) {
+static void register_completion_queue(grpc_server *server,
+ grpc_completion_queue *cq,
+ bool is_non_listening, void *reserved) {
size_t i, n;
- GRPC_API_TRACE(
- "grpc_server_register_completion_queue(server=%p, cq=%p, reserved=%p)", 3,
- (server, cq, reserved));
GPR_ASSERT(!reserved);
for (i = 0; i < server->cq_count; i++) {
if (server->cqs[i] == cq) return;
}
- GRPC_CQ_INTERNAL_REF(cq, "server");
+
grpc_cq_mark_server_cq(cq);
- n = server->cq_count++;
- server->cqs = gpr_realloc(server->cqs,
- server->cq_count * sizeof(grpc_completion_queue *));
- server->cqs[n] = cq;
+
+ /* Non-listening completion queues are not added to server->cqs */
+ if (is_non_listening) {
+ grpc_cq_mark_non_listening_server_cq(cq);
+ } else {
+ GRPC_CQ_INTERNAL_REF(cq, "server");
+ n = server->cq_count++;
+ server->cqs = gpr_realloc(
+ server->cqs, server->cq_count * sizeof(grpc_completion_queue *));
+ server->cqs[n] = cq;
+ }
+}
+
+void grpc_server_register_completion_queue(grpc_server *server,
+ grpc_completion_queue *cq,
+ void *reserved) {
+ GRPC_API_TRACE(
+ "grpc_server_register_completion_queue(server=%p, cq=%p, reserved=%p)", 3,
+ (server, cq, reserved));
+ register_completion_queue(server, cq, false, reserved);
+}
+
+void grpc_server_register_non_listening_completion_queue(
+ grpc_server *server, grpc_completion_queue *cq, void *reserved) {
+ GRPC_API_TRACE(
+ "grpc_server_register_non_listening_completion_queue(server=%p, cq=%p, "
+ "reserved=%p)",
+ 3, (server, cq, reserved));
+ register_completion_queue(server, cq, true, reserved);
}
grpc_server *grpc_server_create(const grpc_channel_args *args, void *reserved) {
diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc
index 68cc38258cf91..5445d3e13bcb0 100644
--- a/src/cpp/server/server_builder.cc
+++ b/src/cpp/server/server_builder.cc
@@ -46,8 +46,9 @@ ServerBuilder::ServerBuilder()
grpc_compression_options_init(&compression_options_);
}
-std::unique_ptr ServerBuilder::AddCompletionQueue() {
- ServerCompletionQueue* cq = new ServerCompletionQueue();
+std::unique_ptr ServerBuilder::AddCompletionQueue(
+ bool is_frequently_polled) {
+ ServerCompletionQueue* cq = new ServerCompletionQueue(is_frequently_polled);
cqs_.push_back(cq);
return std::unique_ptr(cq);
}
@@ -105,8 +106,17 @@ std::unique_ptr ServerBuilder::BuildAndStart() {
std::unique_ptr server(
new Server(thread_pool.release(), true, max_message_size_, &args));
for (auto cq = cqs_.begin(); cq != cqs_.end(); ++cq) {
- grpc_server_register_completion_queue(server->server_, (*cq)->cq(),
- nullptr);
+ // A completion queue that is not polled frequently (by calling Next() or
+ // AsyncNext()) is not safe to use for listening to incoming channels.
+ // Register all such completion queues as non-listening completion queues
+ // with the GRPC core library.
+ if ((*cq)->IsFrequentlyPolled()) {
+ grpc_server_register_completion_queue(server->server_, (*cq)->cq(),
+ nullptr);
+ } else {
+ grpc_server_register_non_listening_completion_queue(server->server_,
+ (*cq)->cq(), nullptr);
+ }
}
for (auto service = services_.begin(); service != services_.end();
service++) {
diff --git a/test/cpp/end2end/hybrid_end2end_test.cc b/test/cpp/end2end/hybrid_end2end_test.cc
index 02043a89d3a51..0423448154dff 100644
--- a/test/cpp/end2end/hybrid_end2end_test.cc
+++ b/test/cpp/end2end/hybrid_end2end_test.cc
@@ -216,7 +216,7 @@ class HybridEnd2endTest : public ::testing::Test {
}
// Create a separate cq for each potential handler.
for (int i = 0; i < 5; i++) {
- cqs_.push_back(builder.AddCompletionQueue());
+ cqs_.push_back(builder.AddCompletionQueue(false));
}
server_ = builder.BuildAndStart();
}
From 7def036085bbbe61a908668da0e92c11eb4b921a Mon Sep 17 00:00:00 2001
From: Sree Kuchibhotla
Date: Thu, 21 Apr 2016 14:54:32 -0700
Subject: [PATCH 016/218] Add a safety check to ensure atleast one of the
completion queues is listening completion queue (i.e frequently polled)
---
src/cpp/server/server_builder.cc | 17 +++++++++++++++++
1 file changed, 17 insertions(+)
diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc
index 5445d3e13bcb0..c0d13951d703c 100644
--- a/src/cpp/server/server_builder.cc
+++ b/src/cpp/server/server_builder.cc
@@ -86,8 +86,11 @@ void ServerBuilder::AddListeningPort(const grpc::string& addr,
std::unique_ptr ServerBuilder::BuildAndStart() {
std::unique_ptr thread_pool;
+ // Does this server have atleast one sync method
+ bool has_sync_methods = false;
for (auto it = services_.begin(); it != services_.end(); ++it) {
if ((*it)->service->has_synchronous_methods()) {
+ has_sync_methods = true;
if (thread_pool == nullptr) {
thread_pool.reset(CreateDefaultThreadPool());
break;
@@ -105,6 +108,12 @@ std::unique_ptr ServerBuilder::BuildAndStart() {
compression_options_.enabled_algorithms_bitset);
std::unique_ptr server(
new Server(thread_pool.release(), true, max_message_size_, &args));
+
+ // If the server has atleast one sync methods, we know that this is a Sync
+ // server or a Hybrid server and the completion queue (server->cq_) would be
+ // frequently polled.
+ int num_frequently_polled_cqs = has_sync_methods ? 1 : 0;
+
for (auto cq = cqs_.begin(); cq != cqs_.end(); ++cq) {
// A completion queue that is not polled frequently (by calling Next() or
// AsyncNext()) is not safe to use for listening to incoming channels.
@@ -113,11 +122,19 @@ std::unique_ptr ServerBuilder::BuildAndStart() {
if ((*cq)->IsFrequentlyPolled()) {
grpc_server_register_completion_queue(server->server_, (*cq)->cq(),
nullptr);
+ num_frequently_polled_cqs++;
} else {
grpc_server_register_non_listening_completion_queue(server->server_,
(*cq)->cq(), nullptr);
}
}
+
+ if (num_frequently_polled_cqs == 0) {
+ gpr_log(GPR_ERROR,
+ "Atleast one of the completion queues must be frequently polled");
+ return nullptr;
+ }
+
for (auto service = services_.begin(); service != services_.end();
service++) {
if (!server->RegisterService((*service)->host.get(), (*service)->service)) {
From 01907123f6323a7494551e7a45e342dcdc068864 Mon Sep 17 00:00:00 2001
From: Sree Kuchibhotla
Date: Thu, 21 Apr 2016 15:09:13 -0700
Subject: [PATCH 017/218] generate_projects.sh and fix copyright year
---
grpc.def | 1 +
include/grpc++/impl/codegen/completion_queue.h | 2 +-
include/grpc++/server_builder.h | 2 +-
include/grpc/grpc.h | 2 +-
src/core/lib/surface/completion_queue.c | 2 +-
src/core/lib/surface/completion_queue.h | 2 +-
src/core/lib/surface/server.c | 2 +-
src/cpp/server/server_builder.cc | 2 +-
src/proto/grpc/binary_log/v1alpha/log.proto | 2 +-
src/python/grpcio/grpc/_cython/imports.generated.c | 2 ++
src/python/grpcio/grpc/_cython/imports.generated.h | 3 +++
src/ruby/ext/grpc/rb_grpc_imports.generated.c | 2 ++
src/ruby/ext/grpc/rb_grpc_imports.generated.h | 3 +++
tools/fuzzer/runners/client_fuzzer.sh | 2 +-
tools/fuzzer/runners/hpack_parser_fuzzer_test.sh | 2 +-
tools/fuzzer/runners/http_fuzzer_test.sh | 2 +-
tools/fuzzer/runners/json_fuzzer_test.sh | 2 +-
tools/fuzzer/runners/nanopb_fuzzer_response_test.sh | 2 +-
tools/fuzzer/runners/nanopb_fuzzer_serverlist_test.sh | 2 +-
tools/fuzzer/runners/server_fuzzer.sh | 2 +-
tools/fuzzer/runners/uri_fuzzer_test.sh | 2 +-
21 files changed, 27 insertions(+), 16 deletions(-)
diff --git a/grpc.def b/grpc.def
index f81aa1b05a6e8..943b464c31fea 100644
--- a/grpc.def
+++ b/grpc.def
@@ -77,6 +77,7 @@ EXPORTS
grpc_server_request_registered_call
grpc_server_create
grpc_server_register_completion_queue
+ grpc_server_register_non_listening_completion_queue
grpc_server_add_insecure_http2_port
grpc_server_start
grpc_server_shutdown_and_notify
diff --git a/include/grpc++/impl/codegen/completion_queue.h b/include/grpc++/impl/codegen/completion_queue.h
index d489a90c69c9f..1b84b44705007 100644
--- a/include/grpc++/impl/codegen/completion_queue.h
+++ b/include/grpc++/impl/codegen/completion_queue.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/include/grpc++/server_builder.h b/include/grpc++/server_builder.h
index 85af9aa57fba9..5275bd3ac1656 100644
--- a/include/grpc++/server_builder.h
+++ b/include/grpc++/server_builder.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/include/grpc/grpc.h b/include/grpc/grpc.h
index 059bd2ebc74e4..ee15b9d88df31 100644
--- a/include/grpc/grpc.h
+++ b/include/grpc/grpc.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/core/lib/surface/completion_queue.c b/src/core/lib/surface/completion_queue.c
index f6f7ac880ccf0..d5eb24270e3c9 100644
--- a/src/core/lib/surface/completion_queue.c
+++ b/src/core/lib/surface/completion_queue.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/core/lib/surface/completion_queue.h b/src/core/lib/surface/completion_queue.h
index ee3e044840133..1528ca4ad8f5d 100644
--- a/src/core/lib/surface/completion_queue.h
+++ b/src/core/lib/surface/completion_queue.h
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c
index c34ec04d2d34c..0a84d8e7cda62 100644
--- a/src/core/lib/surface/server.c
+++ b/src/core/lib/surface/server.c
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/cpp/server/server_builder.cc b/src/cpp/server/server_builder.cc
index c0d13951d703c..9cd7cb2da37c2 100644
--- a/src/cpp/server/server_builder.cc
+++ b/src/cpp/server/server_builder.cc
@@ -1,6 +1,6 @@
/*
*
- * Copyright 2015, Google Inc.
+ * Copyright 2015-2016, Google Inc.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
diff --git a/src/proto/grpc/binary_log/v1alpha/log.proto b/src/proto/grpc/binary_log/v1alpha/log.proto
index 6cc473be74e35..83166cd4104bd 100644
--- a/src/proto/grpc/binary_log/v1alpha/log.proto
+++ b/src/proto/grpc/binary_log/v1alpha/log.proto
@@ -105,4 +105,4 @@ message Message {
// The contents of the message. May be a prefix instead of the complete
// message.
bytes data = 5;
-}
\ No newline at end of file
+}
diff --git a/src/python/grpcio/grpc/_cython/imports.generated.c b/src/python/grpcio/grpc/_cython/imports.generated.c
index 8bd6ae6372b02..edad9a3131a3d 100644
--- a/src/python/grpcio/grpc/_cython/imports.generated.c
+++ b/src/python/grpcio/grpc/_cython/imports.generated.c
@@ -115,6 +115,7 @@ grpc_server_register_method_type grpc_server_register_method_import;
grpc_server_request_registered_call_type grpc_server_request_registered_call_import;
grpc_server_create_type grpc_server_create_import;
grpc_server_register_completion_queue_type grpc_server_register_completion_queue_import;
+grpc_server_register_non_listening_completion_queue_type grpc_server_register_non_listening_completion_queue_import;
grpc_server_add_insecure_http2_port_type grpc_server_add_insecure_http2_port_import;
grpc_server_start_type grpc_server_start_import;
grpc_server_shutdown_and_notify_type grpc_server_shutdown_and_notify_import;
@@ -381,6 +382,7 @@ void pygrpc_load_imports(HMODULE library) {
grpc_server_request_registered_call_import = (grpc_server_request_registered_call_type) GetProcAddress(library, "grpc_server_request_registered_call");
grpc_server_create_import = (grpc_server_create_type) GetProcAddress(library, "grpc_server_create");
grpc_server_register_completion_queue_import = (grpc_server_register_completion_queue_type) GetProcAddress(library, "grpc_server_register_completion_queue");
+ grpc_server_register_non_listening_completion_queue_import = (grpc_server_register_non_listening_completion_queue_type) GetProcAddress(library, "grpc_server_register_non_listening_completion_queue");
grpc_server_add_insecure_http2_port_import = (grpc_server_add_insecure_http2_port_type) GetProcAddress(library, "grpc_server_add_insecure_http2_port");
grpc_server_start_import = (grpc_server_start_type) GetProcAddress(library, "grpc_server_start");
grpc_server_shutdown_and_notify_import = (grpc_server_shutdown_and_notify_type) GetProcAddress(library, "grpc_server_shutdown_and_notify");
diff --git a/src/python/grpcio/grpc/_cython/imports.generated.h b/src/python/grpcio/grpc/_cython/imports.generated.h
index 272e85b485736..7354de4ba29ca 100644
--- a/src/python/grpcio/grpc/_cython/imports.generated.h
+++ b/src/python/grpcio/grpc/_cython/imports.generated.h
@@ -295,6 +295,9 @@ extern grpc_server_create_type grpc_server_create_import;
typedef void(*grpc_server_register_completion_queue_type)(grpc_server *server, grpc_completion_queue *cq, void *reserved);
extern grpc_server_register_completion_queue_type grpc_server_register_completion_queue_import;
#define grpc_server_register_completion_queue grpc_server_register_completion_queue_import
+typedef void(*grpc_server_register_non_listening_completion_queue_type)(grpc_server *server, grpc_completion_queue *q, void *reserved);
+extern grpc_server_register_non_listening_completion_queue_type grpc_server_register_non_listening_completion_queue_import;
+#define grpc_server_register_non_listening_completion_queue grpc_server_register_non_listening_completion_queue_import
typedef int(*grpc_server_add_insecure_http2_port_type)(grpc_server *server, const char *addr);
extern grpc_server_add_insecure_http2_port_type grpc_server_add_insecure_http2_port_import;
#define grpc_server_add_insecure_http2_port grpc_server_add_insecure_http2_port_import
diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.c b/src/ruby/ext/grpc/rb_grpc_imports.generated.c
index 56db4ec686b5f..149ce6c48a43b 100644
--- a/src/ruby/ext/grpc/rb_grpc_imports.generated.c
+++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.c
@@ -115,6 +115,7 @@ grpc_server_register_method_type grpc_server_register_method_import;
grpc_server_request_registered_call_type grpc_server_request_registered_call_import;
grpc_server_create_type grpc_server_create_import;
grpc_server_register_completion_queue_type grpc_server_register_completion_queue_import;
+grpc_server_register_non_listening_completion_queue_type grpc_server_register_non_listening_completion_queue_import;
grpc_server_add_insecure_http2_port_type grpc_server_add_insecure_http2_port_import;
grpc_server_start_type grpc_server_start_import;
grpc_server_shutdown_and_notify_type grpc_server_shutdown_and_notify_import;
@@ -377,6 +378,7 @@ void grpc_rb_load_imports(HMODULE library) {
grpc_server_request_registered_call_import = (grpc_server_request_registered_call_type) GetProcAddress(library, "grpc_server_request_registered_call");
grpc_server_create_import = (grpc_server_create_type) GetProcAddress(library, "grpc_server_create");
grpc_server_register_completion_queue_import = (grpc_server_register_completion_queue_type) GetProcAddress(library, "grpc_server_register_completion_queue");
+ grpc_server_register_non_listening_completion_queue_import = (grpc_server_register_non_listening_completion_queue_type) GetProcAddress(library, "grpc_server_register_non_listening_completion_queue");
grpc_server_add_insecure_http2_port_import = (grpc_server_add_insecure_http2_port_type) GetProcAddress(library, "grpc_server_add_insecure_http2_port");
grpc_server_start_import = (grpc_server_start_type) GetProcAddress(library, "grpc_server_start");
grpc_server_shutdown_and_notify_import = (grpc_server_shutdown_and_notify_type) GetProcAddress(library, "grpc_server_shutdown_and_notify");
diff --git a/src/ruby/ext/grpc/rb_grpc_imports.generated.h b/src/ruby/ext/grpc/rb_grpc_imports.generated.h
index c526f434c6157..098319db77cd5 100644
--- a/src/ruby/ext/grpc/rb_grpc_imports.generated.h
+++ b/src/ruby/ext/grpc/rb_grpc_imports.generated.h
@@ -295,6 +295,9 @@ extern grpc_server_create_type grpc_server_create_import;
typedef void(*grpc_server_register_completion_queue_type)(grpc_server *server, grpc_completion_queue *cq, void *reserved);
extern grpc_server_register_completion_queue_type grpc_server_register_completion_queue_import;
#define grpc_server_register_completion_queue grpc_server_register_completion_queue_import
+typedef void(*grpc_server_register_non_listening_completion_queue_type)(grpc_server *server, grpc_completion_queue *q, void *reserved);
+extern grpc_server_register_non_listening_completion_queue_type grpc_server_register_non_listening_completion_queue_import;
+#define grpc_server_register_non_listening_completion_queue grpc_server_register_non_listening_completion_queue_import
typedef int(*grpc_server_add_insecure_http2_port_type)(grpc_server *server, const char *addr);
extern grpc_server_add_insecure_http2_port_type grpc_server_add_insecure_http2_port_import;
#define grpc_server_add_insecure_http2_port grpc_server_add_insecure_http2_port_import
diff --git a/tools/fuzzer/runners/client_fuzzer.sh b/tools/fuzzer/runners/client_fuzzer.sh
index 239d552c57d34..97d4e60d90831 100644
--- a/tools/fuzzer/runners/client_fuzzer.sh
+++ b/tools/fuzzer/runners/client_fuzzer.sh
@@ -33,7 +33,7 @@ flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=2048"
if [ "$jobs" != "1" ]
then
- flags="-jobs=$jobs -workers=$jobs"
+ flags="-jobs=$jobs -workers=$jobs $flags"
fi
if [ "$config" == "asan-trace-cmp" ]
diff --git a/tools/fuzzer/runners/hpack_parser_fuzzer_test.sh b/tools/fuzzer/runners/hpack_parser_fuzzer_test.sh
index e69b4b4dfe297..c6f70a623dcee 100644
--- a/tools/fuzzer/runners/hpack_parser_fuzzer_test.sh
+++ b/tools/fuzzer/runners/hpack_parser_fuzzer_test.sh
@@ -33,7 +33,7 @@ flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=512"
if [ "$jobs" != "1" ]
then
- flags="-jobs=$jobs -workers=$jobs"
+ flags="-jobs=$jobs -workers=$jobs $flags"
fi
if [ "$config" == "asan-trace-cmp" ]
diff --git a/tools/fuzzer/runners/http_fuzzer_test.sh b/tools/fuzzer/runners/http_fuzzer_test.sh
index c190ba40b6040..bb54a23814561 100644
--- a/tools/fuzzer/runners/http_fuzzer_test.sh
+++ b/tools/fuzzer/runners/http_fuzzer_test.sh
@@ -33,7 +33,7 @@ flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=2048"
if [ "$jobs" != "1" ]
then
- flags="-jobs=$jobs -workers=$jobs"
+ flags="-jobs=$jobs -workers=$jobs $flags"
fi
if [ "$config" == "asan-trace-cmp" ]
diff --git a/tools/fuzzer/runners/json_fuzzer_test.sh b/tools/fuzzer/runners/json_fuzzer_test.sh
index 9fc6271976b6d..e11e25dc097a5 100644
--- a/tools/fuzzer/runners/json_fuzzer_test.sh
+++ b/tools/fuzzer/runners/json_fuzzer_test.sh
@@ -33,7 +33,7 @@ flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=512"
if [ "$jobs" != "1" ]
then
- flags="-jobs=$jobs -workers=$jobs"
+ flags="-jobs=$jobs -workers=$jobs $flags"
fi
if [ "$config" == "asan-trace-cmp" ]
diff --git a/tools/fuzzer/runners/nanopb_fuzzer_response_test.sh b/tools/fuzzer/runners/nanopb_fuzzer_response_test.sh
index bbcebf11cce59..97359277ce24d 100644
--- a/tools/fuzzer/runners/nanopb_fuzzer_response_test.sh
+++ b/tools/fuzzer/runners/nanopb_fuzzer_response_test.sh
@@ -33,7 +33,7 @@ flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=128"
if [ "$jobs" != "1" ]
then
- flags="-jobs=$jobs -workers=$jobs"
+ flags="-jobs=$jobs -workers=$jobs $flags"
fi
if [ "$config" == "asan-trace-cmp" ]
diff --git a/tools/fuzzer/runners/nanopb_fuzzer_serverlist_test.sh b/tools/fuzzer/runners/nanopb_fuzzer_serverlist_test.sh
index e9099bac04672..2dfaa2372fc8a 100644
--- a/tools/fuzzer/runners/nanopb_fuzzer_serverlist_test.sh
+++ b/tools/fuzzer/runners/nanopb_fuzzer_serverlist_test.sh
@@ -33,7 +33,7 @@ flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=128"
if [ "$jobs" != "1" ]
then
- flags="-jobs=$jobs -workers=$jobs"
+ flags="-jobs=$jobs -workers=$jobs $flags"
fi
if [ "$config" == "asan-trace-cmp" ]
diff --git a/tools/fuzzer/runners/server_fuzzer.sh b/tools/fuzzer/runners/server_fuzzer.sh
index 28ca8b32719e9..fc0567f670b72 100644
--- a/tools/fuzzer/runners/server_fuzzer.sh
+++ b/tools/fuzzer/runners/server_fuzzer.sh
@@ -33,7 +33,7 @@ flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=2048"
if [ "$jobs" != "1" ]
then
- flags="-jobs=$jobs -workers=$jobs"
+ flags="-jobs=$jobs -workers=$jobs $flags"
fi
if [ "$config" == "asan-trace-cmp" ]
diff --git a/tools/fuzzer/runners/uri_fuzzer_test.sh b/tools/fuzzer/runners/uri_fuzzer_test.sh
index 7dac54ec51805..5f33e73465447 100644
--- a/tools/fuzzer/runners/uri_fuzzer_test.sh
+++ b/tools/fuzzer/runners/uri_fuzzer_test.sh
@@ -33,7 +33,7 @@ flags="-max_total_time=$runtime -artifact_prefix=fuzzer_output/ -max_len=128"
if [ "$jobs" != "1" ]
then
- flags="-jobs=$jobs -workers=$jobs"
+ flags="-jobs=$jobs -workers=$jobs $flags"
fi
if [ "$config" == "asan-trace-cmp" ]
From 0b9fdd8adc4b2d167e33a6d39e7ff4a46ef9a65c Mon Sep 17 00:00:00 2001
From: Sree Kuchibhotla
Date: Thu, 21 Apr 2016 17:27:41 -0700
Subject: [PATCH 018/218] clang format fix
---
test/core/end2end/fixtures/h2_sockpair_1byte.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/core/end2end/fixtures/h2_sockpair_1byte.c b/test/core/end2end/fixtures/h2_sockpair_1byte.c
index 4c805c43706f7..16ffb6ec13fdc 100644
--- a/test/core/end2end/fixtures/h2_sockpair_1byte.c
+++ b/test/core/end2end/fixtures/h2_sockpair_1byte.c
@@ -60,7 +60,7 @@
static void server_setup_transport(void *ts, grpc_transport *transport) {
grpc_end2end_test_fixture *f = ts;
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
- grpc_endpoint_pair* sfd = f->fixture_data;
+ grpc_endpoint_pair *sfd = f->fixture_data;
grpc_endpoint_add_to_pollset(&exec_ctx, sfd->server, grpc_cq_pollset(f->cq));
grpc_server_setup_transport(&exec_ctx, f->server, transport,
grpc_server_get_channel_args(f->server));
From 12dfdc3c27a14910f389fa1b1ac5ec0d54b9435c Mon Sep 17 00:00:00 2001
From: Yuchen Zeng
Date: Tue, 26 Apr 2016 22:05:41 -0700
Subject: [PATCH 019/218] Change win32 file suffix
---
BUILD | 82 +++++++++----------
Makefile | 44 +++++-----
binding.gyp | 16 ++--
build.yaml | 30 +++----
config.m4 | 16 ++--
gRPC.podspec | 38 ++++-----
grpc.gemspec | 34 ++++----
include/grpc/impl/codegen/atm.h | 4 +-
.../codegen/{atm_win32.h => atm_windows.h} | 6 +-
include/grpc/impl/codegen/port_platform.h | 16 ++--
include/grpc/impl/codegen/sync.h | 4 +-
.../codegen/{sync_win32.h => sync_windows.h} | 6 +-
.../support/{sync_win32.h => atm_windows.h} | 8 +-
.../support/{log_win32.h => log_windows.h} | 6 +-
.../support/{atm_win32.h => sync_windows.h} | 8 +-
package.xml | 34 ++++----
src/core/lib/iomgr/iocp_windows.c | 2 +-
src/core/lib/iomgr/iomgr_windows.c | 2 +-
src/core/lib/iomgr/resolve_address_windows.c | 2 +-
src/core/lib/iomgr/sockaddr.h | 4 +-
.../{sockaddr_win32.h => sockaddr_windows.h} | 6 +-
src/core/lib/iomgr/socket_windows.c | 2 +-
src/core/lib/iomgr/tcp_client_windows.c | 4 +-
src/core/lib/iomgr/tcp_server_windows.c | 2 +-
src/core/lib/iomgr/tcp_windows.c | 4 +-
src/core/lib/iomgr/workqueue.h | 2 +-
src/core/lib/iomgr/workqueue_windows.c | 4 +-
...dentials_win32.c => credentials_windows.c} | 4 +-
src/core/lib/support/cpu_windows.c | 4 +-
.../support/{env_win32.c => env_windows.c} | 4 +-
.../support/{log_win32.c => log_windows.c} | 8 +-
.../{string_win32.c => string_windows.c} | 4 +-
.../{string_win32.h => string_windows.h} | 10 +--
src/core/lib/support/subprocess_windows.c | 2 +-
.../support/{sync_win32.c => sync_windows.c} | 4 +-
.../support/{thd_win32.c => thd_windows.c} | 4 +-
.../support/{time_win32.c => time_windows.c} | 4 +-
.../{tmpfile_win32.c => tmpfile_windows.c} | 6 +-
src/csharp/ext/grpc_csharp_ext.c | 2 +-
.../grpcio/grpc/_cython/imports.generated.c | 4 +-
.../grpcio/grpc/_cython/imports.generated.h | 8 +-
src/python/grpcio/grpc/_cython/loader.c | 4 +-
src/python/grpcio/grpc_core_dependencies.py | 16 ++--
src/ruby/ext/grpc/rb_grpc_imports.generated.c | 4 +-
src/ruby/ext/grpc/rb_grpc_imports.generated.h | 6 +-
src/ruby/ext/grpc/rb_loader.c | 2 +-
.../grpc/_cython/imports.generated.c.template | 4 +-
.../grpc/_cython/imports.generated.h.template | 6 +-
.../grpc/rb_grpc_imports.generated.c.template | 4 +-
.../grpc/rb_grpc_imports.generated.h.template | 4 +-
tools/doxygen/Doxyfile.c++ | 4 +-
tools/doxygen/Doxyfile.c++.internal | 4 +-
tools/doxygen/Doxyfile.core | 14 ++--
tools/doxygen/Doxyfile.core.internal | 34 ++++----
tools/run_tests/sources_and_headers.json | 44 +++++-----
vsprojects/coapp/openssl/libeay32.vcxproj | 2 +-
vsprojects/vcxproj/gpr/gpr.vcxproj | 26 +++---
vsprojects/vcxproj/gpr/gpr.vcxproj.filters | 26 +++---
vsprojects/vcxproj/grpc++/grpc++.vcxproj | 4 +-
.../vcxproj/grpc++/grpc++.vcxproj.filters | 4 +-
.../grpc++_unsecure/grpc++_unsecure.vcxproj | 4 +-
.../grpc++_unsecure.vcxproj.filters | 4 +-
vsprojects/vcxproj/grpc/grpc.vcxproj | 8 +-
vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 8 +-
.../grpc_unsecure/grpc_unsecure.vcxproj | 6 +-
.../grpc_unsecure.vcxproj.filters | 6 +-
.../codegen_test_full.vcxproj | 4 +-
.../codegen_test_full.vcxproj.filters | 4 +-
.../codegen_test_minimal.vcxproj | 4 +-
.../codegen_test_minimal.vcxproj.filters | 4 +-
70 files changed, 359 insertions(+), 359 deletions(-)
rename include/grpc/impl/codegen/{atm_win32.h => atm_windows.h} (97%)
rename include/grpc/impl/codegen/{sync_win32.h => sync_windows.h} (93%)
rename include/grpc/support/{sync_win32.h => atm_windows.h} (91%)
rename include/grpc/support/{log_win32.h => log_windows.h} (94%)
rename include/grpc/support/{atm_win32.h => sync_windows.h} (90%)
rename src/core/lib/iomgr/{sockaddr_win32.h => sockaddr_windows.h} (91%)
rename src/core/lib/security/{credentials_win32.c => credentials_windows.c} (98%)
rename src/core/lib/support/{env_win32.c => env_windows.c} (98%)
rename src/core/lib/support/{log_win32.c => log_windows.c} (96%)
rename src/core/lib/support/{string_win32.c => string_windows.c} (98%)
rename src/core/lib/support/{string_win32.h => string_windows.h} (90%)
rename src/core/lib/support/{sync_win32.c => sync_windows.c} (98%)
rename src/core/lib/support/{thd_win32.c => thd_windows.c} (98%)
rename src/core/lib/support/{time_win32.c => time_windows.c} (98%)
rename src/core/lib/support/{tmpfile_win32.c => tmpfile_windows.c} (96%)
diff --git a/BUILD b/BUILD
index b69c9404113bf..64e60302aa6c8 100644
--- a/BUILD
+++ b/BUILD
@@ -53,7 +53,7 @@ cc_library(
"src/core/lib/support/murmur_hash.h",
"src/core/lib/support/stack_lockfree.h",
"src/core/lib/support/string.h",
- "src/core/lib/support/string_win32.h",
+ "src/core/lib/support/string_windows.h",
"src/core/lib/support/thd_internal.h",
"src/core/lib/support/time_precise.h",
"src/core/lib/support/tmpfile.h",
@@ -69,7 +69,7 @@ cc_library(
"src/core/lib/support/cpu_windows.c",
"src/core/lib/support/env_linux.c",
"src/core/lib/support/env_posix.c",
- "src/core/lib/support/env_win32.c",
+ "src/core/lib/support/env_windows.c",
"src/core/lib/support/histogram.c",
"src/core/lib/support/host_port.c",
"src/core/lib/support/load_file.c",
@@ -77,29 +77,29 @@ cc_library(
"src/core/lib/support/log_android.c",
"src/core/lib/support/log_linux.c",
"src/core/lib/support/log_posix.c",
- "src/core/lib/support/log_win32.c",
+ "src/core/lib/support/log_windows.c",
"src/core/lib/support/murmur_hash.c",
"src/core/lib/support/slice.c",
"src/core/lib/support/slice_buffer.c",
"src/core/lib/support/stack_lockfree.c",
"src/core/lib/support/string.c",
"src/core/lib/support/string_posix.c",
- "src/core/lib/support/string_win32.c",
+ "src/core/lib/support/string_windows.c",
"src/core/lib/support/subprocess_posix.c",
"src/core/lib/support/subprocess_windows.c",
"src/core/lib/support/sync.c",
"src/core/lib/support/sync_posix.c",
- "src/core/lib/support/sync_win32.c",
+ "src/core/lib/support/sync_windows.c",
"src/core/lib/support/thd.c",
"src/core/lib/support/thd_posix.c",
- "src/core/lib/support/thd_win32.c",
+ "src/core/lib/support/thd_windows.c",
"src/core/lib/support/time.c",
"src/core/lib/support/time_posix.c",
"src/core/lib/support/time_precise.c",
- "src/core/lib/support/time_win32.c",
+ "src/core/lib/support/time_windows.c",
"src/core/lib/support/tls_pthread.c",
"src/core/lib/support/tmpfile_posix.c",
- "src/core/lib/support/tmpfile_win32.c",
+ "src/core/lib/support/tmpfile_windows.c",
"src/core/lib/support/wrap_memcpy.c",
],
hdrs = [
@@ -107,14 +107,14 @@ cc_library(
"include/grpc/support/atm.h",
"include/grpc/support/atm_gcc_atomic.h",
"include/grpc/support/atm_gcc_sync.h",
- "include/grpc/support/atm_win32.h",
+ "include/grpc/support/atm_windows.h",
"include/grpc/support/avl.h",
"include/grpc/support/cmdline.h",
"include/grpc/support/cpu.h",
"include/grpc/support/histogram.h",
"include/grpc/support/host_port.h",
"include/grpc/support/log.h",
- "include/grpc/support/log_win32.h",
+ "include/grpc/support/log_windows.h",
"include/grpc/support/port_platform.h",
"include/grpc/support/slice.h",
"include/grpc/support/slice_buffer.h",
@@ -123,7 +123,7 @@ cc_library(
"include/grpc/support/sync.h",
"include/grpc/support/sync_generic.h",
"include/grpc/support/sync_posix.h",
- "include/grpc/support/sync_win32.h",
+ "include/grpc/support/sync_windows.h",
"include/grpc/support/thd.h",
"include/grpc/support/time.h",
"include/grpc/support/tls.h",
@@ -135,7 +135,7 @@ cc_library(
"include/grpc/impl/codegen/atm.h",
"include/grpc/impl/codegen/atm_gcc_atomic.h",
"include/grpc/impl/codegen/atm_gcc_sync.h",
- "include/grpc/impl/codegen/atm_win32.h",
+ "include/grpc/impl/codegen/atm_windows.h",
"include/grpc/impl/codegen/log.h",
"include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/slice.h",
@@ -143,7 +143,7 @@ cc_library(
"include/grpc/impl/codegen/sync.h",
"include/grpc/impl/codegen/sync_generic.h",
"include/grpc/impl/codegen/sync_posix.h",
- "include/grpc/impl/codegen/sync_win32.h",
+ "include/grpc/impl/codegen/sync_windows.h",
"include/grpc/impl/codegen/time.h",
],
includes = [
@@ -192,7 +192,7 @@ cc_library(
"src/core/lib/iomgr/sockaddr.h",
"src/core/lib/iomgr/sockaddr_posix.h",
"src/core/lib/iomgr/sockaddr_utils.h",
- "src/core/lib/iomgr/sockaddr_win32.h",
+ "src/core/lib/iomgr/sockaddr_windows.h",
"src/core/lib/iomgr/socket_utils_posix.h",
"src/core/lib/iomgr/socket_windows.h",
"src/core/lib/iomgr/tcp_client.h",
@@ -402,7 +402,7 @@ cc_library(
"src/core/lib/security/credentials.c",
"src/core/lib/security/credentials_metadata.c",
"src/core/lib/security/credentials_posix.c",
- "src/core/lib/security/credentials_win32.c",
+ "src/core/lib/security/credentials_windows.c",
"src/core/lib/security/google_default_credentials.c",
"src/core/lib/security/handshake.c",
"src/core/lib/security/json_token.c",
@@ -470,7 +470,7 @@ cc_library(
"include/grpc/impl/codegen/atm.h",
"include/grpc/impl/codegen/atm_gcc_atomic.h",
"include/grpc/impl/codegen/atm_gcc_sync.h",
- "include/grpc/impl/codegen/atm_win32.h",
+ "include/grpc/impl/codegen/atm_windows.h",
"include/grpc/impl/codegen/log.h",
"include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/slice.h",
@@ -478,7 +478,7 @@ cc_library(
"include/grpc/impl/codegen/sync.h",
"include/grpc/impl/codegen/sync_generic.h",
"include/grpc/impl/codegen/sync_posix.h",
- "include/grpc/impl/codegen/sync_win32.h",
+ "include/grpc/impl/codegen/sync_windows.h",
"include/grpc/impl/codegen/time.h",
"include/grpc/grpc_security.h",
"include/grpc/grpc_security_constants.h",
@@ -537,7 +537,7 @@ cc_library(
"src/core/lib/iomgr/sockaddr.h",
"src/core/lib/iomgr/sockaddr_posix.h",
"src/core/lib/iomgr/sockaddr_utils.h",
- "src/core/lib/iomgr/sockaddr_win32.h",
+ "src/core/lib/iomgr/sockaddr_windows.h",
"src/core/lib/iomgr/socket_utils_posix.h",
"src/core/lib/iomgr/socket_windows.h",
"src/core/lib/iomgr/tcp_client.h",
@@ -781,7 +781,7 @@ cc_library(
"include/grpc/impl/codegen/atm.h",
"include/grpc/impl/codegen/atm_gcc_atomic.h",
"include/grpc/impl/codegen/atm_gcc_sync.h",
- "include/grpc/impl/codegen/atm_win32.h",
+ "include/grpc/impl/codegen/atm_windows.h",
"include/grpc/impl/codegen/log.h",
"include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/slice.h",
@@ -789,7 +789,7 @@ cc_library(
"include/grpc/impl/codegen/sync.h",
"include/grpc/impl/codegen/sync_generic.h",
"include/grpc/impl/codegen/sync_posix.h",
- "include/grpc/impl/codegen/sync_win32.h",
+ "include/grpc/impl/codegen/sync_windows.h",
"include/grpc/impl/codegen/time.h",
"include/grpc/census.h",
],
@@ -953,7 +953,7 @@ cc_library(
"include/grpc/impl/codegen/atm.h",
"include/grpc/impl/codegen/atm_gcc_atomic.h",
"include/grpc/impl/codegen/atm_gcc_sync.h",
- "include/grpc/impl/codegen/atm_win32.h",
+ "include/grpc/impl/codegen/atm_windows.h",
"include/grpc/impl/codegen/log.h",
"include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/slice.h",
@@ -961,7 +961,7 @@ cc_library(
"include/grpc/impl/codegen/sync.h",
"include/grpc/impl/codegen/sync_generic.h",
"include/grpc/impl/codegen/sync_posix.h",
- "include/grpc/impl/codegen/sync_win32.h",
+ "include/grpc/impl/codegen/sync_windows.h",
"include/grpc/impl/codegen/time.h",
"include/grpc++/impl/codegen/config.h",
"include/grpc++/impl/codegen/config_protobuf.h",
@@ -1098,7 +1098,7 @@ cc_library(
"include/grpc/impl/codegen/atm.h",
"include/grpc/impl/codegen/atm_gcc_atomic.h",
"include/grpc/impl/codegen/atm_gcc_sync.h",
- "include/grpc/impl/codegen/atm_win32.h",
+ "include/grpc/impl/codegen/atm_windows.h",
"include/grpc/impl/codegen/log.h",
"include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/slice.h",
@@ -1106,7 +1106,7 @@ cc_library(
"include/grpc/impl/codegen/sync.h",
"include/grpc/impl/codegen/sync_generic.h",
"include/grpc/impl/codegen/sync_posix.h",
- "include/grpc/impl/codegen/sync_win32.h",
+ "include/grpc/impl/codegen/sync_windows.h",
"include/grpc/impl/codegen/time.h",
"include/grpc++/impl/codegen/config.h",
"include/grpc++/impl/codegen/config_protobuf.h",
@@ -1204,7 +1204,7 @@ objc_library(
"src/core/lib/support/cpu_windows.c",
"src/core/lib/support/env_linux.c",
"src/core/lib/support/env_posix.c",
- "src/core/lib/support/env_win32.c",
+ "src/core/lib/support/env_windows.c",
"src/core/lib/support/histogram.c",
"src/core/lib/support/host_port.c",
"src/core/lib/support/load_file.c",
@@ -1212,29 +1212,29 @@ objc_library(
"src/core/lib/support/log_android.c",
"src/core/lib/support/log_linux.c",
"src/core/lib/support/log_posix.c",
- "src/core/lib/support/log_win32.c",
+ "src/core/lib/support/log_windows.c",
"src/core/lib/support/murmur_hash.c",
"src/core/lib/support/slice.c",
"src/core/lib/support/slice_buffer.c",
"src/core/lib/support/stack_lockfree.c",
"src/core/lib/support/string.c",
"src/core/lib/support/string_posix.c",
- "src/core/lib/support/string_win32.c",
+ "src/core/lib/support/string_windows.c",
"src/core/lib/support/subprocess_posix.c",
"src/core/lib/support/subprocess_windows.c",
"src/core/lib/support/sync.c",
"src/core/lib/support/sync_posix.c",
- "src/core/lib/support/sync_win32.c",
+ "src/core/lib/support/sync_windows.c",
"src/core/lib/support/thd.c",
"src/core/lib/support/thd_posix.c",
- "src/core/lib/support/thd_win32.c",
+ "src/core/lib/support/thd_windows.c",
"src/core/lib/support/time.c",
"src/core/lib/support/time_posix.c",
"src/core/lib/support/time_precise.c",
- "src/core/lib/support/time_win32.c",
+ "src/core/lib/support/time_windows.c",
"src/core/lib/support/tls_pthread.c",
"src/core/lib/support/tmpfile_posix.c",
- "src/core/lib/support/tmpfile_win32.c",
+ "src/core/lib/support/tmpfile_windows.c",
"src/core/lib/support/wrap_memcpy.c",
],
hdrs = [
@@ -1242,14 +1242,14 @@ objc_library(
"include/grpc/support/atm.h",
"include/grpc/support/atm_gcc_atomic.h",
"include/grpc/support/atm_gcc_sync.h",
- "include/grpc/support/atm_win32.h",
+ "include/grpc/support/atm_windows.h",
"include/grpc/support/avl.h",
"include/grpc/support/cmdline.h",
"include/grpc/support/cpu.h",
"include/grpc/support/histogram.h",
"include/grpc/support/host_port.h",
"include/grpc/support/log.h",
- "include/grpc/support/log_win32.h",
+ "include/grpc/support/log_windows.h",
"include/grpc/support/port_platform.h",
"include/grpc/support/slice.h",
"include/grpc/support/slice_buffer.h",
@@ -1258,7 +1258,7 @@ objc_library(
"include/grpc/support/sync.h",
"include/grpc/support/sync_generic.h",
"include/grpc/support/sync_posix.h",
- "include/grpc/support/sync_win32.h",
+ "include/grpc/support/sync_windows.h",
"include/grpc/support/thd.h",
"include/grpc/support/time.h",
"include/grpc/support/tls.h",
@@ -1270,7 +1270,7 @@ objc_library(
"include/grpc/impl/codegen/atm.h",
"include/grpc/impl/codegen/atm_gcc_atomic.h",
"include/grpc/impl/codegen/atm_gcc_sync.h",
- "include/grpc/impl/codegen/atm_win32.h",
+ "include/grpc/impl/codegen/atm_windows.h",
"include/grpc/impl/codegen/log.h",
"include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/slice.h",
@@ -1278,7 +1278,7 @@ objc_library(
"include/grpc/impl/codegen/sync.h",
"include/grpc/impl/codegen/sync_generic.h",
"include/grpc/impl/codegen/sync_posix.h",
- "include/grpc/impl/codegen/sync_win32.h",
+ "include/grpc/impl/codegen/sync_windows.h",
"include/grpc/impl/codegen/time.h",
"src/core/lib/profiling/timers.h",
"src/core/lib/support/backoff.h",
@@ -1288,7 +1288,7 @@ objc_library(
"src/core/lib/support/murmur_hash.h",
"src/core/lib/support/stack_lockfree.h",
"src/core/lib/support/string.h",
- "src/core/lib/support/string_win32.h",
+ "src/core/lib/support/string_windows.h",
"src/core/lib/support/thd_internal.h",
"src/core/lib/support/time_precise.h",
"src/core/lib/support/tmpfile.h",
@@ -1417,7 +1417,7 @@ objc_library(
"src/core/lib/security/credentials.c",
"src/core/lib/security/credentials_metadata.c",
"src/core/lib/security/credentials_posix.c",
- "src/core/lib/security/credentials_win32.c",
+ "src/core/lib/security/credentials_windows.c",
"src/core/lib/security/google_default_credentials.c",
"src/core/lib/security/handshake.c",
"src/core/lib/security/json_token.c",
@@ -1485,7 +1485,7 @@ objc_library(
"include/grpc/impl/codegen/atm.h",
"include/grpc/impl/codegen/atm_gcc_atomic.h",
"include/grpc/impl/codegen/atm_gcc_sync.h",
- "include/grpc/impl/codegen/atm_win32.h",
+ "include/grpc/impl/codegen/atm_windows.h",
"include/grpc/impl/codegen/log.h",
"include/grpc/impl/codegen/port_platform.h",
"include/grpc/impl/codegen/slice.h",
@@ -1493,7 +1493,7 @@ objc_library(
"include/grpc/impl/codegen/sync.h",
"include/grpc/impl/codegen/sync_generic.h",
"include/grpc/impl/codegen/sync_posix.h",
- "include/grpc/impl/codegen/sync_win32.h",
+ "include/grpc/impl/codegen/sync_windows.h",
"include/grpc/impl/codegen/time.h",
"include/grpc/grpc_security.h",
"include/grpc/grpc_security_constants.h",
@@ -1531,7 +1531,7 @@ objc_library(
"src/core/lib/iomgr/sockaddr.h",
"src/core/lib/iomgr/sockaddr_posix.h",
"src/core/lib/iomgr/sockaddr_utils.h",
- "src/core/lib/iomgr/sockaddr_win32.h",
+ "src/core/lib/iomgr/sockaddr_windows.h",
"src/core/lib/iomgr/socket_utils_posix.h",
"src/core/lib/iomgr/socket_windows.h",
"src/core/lib/iomgr/tcp_client.h",
diff --git a/Makefile b/Makefile
index 3b7dbd9638a6d..91360ad970773 100644
--- a/Makefile
+++ b/Makefile
@@ -2316,7 +2316,7 @@ LIBGPR_SRC = \
src/core/lib/support/cpu_windows.c \
src/core/lib/support/env_linux.c \
src/core/lib/support/env_posix.c \
- src/core/lib/support/env_win32.c \
+ src/core/lib/support/env_windows.c \
src/core/lib/support/histogram.c \
src/core/lib/support/host_port.c \
src/core/lib/support/load_file.c \
@@ -2324,29 +2324,29 @@ LIBGPR_SRC = \
src/core/lib/support/log_android.c \
src/core/lib/support/log_linux.c \
src/core/lib/support/log_posix.c \
- src/core/lib/support/log_win32.c \
+ src/core/lib/support/log_windows.c \
src/core/lib/support/murmur_hash.c \
src/core/lib/support/slice.c \
src/core/lib/support/slice_buffer.c \
src/core/lib/support/stack_lockfree.c \
src/core/lib/support/string.c \
src/core/lib/support/string_posix.c \
- src/core/lib/support/string_win32.c \
+ src/core/lib/support/string_windows.c \
src/core/lib/support/subprocess_posix.c \
src/core/lib/support/subprocess_windows.c \
src/core/lib/support/sync.c \
src/core/lib/support/sync_posix.c \
- src/core/lib/support/sync_win32.c \
+ src/core/lib/support/sync_windows.c \
src/core/lib/support/thd.c \
src/core/lib/support/thd_posix.c \
- src/core/lib/support/thd_win32.c \
+ src/core/lib/support/thd_windows.c \
src/core/lib/support/time.c \
src/core/lib/support/time_posix.c \
src/core/lib/support/time_precise.c \
- src/core/lib/support/time_win32.c \
+ src/core/lib/support/time_windows.c \
src/core/lib/support/tls_pthread.c \
src/core/lib/support/tmpfile_posix.c \
- src/core/lib/support/tmpfile_win32.c \
+ src/core/lib/support/tmpfile_windows.c \
src/core/lib/support/wrap_memcpy.c \
PUBLIC_HEADERS_C += \
@@ -2354,14 +2354,14 @@ PUBLIC_HEADERS_C += \
include/grpc/support/atm.h \
include/grpc/support/atm_gcc_atomic.h \
include/grpc/support/atm_gcc_sync.h \
- include/grpc/support/atm_win32.h \
+ include/grpc/support/atm_windows.h \
include/grpc/support/avl.h \
include/grpc/support/cmdline.h \
include/grpc/support/cpu.h \
include/grpc/support/histogram.h \
include/grpc/support/host_port.h \
include/grpc/support/log.h \
- include/grpc/support/log_win32.h \
+ include/grpc/support/log_windows.h \
include/grpc/support/port_platform.h \
include/grpc/support/slice.h \
include/grpc/support/slice_buffer.h \
@@ -2370,7 +2370,7 @@ PUBLIC_HEADERS_C += \
include/grpc/support/sync.h \
include/grpc/support/sync_generic.h \
include/grpc/support/sync_posix.h \
- include/grpc/support/sync_win32.h \
+ include/grpc/support/sync_windows.h \
include/grpc/support/thd.h \
include/grpc/support/time.h \
include/grpc/support/tls.h \
@@ -2382,7 +2382,7 @@ PUBLIC_HEADERS_C += \
include/grpc/impl/codegen/atm.h \
include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \
- include/grpc/impl/codegen/atm_win32.h \
+ include/grpc/impl/codegen/atm_windows.h \
include/grpc/impl/codegen/log.h \
include/grpc/impl/codegen/port_platform.h \
include/grpc/impl/codegen/slice.h \
@@ -2390,7 +2390,7 @@ PUBLIC_HEADERS_C += \
include/grpc/impl/codegen/sync.h \
include/grpc/impl/codegen/sync_generic.h \
include/grpc/impl/codegen/sync_posix.h \
- include/grpc/impl/codegen/sync_win32.h \
+ include/grpc/impl/codegen/sync_windows.h \
include/grpc/impl/codegen/time.h \
LIBGPR_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(LIBGPR_SRC))))
@@ -2567,7 +2567,7 @@ LIBGRPC_SRC = \
src/core/lib/security/credentials.c \
src/core/lib/security/credentials_metadata.c \
src/core/lib/security/credentials_posix.c \
- src/core/lib/security/credentials_win32.c \
+ src/core/lib/security/credentials_windows.c \
src/core/lib/security/google_default_credentials.c \
src/core/lib/security/handshake.c \
src/core/lib/security/json_token.c \
@@ -2638,7 +2638,7 @@ PUBLIC_HEADERS_C += \
include/grpc/impl/codegen/atm.h \
include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \
- include/grpc/impl/codegen/atm_win32.h \
+ include/grpc/impl/codegen/atm_windows.h \
include/grpc/impl/codegen/log.h \
include/grpc/impl/codegen/port_platform.h \
include/grpc/impl/codegen/slice.h \
@@ -2646,7 +2646,7 @@ PUBLIC_HEADERS_C += \
include/grpc/impl/codegen/sync.h \
include/grpc/impl/codegen/sync_generic.h \
include/grpc/impl/codegen/sync_posix.h \
- include/grpc/impl/codegen/sync_win32.h \
+ include/grpc/impl/codegen/sync_windows.h \
include/grpc/impl/codegen/time.h \
include/grpc/grpc_security.h \
include/grpc/grpc_security_constants.h \
@@ -2958,7 +2958,7 @@ PUBLIC_HEADERS_C += \
include/grpc/impl/codegen/atm.h \
include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \
- include/grpc/impl/codegen/atm_win32.h \
+ include/grpc/impl/codegen/atm_windows.h \
include/grpc/impl/codegen/log.h \
include/grpc/impl/codegen/port_platform.h \
include/grpc/impl/codegen/slice.h \
@@ -2966,7 +2966,7 @@ PUBLIC_HEADERS_C += \
include/grpc/impl/codegen/sync.h \
include/grpc/impl/codegen/sync_generic.h \
include/grpc/impl/codegen/sync_posix.h \
- include/grpc/impl/codegen/sync_win32.h \
+ include/grpc/impl/codegen/sync_windows.h \
include/grpc/impl/codegen/time.h \
include/grpc/census.h \
@@ -3244,7 +3244,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc/impl/codegen/atm.h \
include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \
- include/grpc/impl/codegen/atm_win32.h \
+ include/grpc/impl/codegen/atm_windows.h \
include/grpc/impl/codegen/log.h \
include/grpc/impl/codegen/port_platform.h \
include/grpc/impl/codegen/slice.h \
@@ -3252,7 +3252,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc/impl/codegen/sync.h \
include/grpc/impl/codegen/sync_generic.h \
include/grpc/impl/codegen/sync_posix.h \
- include/grpc/impl/codegen/sync_win32.h \
+ include/grpc/impl/codegen/sync_windows.h \
include/grpc/impl/codegen/time.h \
include/grpc++/impl/codegen/config.h \
include/grpc++/impl/codegen/config_protobuf.h \
@@ -3547,7 +3547,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc/impl/codegen/atm.h \
include/grpc/impl/codegen/atm_gcc_atomic.h \
include/grpc/impl/codegen/atm_gcc_sync.h \
- include/grpc/impl/codegen/atm_win32.h \
+ include/grpc/impl/codegen/atm_windows.h \
include/grpc/impl/codegen/log.h \
include/grpc/impl/codegen/port_platform.h \
include/grpc/impl/codegen/slice.h \
@@ -3555,7 +3555,7 @@ PUBLIC_HEADERS_CXX += \
include/grpc/impl/codegen/sync.h \
include/grpc/impl/codegen/sync_generic.h \
include/grpc/impl/codegen/sync_posix.h \
- include/grpc/impl/codegen/sync_win32.h \
+ include/grpc/impl/codegen/sync_windows.h \
include/grpc/impl/codegen/time.h \
include/grpc++/impl/codegen/config.h \
include/grpc++/impl/codegen/config_protobuf.h \
@@ -14251,7 +14251,7 @@ src/core/lib/security/client_auth_filter.c: $(OPENSSL_DEP)
src/core/lib/security/credentials.c: $(OPENSSL_DEP)
src/core/lib/security/credentials_metadata.c: $(OPENSSL_DEP)
src/core/lib/security/credentials_posix.c: $(OPENSSL_DEP)
-src/core/lib/security/credentials_win32.c: $(OPENSSL_DEP)
+src/core/lib/security/credentials_windows.c: $(OPENSSL_DEP)
src/core/lib/security/google_default_credentials.c: $(OPENSSL_DEP)
src/core/lib/security/handshake.c: $(OPENSSL_DEP)
src/core/lib/security/json_token.c: $(OPENSSL_DEP)
diff --git a/binding.gyp b/binding.gyp
index 058743edbf84a..fa77848ee6fe3 100644
--- a/binding.gyp
+++ b/binding.gyp
@@ -507,7 +507,7 @@
'src/core/lib/support/cpu_windows.c',
'src/core/lib/support/env_linux.c',
'src/core/lib/support/env_posix.c',
- 'src/core/lib/support/env_win32.c',
+ 'src/core/lib/support/env_windows.c',
'src/core/lib/support/histogram.c',
'src/core/lib/support/host_port.c',
'src/core/lib/support/load_file.c',
@@ -515,29 +515,29 @@
'src/core/lib/support/log_android.c',
'src/core/lib/support/log_linux.c',
'src/core/lib/support/log_posix.c',
- 'src/core/lib/support/log_win32.c',
+ 'src/core/lib/support/log_windows.c',
'src/core/lib/support/murmur_hash.c',
'src/core/lib/support/slice.c',
'src/core/lib/support/slice_buffer.c',
'src/core/lib/support/stack_lockfree.c',
'src/core/lib/support/string.c',
'src/core/lib/support/string_posix.c',
- 'src/core/lib/support/string_win32.c',
+ 'src/core/lib/support/string_windows.c',
'src/core/lib/support/subprocess_posix.c',
'src/core/lib/support/subprocess_windows.c',
'src/core/lib/support/sync.c',
'src/core/lib/support/sync_posix.c',
- 'src/core/lib/support/sync_win32.c',
+ 'src/core/lib/support/sync_windows.c',
'src/core/lib/support/thd.c',
'src/core/lib/support/thd_posix.c',
- 'src/core/lib/support/thd_win32.c',
+ 'src/core/lib/support/thd_windows.c',
'src/core/lib/support/time.c',
'src/core/lib/support/time_posix.c',
'src/core/lib/support/time_precise.c',
- 'src/core/lib/support/time_win32.c',
+ 'src/core/lib/support/time_windows.c',
'src/core/lib/support/tls_pthread.c',
'src/core/lib/support/tmpfile_posix.c',
- 'src/core/lib/support/tmpfile_win32.c',
+ 'src/core/lib/support/tmpfile_windows.c',
'src/core/lib/support/wrap_memcpy.c',
],
"conditions": [
@@ -672,7 +672,7 @@
'src/core/lib/security/credentials.c',
'src/core/lib/security/credentials_metadata.c',
'src/core/lib/security/credentials_posix.c',
- 'src/core/lib/security/credentials_win32.c',
+ 'src/core/lib/security/credentials_windows.c',
'src/core/lib/security/google_default_credentials.c',
'src/core/lib/security/handshake.c',
'src/core/lib/security/json_token.c',
diff --git a/build.yaml b/build.yaml
index 6c00b42a1e7e6..9620416a58800 100644
--- a/build.yaml
+++ b/build.yaml
@@ -38,14 +38,14 @@ filegroups:
- include/grpc/support/atm.h
- include/grpc/support/atm_gcc_atomic.h
- include/grpc/support/atm_gcc_sync.h
- - include/grpc/support/atm_win32.h
+ - include/grpc/support/atm_windows.h
- include/grpc/support/avl.h
- include/grpc/support/cmdline.h
- include/grpc/support/cpu.h
- include/grpc/support/histogram.h
- include/grpc/support/host_port.h
- include/grpc/support/log.h
- - include/grpc/support/log_win32.h
+ - include/grpc/support/log_windows.h
- include/grpc/support/port_platform.h
- include/grpc/support/slice.h
- include/grpc/support/slice_buffer.h
@@ -54,7 +54,7 @@ filegroups:
- include/grpc/support/sync.h
- include/grpc/support/sync_generic.h
- include/grpc/support/sync_posix.h
- - include/grpc/support/sync_win32.h
+ - include/grpc/support/sync_windows.h
- include/grpc/support/thd.h
- include/grpc/support/time.h
- include/grpc/support/tls.h
@@ -71,7 +71,7 @@ filegroups:
- src/core/lib/support/murmur_hash.h
- src/core/lib/support/stack_lockfree.h
- src/core/lib/support/string.h
- - src/core/lib/support/string_win32.h
+ - src/core/lib/support/string_windows.h
- src/core/lib/support/thd_internal.h
- src/core/lib/support/time_precise.h
- src/core/lib/support/tmpfile.h
@@ -88,7 +88,7 @@ filegroups:
- src/core/lib/support/cpu_windows.c
- src/core/lib/support/env_linux.c
- src/core/lib/support/env_posix.c
- - src/core/lib/support/env_win32.c
+ - src/core/lib/support/env_windows.c
- src/core/lib/support/histogram.c
- src/core/lib/support/host_port.c
- src/core/lib/support/load_file.c
@@ -96,29 +96,29 @@ filegroups:
- src/core/lib/support/log_android.c
- src/core/lib/support/log_linux.c
- src/core/lib/support/log_posix.c
- - src/core/lib/support/log_win32.c
+ - src/core/lib/support/log_windows.c
- src/core/lib/support/murmur_hash.c
- src/core/lib/support/slice.c
- src/core/lib/support/slice_buffer.c
- src/core/lib/support/stack_lockfree.c
- src/core/lib/support/string.c
- src/core/lib/support/string_posix.c
- - src/core/lib/support/string_win32.c
+ - src/core/lib/support/string_windows.c
- src/core/lib/support/subprocess_posix.c
- src/core/lib/support/subprocess_windows.c
- src/core/lib/support/sync.c
- src/core/lib/support/sync_posix.c
- - src/core/lib/support/sync_win32.c
+ - src/core/lib/support/sync_windows.c
- src/core/lib/support/thd.c
- src/core/lib/support/thd_posix.c
- - src/core/lib/support/thd_win32.c
+ - src/core/lib/support/thd_windows.c
- src/core/lib/support/time.c
- src/core/lib/support/time_posix.c
- src/core/lib/support/time_precise.c
- - src/core/lib/support/time_win32.c
+ - src/core/lib/support/time_windows.c
- src/core/lib/support/tls_pthread.c
- src/core/lib/support/tmpfile_posix.c
- - src/core/lib/support/tmpfile_win32.c
+ - src/core/lib/support/tmpfile_windows.c
- src/core/lib/support/wrap_memcpy.c
uses:
- gpr_codegen
@@ -128,7 +128,7 @@ filegroups:
- include/grpc/impl/codegen/atm.h
- include/grpc/impl/codegen/atm_gcc_atomic.h
- include/grpc/impl/codegen/atm_gcc_sync.h
- - include/grpc/impl/codegen/atm_win32.h
+ - include/grpc/impl/codegen/atm_windows.h
- include/grpc/impl/codegen/log.h
- include/grpc/impl/codegen/port_platform.h
- include/grpc/impl/codegen/slice.h
@@ -136,7 +136,7 @@ filegroups:
- include/grpc/impl/codegen/sync.h
- include/grpc/impl/codegen/sync_generic.h
- include/grpc/impl/codegen/sync_posix.h
- - include/grpc/impl/codegen/sync_win32.h
+ - include/grpc/impl/codegen/sync_windows.h
- include/grpc/impl/codegen/time.h
- name: grpc_base
public_headers:
@@ -179,7 +179,7 @@ filegroups:
- src/core/lib/iomgr/sockaddr.h
- src/core/lib/iomgr/sockaddr_posix.h
- src/core/lib/iomgr/sockaddr_utils.h
- - src/core/lib/iomgr/sockaddr_win32.h
+ - src/core/lib/iomgr/sockaddr_windows.h
- src/core/lib/iomgr/socket_utils_posix.h
- src/core/lib/iomgr/socket_windows.h
- src/core/lib/iomgr/tcp_client.h
@@ -416,7 +416,7 @@ filegroups:
- src/core/lib/security/credentials.c
- src/core/lib/security/credentials_metadata.c
- src/core/lib/security/credentials_posix.c
- - src/core/lib/security/credentials_win32.c
+ - src/core/lib/security/credentials_windows.c
- src/core/lib/security/google_default_credentials.c
- src/core/lib/security/handshake.c
- src/core/lib/security/json_token.c
diff --git a/config.m4 b/config.m4
index 2d930a648e17e..02798a8fedb31 100644
--- a/config.m4
+++ b/config.m4
@@ -48,7 +48,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/support/cpu_windows.c \
src/core/lib/support/env_linux.c \
src/core/lib/support/env_posix.c \
- src/core/lib/support/env_win32.c \
+ src/core/lib/support/env_windows.c \
src/core/lib/support/histogram.c \
src/core/lib/support/host_port.c \
src/core/lib/support/load_file.c \
@@ -56,29 +56,29 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/support/log_android.c \
src/core/lib/support/log_linux.c \
src/core/lib/support/log_posix.c \
- src/core/lib/support/log_win32.c \
+ src/core/lib/support/log_windows.c \
src/core/lib/support/murmur_hash.c \
src/core/lib/support/slice.c \
src/core/lib/support/slice_buffer.c \
src/core/lib/support/stack_lockfree.c \
src/core/lib/support/string.c \
src/core/lib/support/string_posix.c \
- src/core/lib/support/string_win32.c \
+ src/core/lib/support/string_windows.c \
src/core/lib/support/subprocess_posix.c \
src/core/lib/support/subprocess_windows.c \
src/core/lib/support/sync.c \
src/core/lib/support/sync_posix.c \
- src/core/lib/support/sync_win32.c \
+ src/core/lib/support/sync_windows.c \
src/core/lib/support/thd.c \
src/core/lib/support/thd_posix.c \
- src/core/lib/support/thd_win32.c \
+ src/core/lib/support/thd_windows.c \
src/core/lib/support/time.c \
src/core/lib/support/time_posix.c \
src/core/lib/support/time_precise.c \
- src/core/lib/support/time_win32.c \
+ src/core/lib/support/time_windows.c \
src/core/lib/support/tls_pthread.c \
src/core/lib/support/tmpfile_posix.c \
- src/core/lib/support/tmpfile_win32.c \
+ src/core/lib/support/tmpfile_windows.c \
src/core/lib/support/wrap_memcpy.c \
src/core/lib/surface/init.c \
src/core/lib/channel/channel_args.c \
@@ -191,7 +191,7 @@ if test "$PHP_GRPC" != "no"; then
src/core/lib/security/credentials.c \
src/core/lib/security/credentials_metadata.c \
src/core/lib/security/credentials_posix.c \
- src/core/lib/security/credentials_win32.c \
+ src/core/lib/security/credentials_windows.c \
src/core/lib/security/google_default_credentials.c \
src/core/lib/security/handshake.c \
src/core/lib/security/json_token.c \
diff --git a/gRPC.podspec b/gRPC.podspec
index d66e03354bba9..b63112ffbbb38 100644
--- a/gRPC.podspec
+++ b/gRPC.podspec
@@ -71,7 +71,7 @@ Pod::Spec.new do |s|
'src/core/lib/support/murmur_hash.h',
'src/core/lib/support/stack_lockfree.h',
'src/core/lib/support/string.h',
- 'src/core/lib/support/string_win32.h',
+ 'src/core/lib/support/string_windows.h',
'src/core/lib/support/thd_internal.h',
'src/core/lib/support/time_precise.h',
'src/core/lib/support/tmpfile.h',
@@ -79,14 +79,14 @@ Pod::Spec.new do |s|
'include/grpc/support/atm.h',
'include/grpc/support/atm_gcc_atomic.h',
'include/grpc/support/atm_gcc_sync.h',
- 'include/grpc/support/atm_win32.h',
+ 'include/grpc/support/atm_windows.h',
'include/grpc/support/avl.h',
'include/grpc/support/cmdline.h',
'include/grpc/support/cpu.h',
'include/grpc/support/histogram.h',
'include/grpc/support/host_port.h',
'include/grpc/support/log.h',
- 'include/grpc/support/log_win32.h',
+ 'include/grpc/support/log_windows.h',
'include/grpc/support/port_platform.h',
'include/grpc/support/slice.h',
'include/grpc/support/slice_buffer.h',
@@ -95,7 +95,7 @@ Pod::Spec.new do |s|
'include/grpc/support/sync.h',
'include/grpc/support/sync_generic.h',
'include/grpc/support/sync_posix.h',
- 'include/grpc/support/sync_win32.h',
+ 'include/grpc/support/sync_windows.h',
'include/grpc/support/thd.h',
'include/grpc/support/time.h',
'include/grpc/support/tls.h',
@@ -107,7 +107,7 @@ Pod::Spec.new do |s|
'include/grpc/impl/codegen/atm.h',
'include/grpc/impl/codegen/atm_gcc_atomic.h',
'include/grpc/impl/codegen/atm_gcc_sync.h',
- 'include/grpc/impl/codegen/atm_win32.h',
+ 'include/grpc/impl/codegen/atm_windows.h',
'include/grpc/impl/codegen/log.h',
'include/grpc/impl/codegen/port_platform.h',
'include/grpc/impl/codegen/slice.h',
@@ -115,7 +115,7 @@ Pod::Spec.new do |s|
'include/grpc/impl/codegen/sync.h',
'include/grpc/impl/codegen/sync_generic.h',
'include/grpc/impl/codegen/sync_posix.h',
- 'include/grpc/impl/codegen/sync_win32.h',
+ 'include/grpc/impl/codegen/sync_windows.h',
'include/grpc/impl/codegen/time.h',
'src/core/lib/profiling/basic_timers.c',
'src/core/lib/profiling/stap_timers.c',
@@ -129,7 +129,7 @@ Pod::Spec.new do |s|
'src/core/lib/support/cpu_windows.c',
'src/core/lib/support/env_linux.c',
'src/core/lib/support/env_posix.c',
- 'src/core/lib/support/env_win32.c',
+ 'src/core/lib/support/env_windows.c',
'src/core/lib/support/histogram.c',
'src/core/lib/support/host_port.c',
'src/core/lib/support/load_file.c',
@@ -137,29 +137,29 @@ Pod::Spec.new do |s|
'src/core/lib/support/log_android.c',
'src/core/lib/support/log_linux.c',
'src/core/lib/support/log_posix.c',
- 'src/core/lib/support/log_win32.c',
+ 'src/core/lib/support/log_windows.c',
'src/core/lib/support/murmur_hash.c',
'src/core/lib/support/slice.c',
'src/core/lib/support/slice_buffer.c',
'src/core/lib/support/stack_lockfree.c',
'src/core/lib/support/string.c',
'src/core/lib/support/string_posix.c',
- 'src/core/lib/support/string_win32.c',
+ 'src/core/lib/support/string_windows.c',
'src/core/lib/support/subprocess_posix.c',
'src/core/lib/support/subprocess_windows.c',
'src/core/lib/support/sync.c',
'src/core/lib/support/sync_posix.c',
- 'src/core/lib/support/sync_win32.c',
+ 'src/core/lib/support/sync_windows.c',
'src/core/lib/support/thd.c',
'src/core/lib/support/thd_posix.c',
- 'src/core/lib/support/thd_win32.c',
+ 'src/core/lib/support/thd_windows.c',
'src/core/lib/support/time.c',
'src/core/lib/support/time_posix.c',
'src/core/lib/support/time_precise.c',
- 'src/core/lib/support/time_win32.c',
+ 'src/core/lib/support/time_windows.c',
'src/core/lib/support/tls_pthread.c',
'src/core/lib/support/tmpfile_posix.c',
- 'src/core/lib/support/tmpfile_win32.c',
+ 'src/core/lib/support/tmpfile_windows.c',
'src/core/lib/support/wrap_memcpy.c',
'src/core/lib/channel/channel_args.h',
'src/core/lib/channel/channel_stack.h',
@@ -194,7 +194,7 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/sockaddr.h',
'src/core/lib/iomgr/sockaddr_posix.h',
'src/core/lib/iomgr/sockaddr_utils.h',
- 'src/core/lib/iomgr/sockaddr_win32.h',
+ 'src/core/lib/iomgr/sockaddr_windows.h',
'src/core/lib/iomgr/socket_utils_posix.h',
'src/core/lib/iomgr/socket_windows.h',
'src/core/lib/iomgr/tcp_client.h',
@@ -312,7 +312,7 @@ Pod::Spec.new do |s|
'include/grpc/impl/codegen/atm.h',
'include/grpc/impl/codegen/atm_gcc_atomic.h',
'include/grpc/impl/codegen/atm_gcc_sync.h',
- 'include/grpc/impl/codegen/atm_win32.h',
+ 'include/grpc/impl/codegen/atm_windows.h',
'include/grpc/impl/codegen/log.h',
'include/grpc/impl/codegen/port_platform.h',
'include/grpc/impl/codegen/slice.h',
@@ -320,7 +320,7 @@ Pod::Spec.new do |s|
'include/grpc/impl/codegen/sync.h',
'include/grpc/impl/codegen/sync_generic.h',
'include/grpc/impl/codegen/sync_posix.h',
- 'include/grpc/impl/codegen/sync_win32.h',
+ 'include/grpc/impl/codegen/sync_windows.h',
'include/grpc/impl/codegen/time.h',
'include/grpc/grpc_security.h',
'include/grpc/grpc_security_constants.h',
@@ -436,7 +436,7 @@ Pod::Spec.new do |s|
'src/core/lib/security/credentials.c',
'src/core/lib/security/credentials_metadata.c',
'src/core/lib/security/credentials_posix.c',
- 'src/core/lib/security/credentials_win32.c',
+ 'src/core/lib/security/credentials_windows.c',
'src/core/lib/security/google_default_credentials.c',
'src/core/lib/security/handshake.c',
'src/core/lib/security/json_token.c',
@@ -499,7 +499,7 @@ Pod::Spec.new do |s|
'src/core/lib/support/murmur_hash.h',
'src/core/lib/support/stack_lockfree.h',
'src/core/lib/support/string.h',
- 'src/core/lib/support/string_win32.h',
+ 'src/core/lib/support/string_windows.h',
'src/core/lib/support/thd_internal.h',
'src/core/lib/support/time_precise.h',
'src/core/lib/support/tmpfile.h',
@@ -536,7 +536,7 @@ Pod::Spec.new do |s|
'src/core/lib/iomgr/sockaddr.h',
'src/core/lib/iomgr/sockaddr_posix.h',
'src/core/lib/iomgr/sockaddr_utils.h',
- 'src/core/lib/iomgr/sockaddr_win32.h',
+ 'src/core/lib/iomgr/sockaddr_windows.h',
'src/core/lib/iomgr/socket_utils_posix.h',
'src/core/lib/iomgr/socket_windows.h',
'src/core/lib/iomgr/tcp_client.h',
diff --git a/grpc.gemspec b/grpc.gemspec
index a9f0f681df010..ddc828b34e49b 100755
--- a/grpc.gemspec
+++ b/grpc.gemspec
@@ -47,14 +47,14 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/support/atm.h )
s.files += %w( include/grpc/support/atm_gcc_atomic.h )
s.files += %w( include/grpc/support/atm_gcc_sync.h )
- s.files += %w( include/grpc/support/atm_win32.h )
+ s.files += %w( include/grpc/support/atm_windows.h )
s.files += %w( include/grpc/support/avl.h )
s.files += %w( include/grpc/support/cmdline.h )
s.files += %w( include/grpc/support/cpu.h )
s.files += %w( include/grpc/support/histogram.h )
s.files += %w( include/grpc/support/host_port.h )
s.files += %w( include/grpc/support/log.h )
- s.files += %w( include/grpc/support/log_win32.h )
+ s.files += %w( include/grpc/support/log_windows.h )
s.files += %w( include/grpc/support/port_platform.h )
s.files += %w( include/grpc/support/slice.h )
s.files += %w( include/grpc/support/slice_buffer.h )
@@ -63,7 +63,7 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/support/sync.h )
s.files += %w( include/grpc/support/sync_generic.h )
s.files += %w( include/grpc/support/sync_posix.h )
- s.files += %w( include/grpc/support/sync_win32.h )
+ s.files += %w( include/grpc/support/sync_windows.h )
s.files += %w( include/grpc/support/thd.h )
s.files += %w( include/grpc/support/time.h )
s.files += %w( include/grpc/support/tls.h )
@@ -75,7 +75,7 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/impl/codegen/atm.h )
s.files += %w( include/grpc/impl/codegen/atm_gcc_atomic.h )
s.files += %w( include/grpc/impl/codegen/atm_gcc_sync.h )
- s.files += %w( include/grpc/impl/codegen/atm_win32.h )
+ s.files += %w( include/grpc/impl/codegen/atm_windows.h )
s.files += %w( include/grpc/impl/codegen/log.h )
s.files += %w( include/grpc/impl/codegen/port_platform.h )
s.files += %w( include/grpc/impl/codegen/slice.h )
@@ -83,7 +83,7 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/impl/codegen/sync.h )
s.files += %w( include/grpc/impl/codegen/sync_generic.h )
s.files += %w( include/grpc/impl/codegen/sync_posix.h )
- s.files += %w( include/grpc/impl/codegen/sync_win32.h )
+ s.files += %w( include/grpc/impl/codegen/sync_windows.h )
s.files += %w( include/grpc/impl/codegen/time.h )
s.files += %w( src/core/lib/profiling/timers.h )
s.files += %w( src/core/lib/support/backoff.h )
@@ -93,7 +93,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/support/murmur_hash.h )
s.files += %w( src/core/lib/support/stack_lockfree.h )
s.files += %w( src/core/lib/support/string.h )
- s.files += %w( src/core/lib/support/string_win32.h )
+ s.files += %w( src/core/lib/support/string_windows.h )
s.files += %w( src/core/lib/support/thd_internal.h )
s.files += %w( src/core/lib/support/time_precise.h )
s.files += %w( src/core/lib/support/tmpfile.h )
@@ -109,7 +109,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/support/cpu_windows.c )
s.files += %w( src/core/lib/support/env_linux.c )
s.files += %w( src/core/lib/support/env_posix.c )
- s.files += %w( src/core/lib/support/env_win32.c )
+ s.files += %w( src/core/lib/support/env_windows.c )
s.files += %w( src/core/lib/support/histogram.c )
s.files += %w( src/core/lib/support/host_port.c )
s.files += %w( src/core/lib/support/load_file.c )
@@ -117,29 +117,29 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/support/log_android.c )
s.files += %w( src/core/lib/support/log_linux.c )
s.files += %w( src/core/lib/support/log_posix.c )
- s.files += %w( src/core/lib/support/log_win32.c )
+ s.files += %w( src/core/lib/support/log_windows.c )
s.files += %w( src/core/lib/support/murmur_hash.c )
s.files += %w( src/core/lib/support/slice.c )
s.files += %w( src/core/lib/support/slice_buffer.c )
s.files += %w( src/core/lib/support/stack_lockfree.c )
s.files += %w( src/core/lib/support/string.c )
s.files += %w( src/core/lib/support/string_posix.c )
- s.files += %w( src/core/lib/support/string_win32.c )
+ s.files += %w( src/core/lib/support/string_windows.c )
s.files += %w( src/core/lib/support/subprocess_posix.c )
s.files += %w( src/core/lib/support/subprocess_windows.c )
s.files += %w( src/core/lib/support/sync.c )
s.files += %w( src/core/lib/support/sync_posix.c )
- s.files += %w( src/core/lib/support/sync_win32.c )
+ s.files += %w( src/core/lib/support/sync_windows.c )
s.files += %w( src/core/lib/support/thd.c )
s.files += %w( src/core/lib/support/thd_posix.c )
- s.files += %w( src/core/lib/support/thd_win32.c )
+ s.files += %w( src/core/lib/support/thd_windows.c )
s.files += %w( src/core/lib/support/time.c )
s.files += %w( src/core/lib/support/time_posix.c )
s.files += %w( src/core/lib/support/time_precise.c )
- s.files += %w( src/core/lib/support/time_win32.c )
+ s.files += %w( src/core/lib/support/time_windows.c )
s.files += %w( src/core/lib/support/tls_pthread.c )
s.files += %w( src/core/lib/support/tmpfile_posix.c )
- s.files += %w( src/core/lib/support/tmpfile_win32.c )
+ s.files += %w( src/core/lib/support/tmpfile_windows.c )
s.files += %w( src/core/lib/support/wrap_memcpy.c )
s.files += %w( include/grpc/byte_buffer.h )
s.files += %w( include/grpc/byte_buffer_reader.h )
@@ -156,7 +156,7 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/impl/codegen/atm.h )
s.files += %w( include/grpc/impl/codegen/atm_gcc_atomic.h )
s.files += %w( include/grpc/impl/codegen/atm_gcc_sync.h )
- s.files += %w( include/grpc/impl/codegen/atm_win32.h )
+ s.files += %w( include/grpc/impl/codegen/atm_windows.h )
s.files += %w( include/grpc/impl/codegen/log.h )
s.files += %w( include/grpc/impl/codegen/port_platform.h )
s.files += %w( include/grpc/impl/codegen/slice.h )
@@ -164,7 +164,7 @@ Gem::Specification.new do |s|
s.files += %w( include/grpc/impl/codegen/sync.h )
s.files += %w( include/grpc/impl/codegen/sync_generic.h )
s.files += %w( include/grpc/impl/codegen/sync_posix.h )
- s.files += %w( include/grpc/impl/codegen/sync_win32.h )
+ s.files += %w( include/grpc/impl/codegen/sync_windows.h )
s.files += %w( include/grpc/impl/codegen/time.h )
s.files += %w( include/grpc/grpc_security.h )
s.files += %w( include/grpc/grpc_security_constants.h )
@@ -202,7 +202,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/iomgr/sockaddr.h )
s.files += %w( src/core/lib/iomgr/sockaddr_posix.h )
s.files += %w( src/core/lib/iomgr/sockaddr_utils.h )
- s.files += %w( src/core/lib/iomgr/sockaddr_win32.h )
+ s.files += %w( src/core/lib/iomgr/sockaddr_windows.h )
s.files += %w( src/core/lib/iomgr/socket_utils_posix.h )
s.files += %w( src/core/lib/iomgr/socket_windows.h )
s.files += %w( src/core/lib/iomgr/tcp_client.h )
@@ -416,7 +416,7 @@ Gem::Specification.new do |s|
s.files += %w( src/core/lib/security/credentials.c )
s.files += %w( src/core/lib/security/credentials_metadata.c )
s.files += %w( src/core/lib/security/credentials_posix.c )
- s.files += %w( src/core/lib/security/credentials_win32.c )
+ s.files += %w( src/core/lib/security/credentials_windows.c )
s.files += %w( src/core/lib/security/google_default_credentials.c )
s.files += %w( src/core/lib/security/handshake.c )
s.files += %w( src/core/lib/security/json_token.c )
diff --git a/include/grpc/impl/codegen/atm.h b/include/grpc/impl/codegen/atm.h
index 5376026dde2ef..5589d5d41196e 100644
--- a/include/grpc/impl/codegen/atm.h
+++ b/include/grpc/impl/codegen/atm.h
@@ -83,8 +83,8 @@
#include
#elif defined(GPR_GCC_SYNC)
#include
-#elif defined(GPR_WIN32_ATOMIC)
-#include
+#elif defined(GPR_WINDOWS_ATOMIC)
+#include
#else
#error could not determine platform for atm
#endif
diff --git a/include/grpc/impl/codegen/atm_win32.h b/include/grpc/impl/codegen/atm_windows.h
similarity index 97%
rename from include/grpc/impl/codegen/atm_win32.h
rename to include/grpc/impl/codegen/atm_windows.h
index 7c1ccaf8e2081..d5fa8c0f62352 100644
--- a/include/grpc/impl/codegen/atm_win32.h
+++ b/include/grpc/impl/codegen/atm_windows.h
@@ -31,8 +31,8 @@
*
*/
-#ifndef GRPC_IMPL_CODEGEN_ATM_WIN32_H
-#define GRPC_IMPL_CODEGEN_ATM_WIN32_H
+#ifndef GRPC_IMPL_CODEGEN_ATM_WINDOWS_H
+#define GRPC_IMPL_CODEGEN_ATM_WINDOWS_H
/* Win32 variant of atm_platform.h */
#include
@@ -122,4 +122,4 @@ static __inline gpr_atm gpr_atm_full_fetch_add(gpr_atm *p, gpr_atm delta) {
return old;
}
-#endif /* GRPC_IMPL_CODEGEN_ATM_WIN32_H */
+#endif /* GRPC_IMPL_CODEGEN_ATM_WINDOWS_H */
diff --git a/include/grpc/impl/codegen/port_platform.h b/include/grpc/impl/codegen/port_platform.h
index 3242f07599be6..b21a1120f11c9 100644
--- a/include/grpc/impl/codegen/port_platform.h
+++ b/include/grpc/impl/codegen/port_platform.h
@@ -84,7 +84,7 @@
#if !defined(GPR_NO_AUTODETECT_PLATFORM)
#if defined(_WIN64) || defined(WIN64)
#define GPR_PLATFORM_STRING "windows"
-#define GPR_WIN32 1
+#define GPR_WINDOWS 1
#define GPR_ARCH_64 1
#define GPR_GETPID_IN_PROCESS_H 1
#define GPR_WINSOCK_SOCKET 1
@@ -93,14 +93,14 @@
#define GPR_GCC_ATOMIC 1
#define GPR_GCC_TLS 1
#else
-#define GPR_WIN32_ATOMIC 1
+#define GPR_WINDOWS_ATOMIC 1
#define GPR_MSVC_TLS 1
#endif
#define GPR_WINDOWS_CRASH_HANDLER 1
#elif defined(_WIN32) || defined(WIN32)
#define GPR_PLATFORM_STRING "windows"
#define GPR_ARCH_32 1
-#define GPR_WIN32 1
+#define GPR_WINDOWS 1
#define GPR_GETPID_IN_PROCESS_H 1
#define GPR_WINSOCK_SOCKET 1
#define GPR_WINDOWS_SUBPROCESS 1
@@ -108,7 +108,7 @@
#define GPR_GCC_ATOMIC 1
#define GPR_GCC_TLS 1
#else
-#define GPR_WIN32_ATOMIC 1
+#define GPR_WINDOWS_ATOMIC 1
#define GPR_MSVC_TLS 1
#endif
#define GPR_WINDOWS_CRASH_HANDLER 1
@@ -345,19 +345,19 @@ typedef unsigned __int64 uint64_t;
/* Validate platform combinations */
#if defined(GPR_GCC_ATOMIC) + defined(GPR_GCC_SYNC) + \
- defined(GPR_WIN32_ATOMIC) != \
+ defined(GPR_WINDOWS_ATOMIC) != \
1
-#error Must define exactly one of GPR_GCC_ATOMIC, GPR_GCC_SYNC, GPR_WIN32_ATOMIC
+#error Must define exactly one of GPR_GCC_ATOMIC, GPR_GCC_SYNC, GPR_WINDOWS_ATOMIC
#endif
#if defined(GPR_ARCH_32) + defined(GPR_ARCH_64) != 1
#error Must define exactly one of GPR_ARCH_32, GPR_ARCH_64
#endif
-#if defined(GPR_CPU_LINUX) + defined(GPR_CPU_POSIX) + defined(GPR_WIN32) + \
+#if defined(GPR_CPU_LINUX) + defined(GPR_CPU_POSIX) + defined(GPR_WINDOWS) + \
defined(GPR_CPU_IPHONE) + defined(GPR_CPU_CUSTOM) != \
1
-#error Must define exactly one of GPR_CPU_LINUX, GPR_CPU_POSIX, GPR_WIN32, GPR_CPU_IPHONE, GPR_CPU_CUSTOM
+#error Must define exactly one of GPR_CPU_LINUX, GPR_CPU_POSIX, GPR_WINDOWS, GPR_CPU_IPHONE, GPR_CPU_CUSTOM
#endif
#if defined(GPR_POSIX_MULTIPOLL_WITH_POLL) && !defined(GPR_POSIX_SOCKET)
diff --git a/include/grpc/impl/codegen/sync.h b/include/grpc/impl/codegen/sync.h
index 6fd7d64b299ba..5542482ed8088 100644
--- a/include/grpc/impl/codegen/sync.h
+++ b/include/grpc/impl/codegen/sync.h
@@ -58,8 +58,8 @@
#if defined(GPR_POSIX_SYNC)
#include
-#elif defined(GPR_WIN32)
-#include
+#elif defined(GPR_WINDOWS)
+#include
#elif !defined(GPR_CUSTOM_SYNC)
#error Unable to determine platform for sync
#endif
diff --git a/include/grpc/impl/codegen/sync_win32.h b/include/grpc/impl/codegen/sync_windows.h
similarity index 93%
rename from include/grpc/impl/codegen/sync_win32.h
rename to include/grpc/impl/codegen/sync_windows.h
index bdc43dd99a3d0..aa4e5153da731 100644
--- a/include/grpc/impl/codegen/sync_win32.h
+++ b/include/grpc/impl/codegen/sync_windows.h
@@ -31,8 +31,8 @@
*
*/
-#ifndef GRPC_IMPL_CODEGEN_SYNC_WIN32_H
-#define GRPC_IMPL_CODEGEN_SYNC_WIN32_H
+#ifndef GRPC_IMPL_CODEGEN_SYNC_WINDOWS_H
+#define GRPC_IMPL_CODEGEN_SYNC_WINDOWS_H
#include
@@ -46,4 +46,4 @@ typedef CONDITION_VARIABLE gpr_cv;
typedef INIT_ONCE gpr_once;
#define GPR_ONCE_INIT INIT_ONCE_STATIC_INIT
-#endif /* GRPC_IMPL_CODEGEN_SYNC_WIN32_H */
+#endif /* GRPC_IMPL_CODEGEN_SYNC_WINDOWS_H */
diff --git a/include/grpc/support/sync_win32.h b/include/grpc/support/atm_windows.h
similarity index 91%
rename from include/grpc/support/sync_win32.h
rename to include/grpc/support/atm_windows.h
index 5631c52974467..6aec5b7212876 100644
--- a/include/grpc/support/sync_win32.h
+++ b/include/grpc/support/atm_windows.h
@@ -31,9 +31,9 @@
*
*/
-#ifndef GRPC_SUPPORT_SYNC_WIN32_H
-#define GRPC_SUPPORT_SYNC_WIN32_H
+#ifndef GRPC_SUPPORT_ATM_WINDOWS_H
+#define GRPC_SUPPORT_ATM_WINDOWS_H
-#include
+#include
-#endif /* GRPC_SUPPORT_SYNC_WIN32_H */
+#endif /* GRPC_SUPPORT_ATM_WINDOWS_H */
diff --git a/include/grpc/support/log_win32.h b/include/grpc/support/log_windows.h
similarity index 94%
rename from include/grpc/support/log_win32.h
rename to include/grpc/support/log_windows.h
index e5c25e06fc7f4..12bf8cc1f5ece 100644
--- a/include/grpc/support/log_win32.h
+++ b/include/grpc/support/log_windows.h
@@ -31,8 +31,8 @@
*
*/
-#ifndef GRPC_SUPPORT_LOG_WIN32_H
-#define GRPC_SUPPORT_LOG_WIN32_H
+#ifndef GRPC_SUPPORT_LOG_WINDOWS_H
+#define GRPC_SUPPORT_LOG_WINDOWS_H
#ifdef __cplusplus
extern "C" {
@@ -48,4 +48,4 @@ GPRAPI char *gpr_format_message(int messageid);
}
#endif
-#endif /* GRPC_SUPPORT_LOG_WIN32_H */
+#endif /* GRPC_SUPPORT_LOG_WINDOWS_H */
diff --git a/include/grpc/support/atm_win32.h b/include/grpc/support/sync_windows.h
similarity index 90%
rename from include/grpc/support/atm_win32.h
rename to include/grpc/support/sync_windows.h
index 13526d9f3e34b..0624e0c3b5ce8 100644
--- a/include/grpc/support/atm_win32.h
+++ b/include/grpc/support/sync_windows.h
@@ -31,9 +31,9 @@
*
*/
-#ifndef GRPC_SUPPORT_ATM_WIN32_H
-#define GRPC_SUPPORT_ATM_WIN32_H
+#ifndef GRPC_SUPPORT_SYNC_WINDOWS_H
+#define GRPC_SUPPORT_SYNC_WINDOWS_H
-#include
+#include
-#endif /* GRPC_SUPPORT_ATM_WIN32_H */
+#endif /* GRPC_SUPPORT_SYNC_WINDOWS_H */
diff --git a/package.xml b/package.xml
index 3ae810df5eb11..ec54030a5c675 100644
--- a/package.xml
+++ b/package.xml
@@ -54,14 +54,14 @@
-
+
-
+
@@ -70,7 +70,7 @@
-
+
@@ -82,7 +82,7 @@
-
+
@@ -90,7 +90,7 @@
-
+
@@ -100,7 +100,7 @@
-
+
@@ -116,7 +116,7 @@
-
+
@@ -124,29 +124,29 @@
-
+
-
+
-
+
-
+
-
+
-
+
@@ -163,7 +163,7 @@
-
+
@@ -171,7 +171,7 @@
-
+
@@ -209,7 +209,7 @@
-
+
@@ -423,7 +423,7 @@
-
+
diff --git a/src/core/lib/iomgr/iocp_windows.c b/src/core/lib/iomgr/iocp_windows.c
index d46558ab1b1c7..708232295e93e 100644
--- a/src/core/lib/iomgr/iocp_windows.c
+++ b/src/core/lib/iomgr/iocp_windows.c
@@ -39,7 +39,7 @@
#include
#include
-#include
+#include
#include
#include "src/core/lib/iomgr/iocp_windows.h"
diff --git a/src/core/lib/iomgr/iomgr_windows.c b/src/core/lib/iomgr/iomgr_windows.c
index 398517fc7595f..7653f6e6354fe 100644
--- a/src/core/lib/iomgr/iomgr_windows.c
+++ b/src/core/lib/iomgr/iomgr_windows.c
@@ -35,7 +35,7 @@
#ifdef GPR_WINSOCK_SOCKET
-#include "src/core/lib/iomgr/sockaddr_win32.h"
+#include "src/core/lib/iomgr/sockaddr_windows.h"
#include
diff --git a/src/core/lib/iomgr/resolve_address_windows.c b/src/core/lib/iomgr/resolve_address_windows.c
index 914736234da87..c1bbb3db6b3e2 100644
--- a/src/core/lib/iomgr/resolve_address_windows.c
+++ b/src/core/lib/iomgr/resolve_address_windows.c
@@ -43,7 +43,7 @@
#include
#include
#include
-#include
+#include
#include
#include
#include
diff --git a/src/core/lib/iomgr/sockaddr.h b/src/core/lib/iomgr/sockaddr.h
index 891a2f094f507..5563d0b8a6c74 100644
--- a/src/core/lib/iomgr/sockaddr.h
+++ b/src/core/lib/iomgr/sockaddr.h
@@ -36,8 +36,8 @@
#include
-#ifdef GPR_WIN32
-#include "src/core/lib/iomgr/sockaddr_win32.h"
+#ifdef GPR_WINDOWS
+#include "src/core/lib/iomgr/sockaddr_windows.h"
#endif
#ifdef GPR_POSIX_SOCKETADDR
diff --git a/src/core/lib/iomgr/sockaddr_win32.h b/src/core/lib/iomgr/sockaddr_windows.h
similarity index 91%
rename from src/core/lib/iomgr/sockaddr_win32.h
rename to src/core/lib/iomgr/sockaddr_windows.h
index 02aeae761905c..971db5b32b2eb 100644
--- a/src/core/lib/iomgr/sockaddr_win32.h
+++ b/src/core/lib/iomgr/sockaddr_windows.h
@@ -31,8 +31,8 @@
*
*/
-#ifndef GRPC_CORE_LIB_IOMGR_SOCKADDR_WIN32_H
-#define GRPC_CORE_LIB_IOMGR_SOCKADDR_WIN32_H
+#ifndef GRPC_CORE_LIB_IOMGR_SOCKADDR_WINDOWS_H
+#define GRPC_CORE_LIB_IOMGR_SOCKADDR_WINDOWS_H
#include
#include
@@ -40,4 +40,4 @@
// must be included after the above
#include
-#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_WIN32_H */
+#endif /* GRPC_CORE_LIB_IOMGR_SOCKADDR_WINDOWS_H */
diff --git a/src/core/lib/iomgr/socket_windows.c b/src/core/lib/iomgr/socket_windows.c
index ebd77e0372409..7d8f9f761d031 100644
--- a/src/core/lib/iomgr/socket_windows.c
+++ b/src/core/lib/iomgr/socket_windows.c
@@ -42,7 +42,7 @@
#include
#include
-#include
+#include
#include
#include "src/core/lib/iomgr/iocp_windows.h"
diff --git a/src/core/lib/iomgr/tcp_client_windows.c b/src/core/lib/iomgr/tcp_client_windows.c
index 7d78beb15ade9..e41f67a04c2d7 100644
--- a/src/core/lib/iomgr/tcp_client_windows.c
+++ b/src/core/lib/iomgr/tcp_client_windows.c
@@ -35,11 +35,11 @@
#ifdef GPR_WINSOCK_SOCKET
-#include "src/core/lib/iomgr/sockaddr_win32.h"
+#include "src/core/lib/iomgr/sockaddr_windows.h"
#include
#include
-#include
+#include
#include
#include