From ddc3ebb6ea694b252c27e149507bec4df427a592 Mon Sep 17 00:00:00 2001 From: yang-g Date: Mon, 13 Jun 2016 10:40:32 -0700 Subject: [PATCH 01/24] add missing language tag --- build.yaml | 11 +++++----- tools/run_tests/sources_and_headers.json | 26 ++++++++++++------------ 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/build.yaml b/build.yaml index a94fb052a5d..8589ba28f8e 100644 --- a/build.yaml +++ b/build.yaml @@ -143,11 +143,6 @@ filegroups: - include/grpc/impl/codegen/sync_posix.h - include/grpc/impl/codegen/sync_windows.h - include/grpc/impl/codegen/time.h -- name: grpc++_codegen_base_src - src: - - src/cpp/codegen/codegen_init.cc - uses: - - grpc++_codegen_base - name: grpc_base public_headers: - include/grpc/byte_buffer.h @@ -747,6 +742,12 @@ filegroups: - include/grpc++/impl/codegen/time.h uses: - grpc_codegen +- name: grpc++_codegen_base_src + language: c++ + src: + - src/cpp/codegen/codegen_init.cc + uses: + - grpc++_codegen_base - name: grpc++_codegen_proto language: c++ public_headers: diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index fd522ee1739..1d73434f3dc 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -5607,19 +5607,6 @@ "third_party": false, "type": "filegroup" }, - { - "deps": [ - "grpc++_codegen_base" - ], - "headers": [], - "language": "c", - "name": "grpc++_codegen_base_src", - "src": [ - "src/cpp/codegen/codegen_init.cc" - ], - "third_party": false, - "type": "filegroup" - }, { "deps": [ "gpr", @@ -6636,6 +6623,19 @@ "third_party": false, "type": "filegroup" }, + { + "deps": [ + "grpc++_codegen_base" + ], + "headers": [], + "language": "c++", + "name": "grpc++_codegen_base_src", + "src": [ + "src/cpp/codegen/codegen_init.cc" + ], + "third_party": false, + "type": "filegroup" + }, { "deps": [ "grpc++_codegen_base", From 9f6a80597771eae74760b23a66737eb8960f8fd7 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Wed, 15 Jun 2016 17:39:03 -0700 Subject: [PATCH 02/24] Allow disabling traces, add trace variables for pluck and timeout events --- BUILD | 4 -- build.yaml | 1 - gRPC.podspec | 2 - grpc.gemspec | 1 - package.xml | 1 - src/core/lib/debug/trace.c | 8 +++- src/core/lib/surface/call.h | 1 - src/core/lib/surface/completion_queue.c | 29 +++++++---- src/core/lib/surface/completion_queue.h | 3 ++ src/core/lib/surface/init.c | 7 ++- src/core/lib/surface/surface_trace.h | 48 ------------------- tools/doxygen/Doxyfile.core.internal | 1 - tools/run_tests/sources_and_headers.json | 2 - vsprojects/vcxproj/grpc/grpc.vcxproj | 1 - vsprojects/vcxproj/grpc/grpc.vcxproj.filters | 3 -- .../grpc_unsecure/grpc_unsecure.vcxproj | 1 - .../grpc_unsecure.vcxproj.filters | 3 -- 17 files changed, 36 insertions(+), 80 deletions(-) delete mode 100644 src/core/lib/surface/surface_trace.h diff --git a/BUILD b/BUILD index f049e3c4056..bf001ac7273 100644 --- a/BUILD +++ b/BUILD @@ -228,7 +228,6 @@ cc_library( "src/core/lib/surface/init.h", "src/core/lib/surface/lame_client.h", "src/core/lib/surface/server.h", - "src/core/lib/surface/surface_trace.h", "src/core/lib/transport/byte_stream.h", "src/core/lib/transport/connectivity_state.h", "src/core/lib/transport/metadata.h", @@ -606,7 +605,6 @@ cc_library( "src/core/lib/surface/init.h", "src/core/lib/surface/lame_client.h", "src/core/lib/surface/server.h", - "src/core/lib/surface/surface_trace.h", "src/core/lib/transport/byte_stream.h", "src/core/lib/transport/connectivity_state.h", "src/core/lib/transport/metadata.h", @@ -949,7 +947,6 @@ cc_library( "src/core/lib/surface/init.h", "src/core/lib/surface/lame_client.h", "src/core/lib/surface/server.h", - "src/core/lib/surface/surface_trace.h", "src/core/lib/transport/byte_stream.h", "src/core/lib/transport/connectivity_state.h", "src/core/lib/transport/metadata.h", @@ -2061,7 +2058,6 @@ objc_library( "src/core/lib/surface/init.h", "src/core/lib/surface/lame_client.h", "src/core/lib/surface/server.h", - "src/core/lib/surface/surface_trace.h", "src/core/lib/transport/byte_stream.h", "src/core/lib/transport/connectivity_state.h", "src/core/lib/transport/metadata.h", diff --git a/build.yaml b/build.yaml index a83ebc595ad..11cc9347cb0 100644 --- a/build.yaml +++ b/build.yaml @@ -224,7 +224,6 @@ filegroups: - src/core/lib/surface/init.h - src/core/lib/surface/lame_client.h - src/core/lib/surface/server.h - - src/core/lib/surface/surface_trace.h - src/core/lib/transport/byte_stream.h - src/core/lib/transport/connectivity_state.h - src/core/lib/transport/metadata.h diff --git a/gRPC.podspec b/gRPC.podspec index d3665d51744..622be89ca74 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -231,7 +231,6 @@ Pod::Spec.new do |s| 'src/core/lib/surface/init.h', 'src/core/lib/surface/lame_client.h', 'src/core/lib/surface/server.h', - 'src/core/lib/surface/surface_trace.h', 'src/core/lib/transport/byte_stream.h', 'src/core/lib/transport/connectivity_state.h', 'src/core/lib/transport/metadata.h', @@ -606,7 +605,6 @@ Pod::Spec.new do |s| 'src/core/lib/surface/init.h', 'src/core/lib/surface/lame_client.h', 'src/core/lib/surface/server.h', - 'src/core/lib/surface/surface_trace.h', 'src/core/lib/transport/byte_stream.h', 'src/core/lib/transport/connectivity_state.h', 'src/core/lib/transport/metadata.h', diff --git a/grpc.gemspec b/grpc.gemspec index 9f3ae048a70..e0a8ff00a42 100755 --- a/grpc.gemspec +++ b/grpc.gemspec @@ -240,7 +240,6 @@ Gem::Specification.new do |s| s.files += %w( src/core/lib/surface/init.h ) s.files += %w( src/core/lib/surface/lame_client.h ) s.files += %w( src/core/lib/surface/server.h ) - s.files += %w( src/core/lib/surface/surface_trace.h ) s.files += %w( src/core/lib/transport/byte_stream.h ) s.files += %w( src/core/lib/transport/connectivity_state.h ) s.files += %w( src/core/lib/transport/metadata.h ) diff --git a/package.xml b/package.xml index b25e42c1c01..fef06ef9eed 100644 --- a/package.xml +++ b/package.xml @@ -247,7 +247,6 @@ - diff --git a/src/core/lib/debug/trace.c b/src/core/lib/debug/trace.c index 555f497b784..c56046785b3 100644 --- a/src/core/lib/debug/trace.c +++ b/src/core/lib/debug/trace.c @@ -88,7 +88,11 @@ static void parse(const char *s) { split(s, &strings, &nstrings); for (i = 0; i < nstrings; i++) { - grpc_tracer_set_enabled(strings[i], 1); + if (strings[i][0] == '-') { + grpc_tracer_set_enabled(strings[i] + 1, 0); + } else { + grpc_tracer_set_enabled(strings[i], 1); + } } for (i = 0; i < nstrings; i++) { @@ -117,7 +121,7 @@ int grpc_tracer_set_enabled(const char *name, int enabled) { tracer *t; if (0 == strcmp(name, "all")) { for (t = tracers; t; t = t->next) { - *t->flag = 1; + *t->flag = enabled; } } else { int found = 0; diff --git a/src/core/lib/surface/call.h b/src/core/lib/surface/call.h index b640345c21d..3a78fe3aa36 100644 --- a/src/core/lib/surface/call.h +++ b/src/core/lib/surface/call.h @@ -37,7 +37,6 @@ #include "src/core/lib/channel/channel_stack.h" #include "src/core/lib/channel/context.h" #include "src/core/lib/surface/api_trace.h" -#include "src/core/lib/surface/surface_trace.h" #include #include diff --git a/src/core/lib/surface/completion_queue.c b/src/core/lib/surface/completion_queue.c index 5eb7cf1bf4f..de2b674d0e0 100644 --- a/src/core/lib/surface/completion_queue.c +++ b/src/core/lib/surface/completion_queue.c @@ -48,7 +48,6 @@ #include "src/core/lib/surface/api_trace.h" #include "src/core/lib/surface/call.h" #include "src/core/lib/surface/event_string.h" -#include "src/core/lib/surface/surface_trace.h" typedef struct { grpc_pollset_worker **worker; @@ -91,6 +90,18 @@ struct grpc_completion_queue { static gpr_mu g_freelist_mu; static grpc_completion_queue *g_freelist; +int grpc_cq_pluck_trace; +int grpc_cq_event_timeout_trace; + +#define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event) \ + if (grpc_api_trace && \ + (grpc_cq_pluck_trace || (event)->type != GRPC_QUEUE_TIMEOUT)) { \ + char *_ev = grpc_event_string(event); \ + gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, _ev); \ + gpr_free(_ev); \ + } + + static void on_pollset_shutdown_done(grpc_exec_ctx *exec_ctx, void *cc, bool success); @@ -396,13 +407,15 @@ grpc_event grpc_completion_queue_pluck(grpc_completion_queue *cc, void *tag, GPR_TIMER_BEGIN("grpc_completion_queue_pluck", 0); - GRPC_API_TRACE( - "grpc_completion_queue_pluck(" - "cc=%p, tag=%p, " - "deadline=gpr_timespec { tv_sec: %lld, tv_nsec: %d, clock_type: %d }, " - "reserved=%p)", - 6, (cc, tag, (long long)deadline.tv_sec, (int)deadline.tv_nsec, - (int)deadline.clock_type, reserved)); + if (grpc_cq_pluck_trace) { + GRPC_API_TRACE( + "grpc_completion_queue_pluck(" + "cc=%p, tag=%p, " + "deadline=gpr_timespec { tv_sec: %lld, tv_nsec: %d, clock_type: %d }, " + "reserved=%p)", + 6, (cc, tag, (long long)deadline.tv_sec, (int)deadline.tv_nsec, + (int)deadline.clock_type, reserved)); + } GPR_ASSERT(!reserved); deadline = gpr_convert_clock_type(deadline, GPR_CLOCK_MONOTONIC); diff --git a/src/core/lib/surface/completion_queue.h b/src/core/lib/surface/completion_queue.h index 3d0dd13c53b..108445b28f1 100644 --- a/src/core/lib/surface/completion_queue.h +++ b/src/core/lib/surface/completion_queue.h @@ -39,6 +39,9 @@ #include #include "src/core/lib/iomgr/pollset.h" +extern int grpc_cq_pluck_trace; +extern int grpc_cq_event_timeout_trace; + typedef struct grpc_cq_completion { /** user supplied tag */ void *tag; diff --git a/src/core/lib/surface/init.c b/src/core/lib/surface/init.c index 1c8b7090156..499ecffc2ae 100644 --- a/src/core/lib/surface/init.c +++ b/src/core/lib/surface/init.c @@ -57,7 +57,6 @@ #include "src/core/lib/surface/init.h" #include "src/core/lib/surface/lame_client.h" #include "src/core/lib/surface/server.h" -#include "src/core/lib/surface/surface_trace.h" #include "src/core/lib/transport/connectivity_state.h" #include "src/core/lib/transport/transport_impl.h" @@ -165,6 +164,12 @@ void grpc_init(void) { &grpc_trace_channel_stack_builder); grpc_register_tracer("http1", &grpc_http1_trace); grpc_register_tracer("compression", &grpc_compression_trace); + grpc_register_tracer("queue_pluck", &grpc_cq_pluck_trace); + // Default pluck trace to 1 + grpc_cq_pluck_trace = 1; + grpc_register_tracer("queue_timeout", &grpc_cq_event_timeout_trace); + // Default timeout trace to 1 + grpc_cq_event_timeout_trace = 1; grpc_security_pre_init(); grpc_iomgr_init(); grpc_executor_init(); diff --git a/src/core/lib/surface/surface_trace.h b/src/core/lib/surface/surface_trace.h deleted file mode 100644 index a69a0fff577..00000000000 --- a/src/core/lib/surface/surface_trace.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - * - * Copyright 2015, 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_SURFACE_SURFACE_TRACE_H -#define GRPC_CORE_LIB_SURFACE_SURFACE_TRACE_H - -#include -#include "src/core/lib/debug/trace.h" -#include "src/core/lib/surface/api_trace.h" - -#define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event) \ - if (grpc_api_trace) { \ - char *_ev = grpc_event_string(event); \ - gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, _ev); \ - gpr_free(_ev); \ - } - -#endif /* GRPC_CORE_LIB_SURFACE_SURFACE_TRACE_H */ diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index aee866adf46..337ce16551a 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -857,7 +857,6 @@ src/core/lib/surface/event_string.h \ src/core/lib/surface/init.h \ src/core/lib/surface/lame_client.h \ src/core/lib/surface/server.h \ -src/core/lib/surface/surface_trace.h \ src/core/lib/transport/byte_stream.h \ src/core/lib/transport/connectivity_state.h \ src/core/lib/transport/metadata.h \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 4aad52c69d0..f9c497afcdd 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -5762,7 +5762,6 @@ "src/core/lib/surface/init.h", "src/core/lib/surface/lame_client.h", "src/core/lib/surface/server.h", - "src/core/lib/surface/surface_trace.h", "src/core/lib/transport/byte_stream.h", "src/core/lib/transport/connectivity_state.h", "src/core/lib/transport/metadata.h", @@ -5921,7 +5920,6 @@ "src/core/lib/surface/metadata_array.c", "src/core/lib/surface/server.c", "src/core/lib/surface/server.h", - "src/core/lib/surface/surface_trace.h", "src/core/lib/surface/validate_metadata.c", "src/core/lib/surface/version.c", "src/core/lib/transport/byte_stream.c", diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj b/vsprojects/vcxproj/grpc/grpc.vcxproj index ec0c984f2e7..c69623bf736 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj @@ -366,7 +366,6 @@ - diff --git a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters index 273f73b2a30..593024993fa 100644 --- a/vsprojects/vcxproj/grpc/grpc.vcxproj.filters +++ b/vsprojects/vcxproj/grpc/grpc.vcxproj.filters @@ -839,9 +839,6 @@ src\core\lib\surface - - src\core\lib\surface - src\core\lib\transport diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj index bba099d803c..28dcd8269eb 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj @@ -355,7 +355,6 @@ - diff --git a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters index 78a8777f942..058ae653cad 100644 --- a/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/vcxproj/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -749,9 +749,6 @@ src\core\lib\surface - - src\core\lib\surface - src\core\lib\transport From bb2bd6553938ca1a192414084e5800178f67c4a3 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 16 Jun 2016 09:29:53 -0700 Subject: [PATCH 03/24] Clang format --- src/core/lib/surface/completion_queue.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/core/lib/surface/completion_queue.c b/src/core/lib/surface/completion_queue.c index de2b674d0e0..03de97bc2b5 100644 --- a/src/core/lib/surface/completion_queue.c +++ b/src/core/lib/surface/completion_queue.c @@ -93,12 +93,12 @@ static grpc_completion_queue *g_freelist; int grpc_cq_pluck_trace; int grpc_cq_event_timeout_trace; -#define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event) \ - if (grpc_api_trace && \ - (grpc_cq_pluck_trace || (event)->type != GRPC_QUEUE_TIMEOUT)) { \ - char *_ev = grpc_event_string(event); \ - gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, _ev); \ - gpr_free(_ev); \ +#define GRPC_SURFACE_TRACE_RETURNED_EVENT(cq, event) \ + if (grpc_api_trace && \ + (grpc_cq_pluck_trace || (event)->type != GRPC_QUEUE_TIMEOUT)) { \ + char *_ev = grpc_event_string(event); \ + gpr_log(GPR_INFO, "RETURN_EVENT[%p]: %s", cq, _ev); \ + gpr_free(_ev); \ } From 05998dc6939bb7ad4230775bb5ac87696ae9e29b Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 16 Jun 2016 10:16:44 -0700 Subject: [PATCH 04/24] More formatting fixes --- src/core/lib/surface/completion_queue.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/core/lib/surface/completion_queue.c b/src/core/lib/surface/completion_queue.c index 03de97bc2b5..d70f1721463 100644 --- a/src/core/lib/surface/completion_queue.c +++ b/src/core/lib/surface/completion_queue.c @@ -101,7 +101,6 @@ int grpc_cq_event_timeout_trace; gpr_free(_ev); \ } - static void on_pollset_shutdown_done(grpc_exec_ctx *exec_ctx, void *cc, bool success); From 00f41c1eed57f84a2efdfbd96a59dd00d523cde0 Mon Sep 17 00:00:00 2001 From: murgatroid99 Date: Thu, 16 Jun 2016 12:46:52 -0700 Subject: [PATCH 05/24] Add comment about new trace flags --- src/core/lib/surface/completion_queue.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/lib/surface/completion_queue.h b/src/core/lib/surface/completion_queue.h index 108445b28f1..e4018695e27 100644 --- a/src/core/lib/surface/completion_queue.h +++ b/src/core/lib/surface/completion_queue.h @@ -39,6 +39,8 @@ #include #include "src/core/lib/iomgr/pollset.h" +/* These trace flags default to 1. The corresponding lines are only traced + if grpc_api_trace is also truthy */ extern int grpc_cq_pluck_trace; extern int grpc_cq_event_timeout_trace; From 83a6a828b047cc24922a6d143e30f4ab6eb63239 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Thu, 23 Jun 2016 11:33:13 -0700 Subject: [PATCH 06/24] Fixed error messages for C++ interop client. --- test/cpp/interop/interop_client.cc | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index 89f841dbe96..ec0729d9c5d 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -451,7 +451,7 @@ bool InteropClient::DoResponseStreaming() { // most likely due to connection failure. gpr_log(GPR_ERROR, "DoResponseStreaming(): Read fewer streams (%d) than " - "response_stream_sizes.size() (%" PRIuPTR ")", + "response_stream_sizes.size() (%zu)", i, response_stream_sizes.size()); return TransientFailureOrAbort(); } @@ -576,11 +576,10 @@ bool InteropClient::DoServerCompressedStreaming() { if (k < sizes.size()) { // stream->Read() failed before reading all the expected messages. This // is most likely due to a connection failure. - gpr_log(GPR_ERROR, "%s(): Responses read (k=%" PRIuPTR - ") is " - "less than the expected messages (i.e " - "response_stream_sizes.size() (%" PRIuPTR ")).", - __func__, k, response_stream_sizes.size()); + gpr_log(GPR_ERROR, + "%s(): Responses read (k=%zu) is less than the expected number of " + "messages (%zu).", + __func__, k, sizes.size()); return TransientFailureOrAbort(); } @@ -665,7 +664,7 @@ bool InteropClient::DoHalfDuplex() { // most likely due to a connection failure gpr_log(GPR_ERROR, "DoHalfDuplex(): Responses read (i=%d) are less than the expected " - "number of messages response_stream_sizes.size() (%" PRIuPTR ")", + "number of messages response_stream_sizes.size() (%zu)", i, response_stream_sizes.size()); return TransientFailureOrAbort(); } From 2cecece0d352c37300ac55c3477684bb5aa418a1 Mon Sep 17 00:00:00 2001 From: yang-g Date: Sun, 26 Jun 2016 10:57:11 -0700 Subject: [PATCH 07/24] Add a unit test for compression. --- src/ruby/spec/client_server_spec.rb | 46 +++++++++++++++++++++++++++-- 1 file changed, 44 insertions(+), 2 deletions(-) diff --git a/src/ruby/spec/client_server_spec.rb b/src/ruby/spec/client_server_spec.rb index aedeca272d3..d60d84996fe 100644 --- a/src/ruby/spec/client_server_spec.rb +++ b/src/ruby/spec/client_server_spec.rb @@ -43,11 +43,11 @@ shared_context 'setup: tags' do Time.now + 5 end - def server_allows_client_to_proceed + def server_allows_client_to_proceed(metadata = {}) recvd_rpc = @server.request_call(@server_queue, @server_tag, deadline) expect(recvd_rpc).to_not eq nil server_call = recvd_rpc.call - ops = { CallOps::SEND_INITIAL_METADATA => {} } + ops = { CallOps::SEND_INITIAL_METADATA => metadata } svr_batch = server_call.run_batch(@server_queue, @server_tag, deadline, ops) expect(svr_batch.send_metadata).to be true server_call @@ -135,6 +135,48 @@ shared_examples 'basic GRPC message delivery is OK' do expect(svr_batch.send_message).to be true end + it 'compressed messages can be sent and received' do + call = new_client_call + server_call = nil + long_request_str = '0' * 2000 + long_response_str = '1' * 2000 + md = { 'grpc-internal-encoding-request' => 'gzip' } + + server_thread = Thread.new do + server_call = server_allows_client_to_proceed(md) + end + + client_ops = { + CallOps::SEND_INITIAL_METADATA => md, + CallOps::SEND_MESSAGE => long_request_str + } + batch_result = call.run_batch(@client_queue, @client_tag, deadline, + client_ops) + expect(batch_result.send_metadata).to be true + expect(batch_result.send_message).to be true + + # confirm the server can read the inbound message + server_thread.join + server_ops = { + CallOps::RECV_MESSAGE => nil, + CallOps::SEND_MESSAGE => long_response_str + } + svr_batch = server_call.run_batch(@server_queue, @server_tag, deadline, + server_ops) + expect(svr_batch.message).to eq(long_request_str) + expect(svr_batch.send_message).to be true + + client_ops = { + CallOps::SEND_CLOSE_FROM_CLIENT => nil, + CallOps::RECV_INITIAL_METADATA => nil, + CallOps::RECV_MESSAGE => nil + } + batch_result = call.run_batch(@client_queue, @client_tag, deadline, + client_ops) + expect(batch_result.send_close).to be true + expect(batch_result.message).to eq long_response_str + end + it 'servers can ignore a client write and send a status' do call = new_client_call server_call = nil From 193a5c737f3cad5e42c991bbf1f01c7a52cf8d06 Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Mon, 27 Jun 2016 11:30:10 -0700 Subject: [PATCH 08/24] printf portability sucks --- test/cpp/interop/interop_client.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/cpp/interop/interop_client.cc b/test/cpp/interop/interop_client.cc index ec0729d9c5d..8861bc1163c 100644 --- a/test/cpp/interop/interop_client.cc +++ b/test/cpp/interop/interop_client.cc @@ -451,7 +451,7 @@ bool InteropClient::DoResponseStreaming() { // most likely due to connection failure. gpr_log(GPR_ERROR, "DoResponseStreaming(): Read fewer streams (%d) than " - "response_stream_sizes.size() (%zu)", + "response_stream_sizes.size() (%" PRIuPTR ")", i, response_stream_sizes.size()); return TransientFailureOrAbort(); } @@ -577,8 +577,8 @@ bool InteropClient::DoServerCompressedStreaming() { // stream->Read() failed before reading all the expected messages. This // is most likely due to a connection failure. gpr_log(GPR_ERROR, - "%s(): Responses read (k=%zu) is less than the expected number of " - "messages (%zu).", + "%s(): Responses read (k=%" PRIuPTR + ") is less than the expected number of messages (%" PRIuPTR ").", __func__, k, sizes.size()); return TransientFailureOrAbort(); } @@ -664,7 +664,7 @@ bool InteropClient::DoHalfDuplex() { // most likely due to a connection failure gpr_log(GPR_ERROR, "DoHalfDuplex(): Responses read (i=%d) are less than the expected " - "number of messages response_stream_sizes.size() (%zu)", + "number of messages response_stream_sizes.size() (%" PRIuPTR ")", i, response_stream_sizes.size()); return TransientFailureOrAbort(); } From cea0004a5309c874280951358de177f01dd93896 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 27 Jun 2016 11:32:08 -0700 Subject: [PATCH 09/24] Annotate error.c for timing, remove broken test --- Makefile | 36 ---- build.yaml | 10 - src/core/lib/iomgr/error.c | 44 ++-- test/core/profiling/timers_test.c | 83 -------- tools/run_tests/sources_and_headers.json | 16 -- tools/run_tests/tests.json | 21 -- vsprojects/buildtests_c.sln | 27 --- .../test/timers_test/timers_test.vcxproj | 199 ------------------ .../timers_test/timers_test.vcxproj.filters | 21 -- 9 files changed, 32 insertions(+), 425 deletions(-) delete mode 100644 test/core/profiling/timers_test.c delete mode 100644 vsprojects/vcxproj/test/timers_test/timers_test.vcxproj delete mode 100644 vsprojects/vcxproj/test/timers_test/timers_test.vcxproj.filters diff --git a/Makefile b/Makefile index 358252f6a43..8fd86e78ed0 100644 --- a/Makefile +++ b/Makefile @@ -995,7 +995,6 @@ time_averaged_stats_test: $(BINDIR)/$(CONFIG)/time_averaged_stats_test timeout_encoding_test: $(BINDIR)/$(CONFIG)/timeout_encoding_test timer_heap_test: $(BINDIR)/$(CONFIG)/timer_heap_test timer_list_test: $(BINDIR)/$(CONFIG)/timer_list_test -timers_test: $(BINDIR)/$(CONFIG)/timers_test transport_connectivity_state_test: $(BINDIR)/$(CONFIG)/transport_connectivity_state_test transport_metadata_test: $(BINDIR)/$(CONFIG)/transport_metadata_test transport_security_test: $(BINDIR)/$(CONFIG)/transport_security_test @@ -1326,7 +1325,6 @@ buildtests_c: privatelibs_c \ $(BINDIR)/$(CONFIG)/timeout_encoding_test \ $(BINDIR)/$(CONFIG)/timer_heap_test \ $(BINDIR)/$(CONFIG)/timer_list_test \ - $(BINDIR)/$(CONFIG)/timers_test \ $(BINDIR)/$(CONFIG)/transport_connectivity_state_test \ $(BINDIR)/$(CONFIG)/transport_metadata_test \ $(BINDIR)/$(CONFIG)/transport_security_test \ @@ -1707,8 +1705,6 @@ test_c: buildtests_c $(Q) $(BINDIR)/$(CONFIG)/timer_heap_test || ( echo test timer_heap_test failed ; exit 1 ) $(E) "[RUN] Testing timer_list_test" $(Q) $(BINDIR)/$(CONFIG)/timer_list_test || ( echo test timer_list_test failed ; exit 1 ) - $(E) "[RUN] Testing timers_test" - $(Q) $(BINDIR)/$(CONFIG)/timers_test || ( echo test timers_test failed ; exit 1 ) $(E) "[RUN] Testing transport_connectivity_state_test" $(Q) $(BINDIR)/$(CONFIG)/transport_connectivity_state_test || ( echo test transport_connectivity_state_test failed ; exit 1 ) $(E) "[RUN] Testing transport_metadata_test" @@ -10028,38 +10024,6 @@ endif endif -TIMERS_TEST_SRC = \ - test/core/profiling/timers_test.c \ - -TIMERS_TEST_OBJS = $(addprefix $(OBJDIR)/$(CONFIG)/, $(addsuffix .o, $(basename $(TIMERS_TEST_SRC)))) -ifeq ($(NO_SECURE),true) - -# You can't build secure targets if you don't have OpenSSL. - -$(BINDIR)/$(CONFIG)/timers_test: openssl_dep_error - -else - - - -$(BINDIR)/$(CONFIG)/timers_test: $(TIMERS_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) $(TIMERS_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)/timers_test - -endif - -$(OBJDIR)/$(CONFIG)/test/core/profiling/timers_test.o: $(LIBDIR)/$(CONFIG)/libgrpc_test_util.a $(LIBDIR)/$(CONFIG)/libgrpc.a $(LIBDIR)/$(CONFIG)/libgpr_test_util.a $(LIBDIR)/$(CONFIG)/libgpr.a - -deps_timers_test: $(TIMERS_TEST_OBJS:.o=.dep) - -ifneq ($(NO_SECURE),true) -ifneq ($(NO_DEPS),true) --include $(TIMERS_TEST_OBJS:.o=.dep) -endif -endif - - TRANSPORT_CONNECTIVITY_STATE_TEST_SRC = \ test/core/transport/connectivity_state_test.c \ diff --git a/build.yaml b/build.yaml index 8ebcccb81ae..6ca808dd90c 100644 --- a/build.yaml +++ b/build.yaml @@ -2352,16 +2352,6 @@ targets: - grpc - gpr_test_util - gpr -- name: timers_test - build: test - language: c - src: - - test/core/profiling/timers_test.c - deps: - - grpc_test_util - - grpc - - gpr_test_util - - gpr - name: transport_connectivity_state_test build: test language: c diff --git a/src/core/lib/iomgr/error.c b/src/core/lib/iomgr/error.c index 540fb4fa7e4..6f24200b772 100644 --- a/src/core/lib/iomgr/error.c +++ b/src/core/lib/iomgr/error.c @@ -47,6 +47,8 @@ #include #endif +#include "src/core/lib/profiling/timers.h" + static void destroy_integer(void *key) {} static void *copy_integer(void *key) { return key; } @@ -213,6 +215,7 @@ void grpc_error_unref(grpc_error *err) { grpc_error *grpc_error_create(const char *file, int line, const char *desc, grpc_error **referencing, size_t num_referencing) { + GPR_TIMER_BEGIN("grpc_error_create", 0); grpc_error *err = gpr_malloc(sizeof(*err)); if (err == NULL) { // TODO(ctiller): make gpr_malloc return NULL return GRPC_ERROR_OOM; @@ -238,57 +241,71 @@ grpc_error *grpc_error_create(const char *file, int line, const char *desc, (void *)(uintptr_t)GRPC_ERROR_TIME_CREATED, box_time(gpr_now(GPR_CLOCK_REALTIME))); gpr_ref_init(&err->refs, 1); + GPR_TIMER_END("grpc_error_create", 0); return err; } static grpc_error *copy_error_and_unref(grpc_error *in) { + GPR_TIMER_BEGIN("copy_error_and_unref", 0); + grpc_error *out; if (is_special(in)) { if (in == GRPC_ERROR_NONE) return GRPC_ERROR_CREATE("no error"); if (in == GRPC_ERROR_OOM) return GRPC_ERROR_CREATE("oom"); if (in == GRPC_ERROR_CANCELLED) return GRPC_ERROR_CREATE("cancelled"); - return GRPC_ERROR_CREATE("unknown"); - } - grpc_error *out = gpr_malloc(sizeof(*out)); + out = GRPC_ERROR_CREATE("unknown"); + } else { + out = gpr_malloc(sizeof(*out)); #ifdef GRPC_ERROR_REFCOUNT_DEBUG - gpr_log(GPR_DEBUG, "%p create copying", out); + gpr_log(GPR_DEBUG, "%p create copying", out); #endif - out->ints = gpr_avl_ref(in->ints); - out->strs = gpr_avl_ref(in->strs); - out->errs = gpr_avl_ref(in->errs); - out->times = gpr_avl_ref(in->times); - out->next_err = in->next_err; - gpr_ref_init(&out->refs, 1); - GRPC_ERROR_UNREF(in); + out->ints = gpr_avl_ref(in->ints); + out->strs = gpr_avl_ref(in->strs); + out->errs = gpr_avl_ref(in->errs); + out->times = gpr_avl_ref(in->times); + out->next_err = in->next_err; + gpr_ref_init(&out->refs, 1); + GRPC_ERROR_UNREF(in); + } + GPR_TIMER_END("copy_error_and_unref", 0); return out; } grpc_error *grpc_error_set_int(grpc_error *src, grpc_error_ints which, intptr_t value) { + GPR_TIMER_BEGIN("grpc_error_set_int", 0); grpc_error *new = copy_error_and_unref(src); new->ints = gpr_avl_add(new->ints, (void *)(uintptr_t)which, (void *)value); + GPR_TIMER_END("grpc_error_set_int", 0); return new; } bool grpc_error_get_int(grpc_error *err, grpc_error_ints which, intptr_t *p) { void *pp; + GPR_TIMER_BEGIN("grpc_error_get_int", 0); if (gpr_avl_maybe_get(err->ints, (void *)(uintptr_t)which, &pp)) { if (p != NULL) *p = (intptr_t)pp; + GPR_TIMER_END("grpc_error_get_int", 0); return true; } + GPR_TIMER_END("grpc_error_get_int", 0); return false; } grpc_error *grpc_error_set_str(grpc_error *src, grpc_error_strs which, const char *value) { + GPR_TIMER_BEGIN("grpc_error_set_str", 0); grpc_error *new = copy_error_and_unref(src); new->strs = gpr_avl_add(new->strs, (void *)(uintptr_t)which, gpr_strdup(value)); + GPR_TIMER_END("grpc_error_set_str", 0); return new; } grpc_error *grpc_error_add_child(grpc_error *src, grpc_error *child) { + GPR_TIMER_BEGIN("grpc_error_add_child", 0); grpc_error *new = copy_error_and_unref(src); new->errs = gpr_avl_add(new->errs, (void *)(new->next_err++), child); + GPR_TIMER_END("grpc_error_add_child", 0); return new; } @@ -480,6 +497,7 @@ void grpc_error_free_string(const char *str) { } const char *grpc_error_string(grpc_error *err) { + GPR_TIMER_BEGIN("grpc_error_string", 0); if (err == GRPC_ERROR_NONE) return no_error_string; if (err == GRPC_ERROR_OOM) return oom_error_string; if (err == GRPC_ERROR_CANCELLED) return cancelled_error_string; @@ -496,7 +514,9 @@ const char *grpc_error_string(grpc_error *err) { qsort(kvs.kvs, kvs.num_kvs, sizeof(kv_pair), cmp_kvs); - return finish_kvs(&kvs); + const char *out = finish_kvs(&kvs); + GPR_TIMER_END("grpc_error_string", 0); + return out; } grpc_error *grpc_os_error(const char *file, int line, int err, diff --git a/test/core/profiling/timers_test.c b/test/core/profiling/timers_test.c deleted file mode 100644 index 284589af1e1..00000000000 --- a/test/core/profiling/timers_test.c +++ /dev/null @@ -1,83 +0,0 @@ -/* - * - * Copyright 2015, 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/profiling/timers.h" -#include -#include "test/core/util/test_config.h" - -void test_log_events(size_t num_seqs) { - size_t start = 0; - size_t *state; - state = calloc(num_seqs, sizeof(state[0])); - while (start < num_seqs) { - size_t i; - size_t row; - if (state[start] == 3) { /* Already done with this posn */ - start++; - continue; - } - - row = (size_t)rand() % 10; /* how many in a row */ - for (i = start; (i < start + row) && (i < num_seqs); i++) { - size_t j; - size_t advance = 1 + (size_t)rand() % 3; /* how many to advance by */ - for (j = 0; j < advance; j++) { - switch (state[i]) { - case 0: - GPR_TIMER_MARK(STATE_0, i); - state[i]++; - break; - case 1: - GPR_TIMER_MARK(STATE_1, i); - state[i]++; - break; - case 2: - GPR_TIMER_MARK(STATE_2, i); - state[i]++; - break; - case 3: - break; - } - } - } - } - free(state); -} - -int main(int argc, char **argv) { - grpc_test_init(argc, argv); - gpr_timers_global_init(); - test_log_events(1000000); - gpr_timers_global_destroy(); - return 0; -} diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 6c597158845..5ccd75d19a5 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -1711,22 +1711,6 @@ "third_party": false, "type": "target" }, - { - "deps": [ - "gpr", - "gpr_test_util", - "grpc", - "grpc_test_util" - ], - "headers": [], - "language": "c", - "name": "timers_test", - "src": [ - "test/core/profiling/timers_test.c" - ], - "third_party": false, - "type": "target" - }, { "deps": [ "gpr", diff --git a/tools/run_tests/tests.json b/tools/run_tests/tests.json index 1c97e9a832c..dedd55774b6 100644 --- a/tools/run_tests/tests.json +++ b/tools/run_tests/tests.json @@ -1813,27 +1813,6 @@ "windows" ] }, - { - "args": [], - "ci_platforms": [ - "linux", - "mac", - "posix", - "windows" - ], - "cpu_cost": 1.0, - "exclude_configs": [], - "flaky": false, - "gtest": false, - "language": "c", - "name": "timers_test", - "platforms": [ - "linux", - "mac", - "posix", - "windows" - ] - }, { "args": [], "ci_platforms": [ diff --git a/vsprojects/buildtests_c.sln b/vsprojects/buildtests_c.sln index a847add7730..10be520b5f1 100644 --- a/vsprojects/buildtests_c.sln +++ b/vsprojects/buildtests_c.sln @@ -1364,17 +1364,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "timer_list_test", "vcxproj\ {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} = {B23D3D1A-9438-4EDA-BEB6-9A0A03D17792} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "timers_test", "vcxproj\test\timers_test\timers_test.vcxproj", "{FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}" - 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}") = "transport_connectivity_state_test", "vcxproj\test\transport_connectivity_state_test\transport_connectivity_state_test.vcxproj", "{659121F6-1639-AC6B-053E-9D17A8B94D56}" ProjectSection(myProperties) = preProject lib = "False" @@ -3476,22 +3465,6 @@ Global {C43EA45B-1E72-C58D-8CE3-A879D1B1E2DB}.Release-DLL|Win32.Build.0 = Release|Win32 {C43EA45B-1E72-C58D-8CE3-A879D1B1E2DB}.Release-DLL|x64.ActiveCfg = Release|x64 {C43EA45B-1E72-C58D-8CE3-A879D1B1E2DB}.Release-DLL|x64.Build.0 = Release|x64 - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}.Debug|Win32.ActiveCfg = Debug|Win32 - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}.Debug|x64.ActiveCfg = Debug|x64 - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}.Release|Win32.ActiveCfg = Release|Win32 - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}.Release|x64.ActiveCfg = Release|x64 - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}.Debug|Win32.Build.0 = Debug|Win32 - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}.Debug|x64.Build.0 = Debug|x64 - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}.Release|Win32.Build.0 = Release|Win32 - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}.Release|x64.Build.0 = Release|x64 - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}.Debug-DLL|Win32.ActiveCfg = Debug|Win32 - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}.Debug-DLL|Win32.Build.0 = Debug|Win32 - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}.Debug-DLL|x64.ActiveCfg = Debug|x64 - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}.Debug-DLL|x64.Build.0 = Debug|x64 - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}.Release-DLL|Win32.ActiveCfg = Release|Win32 - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}.Release-DLL|Win32.Build.0 = Release|Win32 - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}.Release-DLL|x64.ActiveCfg = Release|x64 - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5}.Release-DLL|x64.Build.0 = Release|x64 {659121F6-1639-AC6B-053E-9D17A8B94D56}.Debug|Win32.ActiveCfg = Debug|Win32 {659121F6-1639-AC6B-053E-9D17A8B94D56}.Debug|x64.ActiveCfg = Debug|x64 {659121F6-1639-AC6B-053E-9D17A8B94D56}.Release|Win32.ActiveCfg = Release|Win32 diff --git a/vsprojects/vcxproj/test/timers_test/timers_test.vcxproj b/vsprojects/vcxproj/test/timers_test/timers_test.vcxproj deleted file mode 100644 index fa1ba6adc62..00000000000 --- a/vsprojects/vcxproj/test/timers_test/timers_test.vcxproj +++ /dev/null @@ -1,199 +0,0 @@ - - - - - - Debug - Win32 - - - Debug - x64 - - - Release - Win32 - - - Release - x64 - - - - {FFE98236-3F4D-2CBA-29FB-D0A7467D2FA5} - true - $(SolutionDir)IntDir\$(MSBuildProjectName)\ - - - - v100 - - - v110 - - - v120 - - - v140 - - - Application - true - Unicode - - - Application - false - true - Unicode - - - - - - - - - - - - - - timers_test - static - Debug - static - Debug - - - timers_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/timers_test/timers_test.vcxproj.filters b/vsprojects/vcxproj/test/timers_test/timers_test.vcxproj.filters deleted file mode 100644 index d4901c444c5..00000000000 --- a/vsprojects/vcxproj/test/timers_test/timers_test.vcxproj.filters +++ /dev/null @@ -1,21 +0,0 @@ - - - - - test\core\profiling - - - - - - {babbbe28-0bb3-2bc8-dee6-43fe0bef8f98} - - - {f321526c-3617-e2b9-8f09-2e15e92bc30a} - - - {62fa1b4c-6baf-0b0c-52a9-a5694834dbbb} - - - - From bfc9adc81f39316a3ee62e19901614eb6eebba4d Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 27 Jun 2016 13:16:22 -0700 Subject: [PATCH 10/24] Annotate more things --- src/core/ext/census/grpc_filter.c | 3 +++ src/core/ext/client_config/client_channel.c | 6 ++++++ src/core/ext/client_config/subchannel.c | 2 ++ .../transport/chttp2/transport/chttp2_transport.c | 12 ++++++++++++ 4 files changed, 23 insertions(+) diff --git a/src/core/ext/census/grpc_filter.c b/src/core/ext/census/grpc_filter.c index 72e4e5427eb..f51d850e013 100644 --- a/src/core/ext/census/grpc_filter.c +++ b/src/core/ext/census/grpc_filter.c @@ -45,6 +45,7 @@ #include "src/core/ext/census/census_interface.h" #include "src/core/ext/census/census_rpc_stats.h" #include "src/core/lib/channel/channel_stack.h" +#include "src/core/lib/profiling/timers.h" #include "src/core/lib/transport/static_metadata.h" typedef struct call_data { @@ -92,6 +93,7 @@ static void client_start_transport_op(grpc_exec_ctx *exec_ctx, static void server_on_done_recv(grpc_exec_ctx *exec_ctx, void *ptr, grpc_error *error) { + GPR_TIMER_BEGIN("census-server:server_on_done_recv", 0); grpc_call_element *elem = ptr; call_data *calld = elem->call_data; channel_data *chand = elem->channel_data; @@ -99,6 +101,7 @@ static void server_on_done_recv(grpc_exec_ctx *exec_ctx, void *ptr, extract_and_annotate_method_tag(calld->recv_initial_metadata, calld, chand); } calld->on_done_recv->cb(exec_ctx, calld->on_done_recv->cb_arg, error); + GPR_TIMER_END("census-server:server_on_done_recv", 0); } static void server_mutate_op(grpc_call_element *elem, diff --git a/src/core/ext/client_config/client_channel.c b/src/core/ext/client_config/client_channel.c index 1d5a7d52246..a096435c984 100644 --- a/src/core/ext/client_config/client_channel.c +++ b/src/core/ext/client_config/client_channel.c @@ -367,6 +367,8 @@ static int cc_pick_subchannel(grpc_exec_ctx *exec_ctx, void *elemp, uint32_t initial_metadata_flags, grpc_connected_subchannel **connected_subchannel, grpc_closure *on_ready) { + GPR_TIMER_BEGIN("cc_pick_subchannel", 0); + grpc_call_element *elem = elemp; channel_data *chand = elem->channel_data; call_data *calld = elem->call_data; @@ -391,6 +393,7 @@ static int cc_pick_subchannel(grpc_exec_ctx *exec_ctx, void *elemp, } } gpr_mu_unlock(&chand->mu_config); + GPR_TIMER_END("cc_pick_subchannel", 0); return 1; } if (chand->lb_policy != NULL) { @@ -402,6 +405,7 @@ static int cc_pick_subchannel(grpc_exec_ctx *exec_ctx, void *elemp, initial_metadata, initial_metadata_flags, connected_subchannel, on_ready); GRPC_LB_POLICY_UNREF(exec_ctx, lb_policy, "cc_pick_subchannel"); + GPR_TIMER_END("cc_pick_subchannel", 0); return r; } if (chand->resolver != NULL && !chand->started_resolving) { @@ -426,6 +430,8 @@ static int cc_pick_subchannel(grpc_exec_ctx *exec_ctx, void *elemp, NULL); } gpr_mu_unlock(&chand->mu_config); + + GPR_TIMER_END("cc_pick_subchannel", 0); return 0; } diff --git a/src/core/ext/client_config/subchannel.c b/src/core/ext/client_config/subchannel.c index 468067ea57c..d089cd4399e 100644 --- a/src/core/ext/client_config/subchannel.c +++ b/src/core/ext/client_config/subchannel.c @@ -690,9 +690,11 @@ char *grpc_subchannel_call_get_peer(grpc_exec_ctx *exec_ctx, void grpc_subchannel_call_process_op(grpc_exec_ctx *exec_ctx, grpc_subchannel_call *call, grpc_transport_stream_op *op) { + GPR_TIMER_BEGIN("grpc_subchannel_call_process_op", 0); grpc_call_stack *call_stack = SUBCHANNEL_CALL_TO_CALL_STACK(call); grpc_call_element *top_elem = grpc_call_stack_element(call_stack, 0); top_elem->filter->start_transport_stream_op(exec_ctx, top_elem, op); + GPR_TIMER_END("grpc_subchannel_call_process_op", 0); } grpc_connected_subchannel *grpc_subchannel_get_connected_subchannel( diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 9c125566d48..b710bbcb3cb 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -642,6 +642,8 @@ static void finish_global_actions(grpc_exec_ctx *exec_ctx, grpc_chttp2_executor_action_header *hdr; grpc_chttp2_executor_action_header *next; + GPR_TIMER_BEGIN("finish_global_actions", 0); + for (;;) { if (!t->executor.writing_active && !t->closed && grpc_chttp2_unlocking_check_writes(exec_ctx, &t->global, &t->writing)) { @@ -659,7 +661,9 @@ static void finish_global_actions(grpc_exec_ctx *exec_ctx, NULL; gpr_mu_unlock(&t->executor.mu); while (hdr != NULL) { + GPR_TIMER_BEGIN("chttp2:locked_action", 0); hdr->action(exec_ctx, t, hdr->stream, hdr->arg); + GPR_TIMER_END("chttp2:locked_action", 0); next = hdr->next; gpr_free(hdr); UNREF_TRANSPORT(exec_ctx, t, "pending_action"); @@ -672,6 +676,8 @@ static void finish_global_actions(grpc_exec_ctx *exec_ctx, gpr_mu_unlock(&t->executor.mu); break; } + + GPR_TIMER_END("finish_global_actions", 0); } void grpc_chttp2_run_with_global_lock(grpc_exec_ctx *exec_ctx, @@ -681,6 +687,8 @@ void grpc_chttp2_run_with_global_lock(grpc_exec_ctx *exec_ctx, void *arg, size_t sizeof_arg) { grpc_chttp2_executor_action_header *hdr; + GPR_TIMER_BEGIN("grpc_chttp2_run_with_global_lock", 0); + REF_TRANSPORT(t, "run_global"); gpr_mu_lock(&t->executor.mu); @@ -689,7 +697,9 @@ void grpc_chttp2_run_with_global_lock(grpc_exec_ctx *exec_ctx, t->executor.global_active = 1; gpr_mu_unlock(&t->executor.mu); + GPR_TIMER_BEGIN("chttp2:locked_action", 0); action(exec_ctx, t, optional_stream, arg); + GPR_TIMER_END("chttp2:locked_action", 0); finish_global_actions(exec_ctx, t); } else { @@ -726,6 +736,8 @@ void grpc_chttp2_run_with_global_lock(grpc_exec_ctx *exec_ctx, } UNREF_TRANSPORT(exec_ctx, t, "run_global"); + + GPR_TIMER_END("grpc_chttp2_run_with_global_lock", 0); } /******************************************************************************* From fc5f505a334c9ff4f58057cd51ed3bcf0b9b775c Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Mon, 27 Jun 2016 13:40:50 -0700 Subject: [PATCH 11/24] fixes #7051 Changed return type to GRPCCall * from ProtoRPC * --- src/objective-c/ProtoRPC/ProtoService.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/objective-c/ProtoRPC/ProtoService.m b/src/objective-c/ProtoRPC/ProtoService.m index 97401908519..0a7f56b03f4 100644 --- a/src/objective-c/ProtoRPC/ProtoService.m +++ b/src/objective-c/ProtoRPC/ProtoService.m @@ -65,14 +65,14 @@ return self; } -- (ProtoRPC *)RPCToMethod:(NSString *)method +- (GRPCProtoCall *)RPCToMethod:(NSString *)method requestsWriter:(GRXWriter *)requestsWriter responseClass:(Class)responseClass responsesWriteable:(id)responsesWriteable { GRPCProtoMethod *methodName = [[GRPCProtoMethod alloc] initWithPackage:_packageName service:_serviceName method:method]; - return [[ProtoRPC alloc] initWithHost:_host + return [[GRPCProtoCall alloc] initWithHost:_host method:methodName requestsWriter:requestsWriter responseClass:responseClass From a5aa19a1c81c611c4d33f2709211eee01fda8ede Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Mon, 27 Jun 2016 13:59:07 -0700 Subject: [PATCH 12/24] fixes #3492 added a step in the documentation for objc --- CONTRIBUTING.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 35eb5e61389..b145dfdf9c1 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -53,6 +53,10 @@ To know about the list of available commands, do this: `./tools/run_tests/run_tests.py -h` +If you are running tests for ObjC on osx, follow these steps before running tests: +* install macports from https://www.macports.org/install.php +* install autoconf, automake, libtool, gflags, cmake using macports + ## Adding or removing source code Each language uses its own build system to work. Currently, the root's Makefile From 5b47ac385bab0bb24850d94539827e3c008530cc Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 27 Jun 2016 15:47:17 -0700 Subject: [PATCH 13/24] Colocate calls for the same channel on the same CQ --- test/cpp/qps/client_async.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/cpp/qps/client_async.cc b/test/cpp/qps/client_async.cc index 3d98ab09390..1507d1e3d66 100644 --- a/test/cpp/qps/client_async.cc +++ b/test/cpp/qps/client_async.cc @@ -180,14 +180,14 @@ class AsyncClient : public ClientImpl { using namespace std::placeholders; int t = 0; - for (int i = 0; i < config.outstanding_rpcs_per_channel(); i++) { - for (int ch = 0; ch < config.client_channels(); ch++) { + for (int ch = 0; ch < config.client_channels(); ch++) { + for (int i = 0; i < config.outstanding_rpcs_per_channel(); i++) { auto* cq = cli_cqs_[t].get(); auto ctx = setup_ctx(channels_[ch].get_stub(), next_issuers_[t], request_); ctx->Start(cq); - t = (t + 1) % cli_cqs_.size(); } + t = (t + 1) % cli_cqs_.size(); } } virtual ~AsyncClient() { From ecab5e2355a42800c71487aec1686f38794546e0 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Mon, 27 Jun 2016 16:22:25 -0700 Subject: [PATCH 14/24] added more steps. --- CONTRIBUTING.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index b145dfdf9c1..56bb4b6eb98 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -54,8 +54,11 @@ To know about the list of available commands, do this: `./tools/run_tests/run_tests.py -h` If you are running tests for ObjC on osx, follow these steps before running tests: +* install Xcode command-line tools by running +`sudo xcode-select --install` * install macports from https://www.macports.org/install.php * install autoconf, automake, libtool, gflags, cmake using macports +* restart your terminal window or run source ~/.bash_profile to pick up the new PATH changes. ## Adding or removing source code From 7a3c4275dfe4b53dcd5ceb20a1a3b33e98aa24be Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Mon, 27 Jun 2016 16:36:36 -0700 Subject: [PATCH 15/24] fixed indentation --- src/objective-c/ProtoRPC/ProtoService.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/objective-c/ProtoRPC/ProtoService.m b/src/objective-c/ProtoRPC/ProtoService.m index 0a7f56b03f4..e5a7edfe7de 100644 --- a/src/objective-c/ProtoRPC/ProtoService.m +++ b/src/objective-c/ProtoRPC/ProtoService.m @@ -73,10 +73,10 @@ service:_serviceName method:method]; return [[GRPCProtoCall alloc] initWithHost:_host - method:methodName - requestsWriter:requestsWriter - responseClass:responseClass - responsesWriteable:responsesWriteable]; + method:methodName + requestsWriter:requestsWriter + responseClass:responseClass + responsesWriteable:responsesWriteable]; } @end From 96e3d1c3e674d2af52206740dcb9d9f8e6b3c115 Mon Sep 17 00:00:00 2001 From: Makarand Dharmapurikar Date: Mon, 27 Jun 2016 16:45:36 -0700 Subject: [PATCH 16/24] fixed indentation #2 --- src/objective-c/ProtoRPC/ProtoService.m | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/objective-c/ProtoRPC/ProtoService.m b/src/objective-c/ProtoRPC/ProtoService.m index e5a7edfe7de..3487fac59d3 100644 --- a/src/objective-c/ProtoRPC/ProtoService.m +++ b/src/objective-c/ProtoRPC/ProtoService.m @@ -66,9 +66,9 @@ } - (GRPCProtoCall *)RPCToMethod:(NSString *)method - requestsWriter:(GRXWriter *)requestsWriter - responseClass:(Class)responseClass - responsesWriteable:(id)responsesWriteable { + requestsWriter:(GRXWriter *)requestsWriter + responseClass:(Class)responseClass + responsesWriteable:(id)responsesWriteable { GRPCProtoMethod *methodName = [[GRPCProtoMethod alloc] initWithPackage:_packageName service:_serviceName method:method]; From 191969937e2d4a5a4249ba3c56094673a501c6d5 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 27 Jun 2016 18:45:56 -0700 Subject: [PATCH 17/24] Dont reblock sigmask every loop --- src/core/lib/iomgr/ev_epoll_linux.c | 34 ++++++++++++++++++----------- 1 file changed, 21 insertions(+), 13 deletions(-) diff --git a/src/core/lib/iomgr/ev_epoll_linux.c b/src/core/lib/iomgr/ev_epoll_linux.c index 5460d727341..099f8e85b5b 100644 --- a/src/core/lib/iomgr/ev_epoll_linux.c +++ b/src/core/lib/iomgr/ev_epoll_linux.c @@ -1031,6 +1031,8 @@ static void fd_notify_on_write(grpc_exec_ctx *exec_ctx, grpc_fd *fd, */ GPR_TLS_DECL(g_current_thread_pollset); GPR_TLS_DECL(g_current_thread_worker); +static __thread bool g_initialized_sigmask; +static __thread sigset_t g_orig_sigmask; static void sig_handler(int sig_num) { #ifdef GRPC_EPOLL_DEBUG @@ -1388,7 +1390,6 @@ static grpc_error *pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, int timeout_ms = poll_deadline_to_millis_timeout(deadline, now); sigset_t new_mask; - sigset_t orig_mask; grpc_pollset_worker worker; worker.next = worker.prev = NULL; @@ -1423,21 +1424,28 @@ static grpc_error *pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, times *except* when it is in epoll_pwait(). This way, the worker never misses acting on a kick */ - sigemptyset(&new_mask); - sigaddset(&new_mask, grpc_wakeup_signal); - pthread_sigmask(SIG_BLOCK, &new_mask, &orig_mask); - sigdelset(&orig_mask, grpc_wakeup_signal); - /* new_mask: The new thread mask which blocks 'grpc_wakeup_signal'. This is - the mask used at all times *except during epoll_wait()*" - orig_mask: The thread mask which allows 'grpc_wakeup_signal' and this is - the mask to use *during epoll_wait()* - - The new_mask is set on the worker before it is added to the pollset (i.e - before it can be kicked) */ + if (!g_initialized_sigmask) { + sigemptyset(&new_mask); + sigaddset(&new_mask, grpc_wakeup_signal); + pthread_sigmask(SIG_BLOCK, &new_mask, &g_orig_sigmask); + sigdelset(&g_orig_sigmask, grpc_wakeup_signal); + g_initialized_sigmask = true; + /* new_mask: The new thread mask which blocks 'grpc_wakeup_signal'. + This is the mask used at all times *except during + epoll_wait()*" + g_orig_sigmask: The thread mask which allows 'grpc_wakeup_signal' and + this is + the mask to use *during epoll_wait()* + + The new_mask is set on the worker before it is added to the pollset + (i.e + before it can be kicked) */ + } push_front_worker(pollset, &worker); /* Add worker to pollset */ - pollset_work_and_unlock(exec_ctx, pollset, timeout_ms, &orig_mask, &error); + pollset_work_and_unlock(exec_ctx, pollset, timeout_ms, &g_orig_sigmask, + &error); grpc_exec_ctx_flush(exec_ctx); gpr_mu_lock(&pollset->mu); From 510ff69fa3dac27c71c29694020a25787eec7e03 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Mon, 27 Jun 2016 20:31:49 -0700 Subject: [PATCH 18/24] Fix comment formatting --- src/core/lib/iomgr/ev_epoll_linux.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/core/lib/iomgr/ev_epoll_linux.c b/src/core/lib/iomgr/ev_epoll_linux.c index 099f8e85b5b..475bd3c1dfe 100644 --- a/src/core/lib/iomgr/ev_epoll_linux.c +++ b/src/core/lib/iomgr/ev_epoll_linux.c @@ -1434,12 +1434,10 @@ static grpc_error *pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset, This is the mask used at all times *except during epoll_wait()*" g_orig_sigmask: The thread mask which allows 'grpc_wakeup_signal' and - this is - the mask to use *during epoll_wait()* + this is the mask to use *during epoll_wait()* The new_mask is set on the worker before it is added to the pollset - (i.e - before it can be kicked) */ + (i.e before it can be kicked) */ } push_front_worker(pollset, &worker); /* Add worker to pollset */ From b6960d068fe158dea537af1649b414348c3b66bc Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 27 Jun 2016 16:45:23 -0700 Subject: [PATCH 19/24] switch CoreCLR to preview2 --- .../dockerfile/test/csharp_coreclr_x64/Dockerfile.template | 2 +- tools/dockerfile/test/csharp_coreclr_x64/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/templates/tools/dockerfile/test/csharp_coreclr_x64/Dockerfile.template b/templates/tools/dockerfile/test/csharp_coreclr_x64/Dockerfile.template index 35782d6665f..9bf7794247b 100644 --- a/templates/tools/dockerfile/test/csharp_coreclr_x64/Dockerfile.template +++ b/templates/tools/dockerfile/test/csharp_coreclr_x64/Dockerfile.template @@ -29,7 +29,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - FROM microsoft/dotnet:1.0.0-preview1 + FROM microsoft/dotnet:1.0.0-preview2-sdk <%include file="../../apt_get_basic.include"/> <%include file="../../run_tests_addons.include"/> diff --git a/tools/dockerfile/test/csharp_coreclr_x64/Dockerfile b/tools/dockerfile/test/csharp_coreclr_x64/Dockerfile index 9dfc040d736..d499a708b07 100644 --- a/tools/dockerfile/test/csharp_coreclr_x64/Dockerfile +++ b/tools/dockerfile/test/csharp_coreclr_x64/Dockerfile @@ -27,7 +27,7 @@ # (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE # OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -FROM microsoft/dotnet:1.0.0-preview1 +FROM microsoft/dotnet:1.0.0-preview2-sdk # Install Git and basic packages. RUN apt-get update && apt-get install -y \ From 14a301ddab0521e3f276cd309f8acf7fce526a78 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 27 Jun 2016 17:45:29 -0700 Subject: [PATCH 20/24] fix coreclr linux build --- tools/run_tests/run_tests.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 3798bf4e650..78539eef2d4 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -522,7 +522,7 @@ class CSharpLanguage(object): if self.platform == 'linux': assembly_subdir += '/netstandard1.5/debian.8-x64' assembly_extension = '' - if self.platform == 'mac': + elif self.platform == 'mac': assembly_subdir += '/netstandard1.5/osx.10.11-x64' assembly_extension = '' else: From e8ab99d5e292ed7524643d61798cf7b20587457d Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 27 Jun 2016 17:46:25 -0700 Subject: [PATCH 21/24] workaround not necessary in preview2 --- tools/run_tests/build_csharp_coreclr.sh | 4 ---- 1 file changed, 4 deletions(-) diff --git a/tools/run_tests/build_csharp_coreclr.sh b/tools/run_tests/build_csharp_coreclr.sh index 68c19cb6c9d..733b1a2083c 100755 --- a/tools/run_tests/build_csharp_coreclr.sh +++ b/tools/run_tests/build_csharp_coreclr.sh @@ -36,7 +36,3 @@ cd $(dirname $0)/../../src/csharp dotnet restore . dotnet build -f netstandard1.5 --configuration $MSBUILD_CONFIG '**/project.json' - -# Grpc.IntegrationTesting doesn't get built by the previous command for some reason. -# TODO(jtattermusch): get rid of the hack -dotnet build -f netstandard1.5 --configuration $MSBUILD_CONFIG Grpc.IntegrationTesting/project.json From ecd2b0e74c7aeecec1aac95f765edc2e4ddd6520 Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 27 Jun 2016 18:07:08 -0700 Subject: [PATCH 22/24] share Version.cs among all project.json projects --- src/csharp/Grpc.Core/project.json | 1 + templates/src/csharp/Grpc.Core/project.json.template | 1 + 2 files changed, 2 insertions(+) diff --git a/src/csharp/Grpc.Core/project.json b/src/csharp/Grpc.Core/project.json index 4729a9346cb..5443147d78d 100644 --- a/src/csharp/Grpc.Core/project.json +++ b/src/csharp/Grpc.Core/project.json @@ -21,6 +21,7 @@ "build/native/bin/macosx_x64/": "../nativelibs/macosx_x64/libgrpc_csharp_ext.dylib" } }, + "shared": "Version.cs", "buildOptions": { "embed": [ "../../../etc/roots.pem" ] }, diff --git a/templates/src/csharp/Grpc.Core/project.json.template b/templates/src/csharp/Grpc.Core/project.json.template index 6f9197f572f..033efe8a2d4 100644 --- a/templates/src/csharp/Grpc.Core/project.json.template +++ b/templates/src/csharp/Grpc.Core/project.json.template @@ -23,6 +23,7 @@ "build/native/bin/macosx_x64/": "../nativelibs/macosx_x64/libgrpc_csharp_ext.dylib" } }, + "shared": "Version.cs", "buildOptions": { "embed": [ "../../../etc/roots.pem" ] }, From eb8bfc61e0f5ea3c911c9365fe26a89805d8f76a Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 27 Jun 2016 18:38:59 -0700 Subject: [PATCH 23/24] modify templates to sign C# coreclr projects and generate xmlDoc --- templates/src/csharp/Grpc.Auth/project.json.template | 6 ++++++ templates/src/csharp/Grpc.Core/project.json.template | 6 +++++- .../src/csharp/Grpc.HealthCheck/project.json.template | 6 ++++++ templates/src/csharp/build_options.include | 8 ++++++++ 4 files changed, 25 insertions(+), 1 deletion(-) diff --git a/templates/src/csharp/Grpc.Auth/project.json.template b/templates/src/csharp/Grpc.Auth/project.json.template index 90ad0eb0891..483e34c2e81 100644 --- a/templates/src/csharp/Grpc.Auth/project.json.template +++ b/templates/src/csharp/Grpc.Auth/project.json.template @@ -14,6 +14,12 @@ "requireLicenseAcceptance": false, "tags": [ "gRPC RPC Protocol HTTP/2 Auth OAuth2" ], }, + "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true + }, "dependencies": { "Grpc.Core": "${settings.csharp_version}", "Google.Apis.Auth": "1.11.1" diff --git a/templates/src/csharp/Grpc.Core/project.json.template b/templates/src/csharp/Grpc.Core/project.json.template index 033efe8a2d4..e1c05fc8a35 100644 --- a/templates/src/csharp/Grpc.Core/project.json.template +++ b/templates/src/csharp/Grpc.Core/project.json.template @@ -25,7 +25,11 @@ }, "shared": "Version.cs", "buildOptions": { - "embed": [ "../../../etc/roots.pem" ] + "embed": [ "../../../etc/roots.pem" ], + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true }, "dependencies": { "Ix-Async": "1.2.5" diff --git a/templates/src/csharp/Grpc.HealthCheck/project.json.template b/templates/src/csharp/Grpc.HealthCheck/project.json.template index 59073af7eec..1f2cc798ba1 100644 --- a/templates/src/csharp/Grpc.HealthCheck/project.json.template +++ b/templates/src/csharp/Grpc.HealthCheck/project.json.template @@ -14,6 +14,12 @@ "requireLicenseAcceptance": false, "tags": [ "gRPC health check" ] }, + "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true + }, "dependencies": { "Grpc.Core": "${settings.csharp_version}", "Google.Protobuf": "3.0.0-beta3" diff --git a/templates/src/csharp/build_options.include b/templates/src/csharp/build_options.include index 468d281618c..0af76b81b27 100644 --- a/templates/src/csharp/build_options.include +++ b/templates/src/csharp/build_options.include @@ -8,6 +8,10 @@ "configurations": { "Debug": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { % if includeData: "include": "data/*", @@ -23,6 +27,10 @@ }, "Release": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { % if includeData: "include": "data/*", From 652c00043f94e532148acf2210ad0325310ab3cb Mon Sep 17 00:00:00 2001 From: Jan Tattermusch Date: Mon, 27 Jun 2016 18:39:30 -0700 Subject: [PATCH 24/24] regenerate files --- src/csharp/Grpc.Auth/project.json | 6 ++++++ src/csharp/Grpc.Core.Tests/project.json | 8 ++++++++ src/csharp/Grpc.Core/project.json | 6 +++++- src/csharp/Grpc.Examples.MathClient/project.json | 8 ++++++++ src/csharp/Grpc.Examples.MathServer/project.json | 8 ++++++++ src/csharp/Grpc.Examples.Tests/project.json | 8 ++++++++ src/csharp/Grpc.HealthCheck.Tests/project.json | 8 ++++++++ src/csharp/Grpc.HealthCheck/project.json | 6 ++++++ src/csharp/Grpc.IntegrationTesting.Client/project.json | 8 ++++++++ src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json | 8 ++++++++ src/csharp/Grpc.IntegrationTesting.Server/project.json | 8 ++++++++ .../Grpc.IntegrationTesting.StressClient/project.json | 8 ++++++++ src/csharp/Grpc.IntegrationTesting/project.json | 8 ++++++++ 13 files changed, 97 insertions(+), 1 deletion(-) diff --git a/src/csharp/Grpc.Auth/project.json b/src/csharp/Grpc.Auth/project.json index 4c5c960204e..22414133595 100644 --- a/src/csharp/Grpc.Auth/project.json +++ b/src/csharp/Grpc.Auth/project.json @@ -12,6 +12,12 @@ "requireLicenseAcceptance": false, "tags": [ "gRPC RPC Protocol HTTP/2 Auth OAuth2" ], }, + "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true + }, "dependencies": { "Grpc.Core": "0.16.0-dev", "Google.Apis.Auth": "1.11.1" diff --git a/src/csharp/Grpc.Core.Tests/project.json b/src/csharp/Grpc.Core.Tests/project.json index 3ad081df39e..6402912d05f 100644 --- a/src/csharp/Grpc.Core.Tests/project.json +++ b/src/csharp/Grpc.Core.Tests/project.json @@ -5,6 +5,10 @@ "configurations": { "Debug": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "mappings": { "nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll", @@ -17,6 +21,10 @@ }, "Release": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "mappings": { "nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll", diff --git a/src/csharp/Grpc.Core/project.json b/src/csharp/Grpc.Core/project.json index 5443147d78d..775764e1d71 100644 --- a/src/csharp/Grpc.Core/project.json +++ b/src/csharp/Grpc.Core/project.json @@ -23,7 +23,11 @@ }, "shared": "Version.cs", "buildOptions": { - "embed": [ "../../../etc/roots.pem" ] + "embed": [ "../../../etc/roots.pem" ], + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true }, "dependencies": { "Ix-Async": "1.2.5" diff --git a/src/csharp/Grpc.Examples.MathClient/project.json b/src/csharp/Grpc.Examples.MathClient/project.json index b254f15af87..378fc8cf8bf 100644 --- a/src/csharp/Grpc.Examples.MathClient/project.json +++ b/src/csharp/Grpc.Examples.MathClient/project.json @@ -5,6 +5,10 @@ "configurations": { "Debug": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "mappings": { "nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll", @@ -17,6 +21,10 @@ }, "Release": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "mappings": { "nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll", diff --git a/src/csharp/Grpc.Examples.MathServer/project.json b/src/csharp/Grpc.Examples.MathServer/project.json index b254f15af87..378fc8cf8bf 100644 --- a/src/csharp/Grpc.Examples.MathServer/project.json +++ b/src/csharp/Grpc.Examples.MathServer/project.json @@ -5,6 +5,10 @@ "configurations": { "Debug": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "mappings": { "nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll", @@ -17,6 +21,10 @@ }, "Release": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "mappings": { "nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll", diff --git a/src/csharp/Grpc.Examples.Tests/project.json b/src/csharp/Grpc.Examples.Tests/project.json index d2779e814f9..6af06454410 100644 --- a/src/csharp/Grpc.Examples.Tests/project.json +++ b/src/csharp/Grpc.Examples.Tests/project.json @@ -5,6 +5,10 @@ "configurations": { "Debug": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "mappings": { "nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll", @@ -17,6 +21,10 @@ }, "Release": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "mappings": { "nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll", diff --git a/src/csharp/Grpc.HealthCheck.Tests/project.json b/src/csharp/Grpc.HealthCheck.Tests/project.json index 74599bd4b9e..0e42fe2da63 100644 --- a/src/csharp/Grpc.HealthCheck.Tests/project.json +++ b/src/csharp/Grpc.HealthCheck.Tests/project.json @@ -5,6 +5,10 @@ "configurations": { "Debug": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "mappings": { "nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Debug/grpc_csharp_ext.dll", @@ -17,6 +21,10 @@ }, "Release": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "mappings": { "nativelibs/windows_x64/grpc_csharp_ext.dll": "../../../vsprojects/x64/Release/grpc_csharp_ext.dll", diff --git a/src/csharp/Grpc.HealthCheck/project.json b/src/csharp/Grpc.HealthCheck/project.json index c4895c2ad3c..f2e1ce5a658 100644 --- a/src/csharp/Grpc.HealthCheck/project.json +++ b/src/csharp/Grpc.HealthCheck/project.json @@ -12,6 +12,12 @@ "requireLicenseAcceptance": false, "tags": [ "gRPC health check" ] }, + "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true + }, "dependencies": { "Grpc.Core": "0.16.0-dev", "Google.Protobuf": "3.0.0-beta3" diff --git a/src/csharp/Grpc.IntegrationTesting.Client/project.json b/src/csharp/Grpc.IntegrationTesting.Client/project.json index e5ba04d7173..827e5a8e0fb 100644 --- a/src/csharp/Grpc.IntegrationTesting.Client/project.json +++ b/src/csharp/Grpc.IntegrationTesting.Client/project.json @@ -5,6 +5,10 @@ "configurations": { "Debug": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "include": "data/*", "mappings": { @@ -18,6 +22,10 @@ }, "Release": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "include": "data/*", "mappings": { diff --git a/src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json b/src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json index e5ba04d7173..827e5a8e0fb 100644 --- a/src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json +++ b/src/csharp/Grpc.IntegrationTesting.QpsWorker/project.json @@ -5,6 +5,10 @@ "configurations": { "Debug": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "include": "data/*", "mappings": { @@ -18,6 +22,10 @@ }, "Release": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "include": "data/*", "mappings": { diff --git a/src/csharp/Grpc.IntegrationTesting.Server/project.json b/src/csharp/Grpc.IntegrationTesting.Server/project.json index e5ba04d7173..827e5a8e0fb 100644 --- a/src/csharp/Grpc.IntegrationTesting.Server/project.json +++ b/src/csharp/Grpc.IntegrationTesting.Server/project.json @@ -5,6 +5,10 @@ "configurations": { "Debug": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "include": "data/*", "mappings": { @@ -18,6 +22,10 @@ }, "Release": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "include": "data/*", "mappings": { diff --git a/src/csharp/Grpc.IntegrationTesting.StressClient/project.json b/src/csharp/Grpc.IntegrationTesting.StressClient/project.json index e5ba04d7173..827e5a8e0fb 100644 --- a/src/csharp/Grpc.IntegrationTesting.StressClient/project.json +++ b/src/csharp/Grpc.IntegrationTesting.StressClient/project.json @@ -5,6 +5,10 @@ "configurations": { "Debug": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "include": "data/*", "mappings": { @@ -18,6 +22,10 @@ }, "Release": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "include": "data/*", "mappings": { diff --git a/src/csharp/Grpc.IntegrationTesting/project.json b/src/csharp/Grpc.IntegrationTesting/project.json index 3493ab0c228..9a364f2ff76 100644 --- a/src/csharp/Grpc.IntegrationTesting/project.json +++ b/src/csharp/Grpc.IntegrationTesting/project.json @@ -5,6 +5,10 @@ "configurations": { "Debug": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "include": "data/*", "mappings": { @@ -18,6 +22,10 @@ }, "Release": { "buildOptions": { + "define": [ "SIGNED" ], + "keyFile": "../keys/Grpc.snk", + "publicSign": true, + "xmlDoc": true, "copyToOutput": { "include": "data/*", "mappings": {