From 6953529365ee07f6cece0290f490144a0bf24999 Mon Sep 17 00:00:00 2001 From: Robbie Shade Date: Fri, 10 Jul 2015 14:27:34 -0400 Subject: Updated build.json, regenerated project files. --- vsprojects/grpc_unsecure/grpc_unsecure.vcxproj | 3 +++ vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters | 6 ++++++ 2 files changed, 9 insertions(+) (limited to 'vsprojects/grpc_unsecure') diff --git a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj index 4ead6f8d98..2a28f41ca4 100644 --- a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj @@ -207,6 +207,7 @@ + @@ -362,6 +363,8 @@ + + diff --git a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters index 45ca1f7c33..3019f3fe81 100644 --- a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -166,6 +166,9 @@ src\core\iomgr + + src\core\iomgr + src\core\iomgr @@ -512,6 +515,9 @@ src\core\iomgr + + src\core\iomgr + src\core\iomgr -- cgit v1.2.3 From 7adbb643072af7b6dc0f09298fa44b988118df01 Mon Sep 17 00:00:00 2001 From: Hongyu Chen Date: Tue, 11 Aug 2015 16:00:32 -0700 Subject: Build file changes --- BUILD | 3 ++ Makefile | 2 ++ build.json | 1 + gRPC.podspec | 1 + src/core/channel/census_filter.c | 38 ++++++++-------------- tools/doxygen/Doxyfile.core.internal | 1 + tools/run_tests/sources_and_headers.json | 2 ++ vsprojects/grpc/grpc.vcxproj | 2 ++ vsprojects/grpc/grpc.vcxproj.filters | 3 ++ vsprojects/grpc_unsecure/grpc_unsecure.vcxproj | 2 ++ .../grpc_unsecure/grpc_unsecure.vcxproj.filters | 3 ++ 11 files changed, 33 insertions(+), 25 deletions(-) (limited to 'vsprojects/grpc_unsecure') diff --git a/BUILD b/BUILD index dcabd648e4..2cf64dc9cf 100644 --- a/BUILD +++ b/BUILD @@ -268,6 +268,7 @@ cc_library( "src/core/tsi/ssl_transport_security.c", "src/core/tsi/transport_security.c", "src/core/census/grpc_context.c", + "src/core/channel/census_filter.c", "src/core/channel/channel_args.c", "src/core/channel/channel_stack.c", "src/core/channel/client_channel.c", @@ -511,6 +512,7 @@ cc_library( "src/core/census/rpc_stat_id.h", "src/core/surface/init_unsecure.c", "src/core/census/grpc_context.c", + "src/core/channel/census_filter.c", "src/core/channel/channel_args.c", "src/core/channel/channel_stack.c", "src/core/channel/client_channel.c", @@ -998,6 +1000,7 @@ objc_library( "src/core/tsi/ssl_transport_security.c", "src/core/tsi/transport_security.c", "src/core/census/grpc_context.c", + "src/core/channel/census_filter.c", "src/core/channel/channel_args.c", "src/core/channel/channel_stack.c", "src/core/channel/client_channel.c", diff --git a/Makefile b/Makefile index 181194f78f..06c16478a9 100644 --- a/Makefile +++ b/Makefile @@ -3977,6 +3977,7 @@ LIBGRPC_SRC = \ src/core/tsi/ssl_transport_security.c \ src/core/tsi/transport_security.c \ src/core/census/grpc_context.c \ + src/core/channel/census_filter.c \ src/core/channel/channel_args.c \ src/core/channel/channel_stack.c \ src/core/channel/client_channel.c \ @@ -4249,6 +4250,7 @@ endif LIBGRPC_UNSECURE_SRC = \ src/core/surface/init_unsecure.c \ src/core/census/grpc_context.c \ + src/core/channel/census_filter.c \ src/core/channel/channel_args.c \ src/core/channel/channel_stack.c \ src/core/channel/client_channel.c \ diff --git a/build.json b/build.json index 515cecdc5a..8636c84db3 100644 --- a/build.json +++ b/build.json @@ -217,6 +217,7 @@ ], "src": [ "src/core/census/grpc_context.c", + "src/core/channel/census_filter.c", "src/core/channel/channel_args.c", "src/core/channel/channel_stack.c", "src/core/channel/client_channel.c", diff --git a/gRPC.podspec b/gRPC.podspec index 12ce7c1e7b..d1e95a1652 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -277,6 +277,7 @@ Pod::Spec.new do |s| 'src/core/tsi/ssl_transport_security.c', 'src/core/tsi/transport_security.c', 'src/core/census/grpc_context.c', + 'src/core/channel/census_filter.c', 'src/core/channel/channel_args.c', 'src/core/channel/channel_stack.c', 'src/core/channel/client_channel.c', diff --git a/src/core/channel/census_filter.c b/src/core/channel/census_filter.c index d996c3475e..86bde85d12 100644 --- a/src/core/channel/census_filter.c +++ b/src/core/channel/census_filter.c @@ -47,13 +47,12 @@ typedef struct call_data { census_op_id op_id; - census_rpc_stats stats; + /*census_rpc_stats stats;*/ gpr_timespec start_ts; /* recv callback */ grpc_stream_op_buffer* recv_ops; - void (*on_done_recv)(void* user_data, int success); - void* recv_user_data; + grpc_iomgr_closure* on_done_recv; } call_data; typedef struct channel_data { @@ -108,7 +107,7 @@ static void server_on_done_recv(void* ptr, int success) { if (success) { extract_and_annotate_method_tag(calld->recv_ops, calld, chand); } - calld->on_done_recv(calld->recv_user_data, success); + calld->on_done_recv->cb(calld->on_done_recv->cb_arg, success); } static void server_mutate_op(grpc_call_element* elem, @@ -118,9 +117,7 @@ static void server_mutate_op(grpc_call_element* elem, /* substitute our callback for the op callback */ calld->recv_ops = op->recv_ops; calld->on_done_recv = op->on_done_recv; - calld->recv_user_data = op->recv_user_data; - op->on_done_recv = server_on_done_recv; - op->recv_user_data = elem; + op->on_done_recv = calld->on_done_recv; } } @@ -132,19 +129,6 @@ static void server_start_transport_op(grpc_call_element* elem, grpc_call_next_op(elem, op); } -static void channel_op(grpc_channel_element* elem, - grpc_channel_element* from_elem, grpc_channel_op* op) { - switch (op->type) { - case GRPC_TRANSPORT_CLOSED: - /* TODO(hongyu): Annotate trace information for all calls of the channel - */ - break; - default: - break; - } - grpc_channel_next_op(elem, op); -} - static void client_init_call_elem(grpc_call_element* elem, const void* server_transport_data, grpc_transport_stream_op* initial_op) { @@ -171,6 +155,7 @@ static void server_init_call_elem(grpc_call_element* elem, init_rpc_stats(&d->stats); d->start_ts = gpr_now(GPR_CLOCK_REALTIME); d->op_id = census_tracing_start_op(); + grpc_iomgr_closure_init(d->on_done_recv, server_on_done_recv, elem); if (initial_op) server_mutate_op(elem, initial_op); } @@ -179,18 +164,19 @@ static void server_destroy_call_elem(grpc_call_element* elem) { GPR_ASSERT(d != NULL); d->stats.elapsed_time_ms = gpr_timespec_to_micros( gpr_time_sub(gpr_now(GPR_CLOCK_REALTIME), d->start_ts)); - census_record_rpc_server_stats(d->op_id, &d->stats); + census_record_stats(d->ctxt, stats, nstats); + /*census_record_rpc_server_stats(d->op_id, &d->stats);*/ census_tracing_end_op(d->op_id); } -static void init_channel_elem(grpc_channel_element* elem, +static void init_channel_elem(grpc_channel_element* elem, grpc_channel* master, const grpc_channel_args* args, grpc_mdctx* mdctx, int is_first, int is_last) { channel_data* chand = elem->channel_data; GPR_ASSERT(chand != NULL); GPR_ASSERT(!is_first); GPR_ASSERT(!is_last); - chand->path_str = grpc_mdstr_from_string(mdctx, ":path"); + chand->path_str = grpc_mdstr_from_string(mdctx, ":path", 0); } static void destroy_channel_elem(grpc_channel_element* elem) { @@ -203,22 +189,24 @@ static void destroy_channel_elem(grpc_channel_element* elem) { const grpc_channel_filter grpc_client_census_filter = { client_start_transport_op, - channel_op, + grpc_channel_next_op, sizeof(call_data), client_init_call_elem, client_destroy_call_elem, sizeof(channel_data), init_channel_elem, destroy_channel_elem, + grpc_call_next_get_peer, "census-client"}; const grpc_channel_filter grpc_server_census_filter = { server_start_transport_op, - channel_op, + grpc_channel_next_op, sizeof(call_data), server_init_call_elem, server_destroy_call_elem, sizeof(channel_data), init_channel_elem, destroy_channel_elem, + grpc_call_next_get_peer, "census-server"}; diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index cbf5c50a65..46c01e5e33 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -903,6 +903,7 @@ src/core/tsi/fake_transport_security.c \ src/core/tsi/ssl_transport_security.c \ src/core/tsi/transport_security.c \ src/core/census/grpc_context.c \ +src/core/channel/census_filter.c \ src/core/channel/channel_args.c \ src/core/channel/channel_stack.c \ src/core/channel/client_channel.c \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 5d23bf9e88..4a71ef90c9 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -12353,6 +12353,7 @@ "src/core/census/initialize.c", "src/core/census/record_stat.c", "src/core/census/rpc_stat_id.h", + "src/core/channel/census_filter.c", "src/core/channel/census_filter.h", "src/core/channel/channel_args.c", "src/core/channel/channel_args.h", @@ -12810,6 +12811,7 @@ "src/core/census/initialize.c", "src/core/census/record_stat.c", "src/core/census/rpc_stat_id.h", + "src/core/channel/census_filter.c", "src/core/channel/census_filter.h", "src/core/channel/channel_args.c", "src/core/channel/channel_args.h", diff --git a/vsprojects/grpc/grpc.vcxproj b/vsprojects/grpc/grpc.vcxproj index 067f341b95..a87ad29d49 100644 --- a/vsprojects/grpc/grpc.vcxproj +++ b/vsprojects/grpc/grpc.vcxproj @@ -389,6 +389,8 @@ + + diff --git a/vsprojects/grpc/grpc.vcxproj.filters b/vsprojects/grpc/grpc.vcxproj.filters index fcc40c3a4b..c8812faa85 100644 --- a/vsprojects/grpc/grpc.vcxproj.filters +++ b/vsprojects/grpc/grpc.vcxproj.filters @@ -67,6 +67,9 @@ src\core\census + + src\core\channel + src\core\channel diff --git a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj index b95658b70c..06da784323 100644 --- a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj @@ -332,6 +332,8 @@ + + diff --git a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters index 05e9d139e0..2d10960a79 100644 --- a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -7,6 +7,9 @@ src\core\census + + src\core\channel + src\core\channel -- cgit v1.2.3 From fdc1dc744baa194f220a5d103ca73dde290c7d4b Mon Sep 17 00:00:00 2001 From: Hongyu Chen Date: Wed, 19 Aug 2015 16:58:12 -0700 Subject: Move census_filters from .../channel to .../census --- BUILD | 12 +- Makefile | 4 +- build.json | 4 +- gRPC.podspec | 6 +- src/core/census/census_filter.c | 197 +++++++++++++++++++++ src/core/census/census_filter.h | 44 +++++ src/core/channel/census_filter.c | 197 --------------------- src/core/channel/census_filter.h | 44 ----- src/core/surface/channel_create.c | 2 +- src/core/surface/secure_channel_create.c | 2 +- src/core/surface/server.c | 2 +- tools/doxygen/Doxyfile.core.internal | 4 +- tools/run_tests/sources_and_headers.json | 12 +- vsprojects/grpc/grpc.vcxproj | 6 +- vsprojects/grpc/grpc.vcxproj.filters | 10 +- vsprojects/grpc_unsecure/grpc_unsecure.vcxproj | 6 +- .../grpc_unsecure/grpc_unsecure.vcxproj.filters | 10 +- 17 files changed, 281 insertions(+), 281 deletions(-) create mode 100644 src/core/census/census_filter.c create mode 100644 src/core/census/census_filter.h delete mode 100644 src/core/channel/census_filter.c delete mode 100644 src/core/channel/census_filter.h (limited to 'vsprojects/grpc_unsecure') diff --git a/BUILD b/BUILD index d38b9cee10..b24ba311e2 100644 --- a/BUILD +++ b/BUILD @@ -145,7 +145,7 @@ cc_library( "src/core/tsi/ssl_transport_security.h", "src/core/tsi/transport_security.h", "src/core/tsi/transport_security_interface.h", - "src/core/channel/census_filter.h", + "src/core/census/census_filter.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", "src/core/channel/client_channel.h", @@ -267,8 +267,8 @@ cc_library( "src/core/tsi/fake_transport_security.c", "src/core/tsi/ssl_transport_security.c", "src/core/tsi/transport_security.c", + "src/core/census/census_filter.c", "src/core/census/grpc_context.c", - "src/core/channel/census_filter.c", "src/core/channel/channel_args.c", "src/core/channel/channel_stack.c", "src/core/channel/client_channel.c", @@ -409,7 +409,7 @@ cc_library( cc_library( name = "grpc_unsecure", srcs = [ - "src/core/channel/census_filter.h", + "src/core/census/census_filter.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", "src/core/channel/client_channel.h", @@ -511,8 +511,8 @@ cc_library( "src/core/census/context.h", "src/core/census/rpc_stat_id.h", "src/core/surface/init_unsecure.c", + "src/core/census/census_filter.c", "src/core/census/grpc_context.c", - "src/core/channel/census_filter.c", "src/core/channel/channel_args.c", "src/core/channel/channel_stack.c", "src/core/channel/client_channel.c", @@ -997,8 +997,8 @@ objc_library( "src/core/tsi/fake_transport_security.c", "src/core/tsi/ssl_transport_security.c", "src/core/tsi/transport_security.c", + "src/core/census/census_filter.c", "src/core/census/grpc_context.c", - "src/core/channel/census_filter.c", "src/core/channel/channel_args.c", "src/core/channel/channel_stack.c", "src/core/channel/client_channel.c", @@ -1137,7 +1137,7 @@ objc_library( "src/core/tsi/ssl_transport_security.h", "src/core/tsi/transport_security.h", "src/core/tsi/transport_security_interface.h", - "src/core/channel/census_filter.h", + "src/core/census/census_filter.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", "src/core/channel/client_channel.h", diff --git a/Makefile b/Makefile index aabf1bbd04..995a4954e4 100644 --- a/Makefile +++ b/Makefile @@ -3976,8 +3976,8 @@ LIBGRPC_SRC = \ src/core/tsi/fake_transport_security.c \ src/core/tsi/ssl_transport_security.c \ src/core/tsi/transport_security.c \ + src/core/census/census_filter.c \ src/core/census/grpc_context.c \ - src/core/channel/census_filter.c \ src/core/channel/channel_args.c \ src/core/channel/channel_stack.c \ src/core/channel/client_channel.c \ @@ -4249,8 +4249,8 @@ endif LIBGRPC_UNSECURE_SRC = \ src/core/surface/init_unsecure.c \ + src/core/census/census_filter.c \ src/core/census/grpc_context.c \ - src/core/channel/census_filter.c \ src/core/channel/channel_args.c \ src/core/channel/channel_stack.c \ src/core/channel/client_channel.c \ diff --git a/build.json b/build.json index ab6a39a20f..3e3e71a684 100644 --- a/build.json +++ b/build.json @@ -114,7 +114,7 @@ "include/grpc/status.h" ], "headers": [ - "src/core/channel/census_filter.h", + "src/core/census/census_filter.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", "src/core/channel/client_channel.h", @@ -215,8 +215,8 @@ "src/core/transport/transport_impl.h" ], "src": [ + "src/core/census/census_filter.c", "src/core/census/grpc_context.c", - "src/core/channel/census_filter.c", "src/core/channel/channel_args.c", "src/core/channel/channel_stack.c", "src/core/channel/client_channel.c", diff --git a/gRPC.podspec b/gRPC.podspec index d1e95a1652..b57960a896 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -147,7 +147,7 @@ Pod::Spec.new do |s| 'src/core/tsi/ssl_transport_security.h', 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_interface.h', - 'src/core/channel/census_filter.h', + 'src/core/census/census_filter.h', 'src/core/channel/channel_args.h', 'src/core/channel/channel_stack.h', 'src/core/channel/client_channel.h', @@ -276,8 +276,8 @@ Pod::Spec.new do |s| 'src/core/tsi/fake_transport_security.c', 'src/core/tsi/ssl_transport_security.c', 'src/core/tsi/transport_security.c', + 'src/core/census/census_filter.c', 'src/core/census/grpc_context.c', - 'src/core/channel/census_filter.c', 'src/core/channel/channel_args.c', 'src/core/channel/channel_stack.c', 'src/core/channel/client_channel.c', @@ -415,7 +415,7 @@ Pod::Spec.new do |s| 'src/core/tsi/ssl_transport_security.h', 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_interface.h', - 'src/core/channel/census_filter.h', + 'src/core/census/census_filter.h', 'src/core/channel/channel_args.h', 'src/core/channel/channel_stack.h', 'src/core/channel/client_channel.h', diff --git a/src/core/census/census_filter.c b/src/core/census/census_filter.c new file mode 100644 index 0000000000..31db686cf3 --- /dev/null +++ b/src/core/census/census_filter.c @@ -0,0 +1,197 @@ +/* + * + * 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/census/census_filter.h" + +#include +#include + +#include "include/grpc/census.h" +#include "src/core/census/rpc_stat_id.h" +#include "src/core/channel/channel_stack.h" +#include "src/core/channel/noop_filter.h" +#include "src/core/statistics/census_interface.h" +#include "src/core/statistics/census_rpc_stats.h" +#include +#include +#include +#include + +typedef struct call_data { + census_op_id op_id; + census_context* ctxt; + gpr_timespec start_ts; + int error; + + /* recv callback */ + grpc_stream_op_buffer* recv_ops; + grpc_iomgr_closure* on_done_recv; +} call_data; + +typedef struct channel_data { + grpc_mdstr* path_str; /* pointer to meta data str with key == ":path" */ +} channel_data; + +static void extract_and_annotate_method_tag(grpc_stream_op_buffer* sopb, + call_data* calld, + channel_data* chand) { + grpc_linked_mdelem* m; + size_t i; + for (i = 0; i < sopb->nops; i++) { + grpc_stream_op* op = &sopb->ops[i]; + if (op->type != GRPC_OP_METADATA) continue; + for (m = op->data.metadata.list.head; m != NULL; m = m->next) { + if (m->md->key == chand->path_str) { + gpr_log(GPR_DEBUG, "%s", + (const char*)GPR_SLICE_START_PTR(m->md->value->slice)); + /* Add method tag here */ + } + } + } +} + +static void client_mutate_op(grpc_call_element* elem, + grpc_transport_stream_op* op) { + call_data* calld = elem->call_data; + channel_data* chand = elem->channel_data; + if (op->send_ops) { + extract_and_annotate_method_tag(op->send_ops, calld, chand); + } +} + +static void client_start_transport_op(grpc_call_element* elem, + grpc_transport_stream_op* op) { + client_mutate_op(elem, op); + grpc_call_next_op(elem, op); +} + +static void server_on_done_recv(void* ptr, int success) { + grpc_call_element* elem = ptr; + call_data* calld = elem->call_data; + channel_data* chand = elem->channel_data; + if (success) { + extract_and_annotate_method_tag(calld->recv_ops, calld, chand); + } + calld->on_done_recv->cb(calld->on_done_recv->cb_arg, success); +} + +static void server_mutate_op(grpc_call_element* elem, + grpc_transport_stream_op* op) { + call_data* calld = elem->call_data; + if (op->recv_ops) { + /* substitute our callback for the op callback */ + calld->recv_ops = op->recv_ops; + calld->on_done_recv = op->on_done_recv; + op->on_done_recv = calld->on_done_recv; + } +} + +static void server_start_transport_op(grpc_call_element* elem, + grpc_transport_stream_op* op) { + call_data* calld = elem->call_data; + GPR_ASSERT((calld->op_id.upper != 0) || (calld->op_id.lower != 0)); + server_mutate_op(elem, op); + grpc_call_next_op(elem, op); +} + +static void client_init_call_elem(grpc_call_element* elem, + const void* server_transport_data, + grpc_transport_stream_op* initial_op) { + call_data* d = elem->call_data; + GPR_ASSERT(d != NULL); + d->start_ts = gpr_now(GPR_CLOCK_REALTIME); + if (initial_op) client_mutate_op(elem, initial_op); +} + +static void client_destroy_call_elem(grpc_call_element* elem) { + call_data* d = elem->call_data; + GPR_ASSERT(d != NULL); + /* TODO(hongyu): record rpc client stats and census_rpc_end_op here */ +} + +static void server_init_call_elem(grpc_call_element* elem, + const void* server_transport_data, + grpc_transport_stream_op* initial_op) { + call_data* d = elem->call_data; + GPR_ASSERT(d != NULL); + d->start_ts = gpr_now(GPR_CLOCK_REALTIME); + /* TODO(hongyu): call census_tracing_start_op here. */ + grpc_iomgr_closure_init(d->on_done_recv, server_on_done_recv, elem); + if (initial_op) server_mutate_op(elem, initial_op); +} + +static void server_destroy_call_elem(grpc_call_element* elem) { + call_data* d = elem->call_data; + GPR_ASSERT(d != NULL); + /* TODO(hongyu): record rpc server stats and census_tracing_end_op here */ +} + +static void init_channel_elem(grpc_channel_element* elem, grpc_channel* master, + const grpc_channel_args* args, grpc_mdctx* mdctx, + int is_first, int is_last) { + channel_data* chand = elem->channel_data; + GPR_ASSERT(chand != NULL); + chand->path_str = grpc_mdstr_from_string(mdctx, ":path", 0); +} + +static void destroy_channel_elem(grpc_channel_element* elem) { + channel_data* chand = elem->channel_data; + GPR_ASSERT(chand != NULL); + if (chand->path_str != NULL) { + GRPC_MDSTR_UNREF(chand->path_str); + } +} + +const grpc_channel_filter grpc_client_census_filter = { + client_start_transport_op, + grpc_channel_next_op, + sizeof(call_data), + client_init_call_elem, + client_destroy_call_elem, + sizeof(channel_data), + init_channel_elem, + destroy_channel_elem, + grpc_call_next_get_peer, + "census-client"}; + +const grpc_channel_filter grpc_server_census_filter = { + server_start_transport_op, + grpc_channel_next_op, + sizeof(call_data), + server_init_call_elem, + server_destroy_call_elem, + sizeof(channel_data), + init_channel_elem, + destroy_channel_elem, + grpc_call_next_get_peer, + "census-server"}; diff --git a/src/core/census/census_filter.h b/src/core/census/census_filter.h new file mode 100644 index 0000000000..4f9759f0db --- /dev/null +++ b/src/core/census/census_filter.h @@ -0,0 +1,44 @@ +/* + * + * 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_INTERNAL_CORE_CHANNEL_CENSUS_FILTER_H +#define GRPC_INTERNAL_CORE_CHANNEL_CENSUS_FILTER_H + +#include "src/core/channel/channel_stack.h" + +/* Census filters: provides tracing and stats collection functionalities. It + needs to reside right below the surface filter in the channel stack. */ +extern const grpc_channel_filter grpc_client_census_filter; +extern const grpc_channel_filter grpc_server_census_filter; + +#endif /* GRPC_INTERNAL_CORE_CHANNEL_CENSUS_FILTER_H */ diff --git a/src/core/channel/census_filter.c b/src/core/channel/census_filter.c deleted file mode 100644 index 53d70be356..0000000000 --- a/src/core/channel/census_filter.c +++ /dev/null @@ -1,197 +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/channel/census_filter.h" - -#include -#include - -#include "include/grpc/census.h" -#include "src/core/census/rpc_stat_id.h" -#include "src/core/channel/channel_stack.h" -#include "src/core/channel/noop_filter.h" -#include "src/core/statistics/census_interface.h" -#include "src/core/statistics/census_rpc_stats.h" -#include -#include -#include -#include - -typedef struct call_data { - census_op_id op_id; - census_context* ctxt; - gpr_timespec start_ts; - int error; - - /* recv callback */ - grpc_stream_op_buffer* recv_ops; - grpc_iomgr_closure* on_done_recv; -} call_data; - -typedef struct channel_data { - grpc_mdstr* path_str; /* pointer to meta data str with key == ":path" */ -} channel_data; - -static void extract_and_annotate_method_tag(grpc_stream_op_buffer* sopb, - call_data* calld, - channel_data* chand) { - grpc_linked_mdelem* m; - size_t i; - for (i = 0; i < sopb->nops; i++) { - grpc_stream_op* op = &sopb->ops[i]; - if (op->type != GRPC_OP_METADATA) continue; - for (m = op->data.metadata.list.head; m != NULL; m = m->next) { - if (m->md->key == chand->path_str) { - gpr_log(GPR_DEBUG, "%s", - (const char*)GPR_SLICE_START_PTR(m->md->value->slice)); - /* Add method tag here */ - } - } - } -} - -static void client_mutate_op(grpc_call_element* elem, - grpc_transport_stream_op* op) { - call_data* calld = elem->call_data; - channel_data* chand = elem->channel_data; - if (op->send_ops) { - extract_and_annotate_method_tag(op->send_ops, calld, chand); - } -} - -static void client_start_transport_op(grpc_call_element* elem, - grpc_transport_stream_op* op) { - client_mutate_op(elem, op); - grpc_call_next_op(elem, op); -} - -static void server_on_done_recv(void* ptr, int success) { - grpc_call_element* elem = ptr; - call_data* calld = elem->call_data; - channel_data* chand = elem->channel_data; - if (success) { - extract_and_annotate_method_tag(calld->recv_ops, calld, chand); - } - calld->on_done_recv->cb(calld->on_done_recv->cb_arg, success); -} - -static void server_mutate_op(grpc_call_element* elem, - grpc_transport_stream_op* op) { - call_data* calld = elem->call_data; - if (op->recv_ops) { - /* substitute our callback for the op callback */ - calld->recv_ops = op->recv_ops; - calld->on_done_recv = op->on_done_recv; - op->on_done_recv = calld->on_done_recv; - } -} - -static void server_start_transport_op(grpc_call_element* elem, - grpc_transport_stream_op* op) { - call_data* calld = elem->call_data; - GPR_ASSERT((calld->op_id.upper != 0) || (calld->op_id.lower != 0)); - server_mutate_op(elem, op); - grpc_call_next_op(elem, op); -} - -static void client_init_call_elem(grpc_call_element* elem, - const void* server_transport_data, - grpc_transport_stream_op* initial_op) { - call_data* d = elem->call_data; - GPR_ASSERT(d != NULL); - d->start_ts = gpr_now(GPR_CLOCK_REALTIME); - if (initial_op) client_mutate_op(elem, initial_op); -} - -static void client_destroy_call_elem(grpc_call_element* elem) { - call_data* d = elem->call_data; - GPR_ASSERT(d != NULL); - /* TODO(hongyu): record rpc client stats and census_rpc_end_op here */ -} - -static void server_init_call_elem(grpc_call_element* elem, - const void* server_transport_data, - grpc_transport_stream_op* initial_op) { - call_data* d = elem->call_data; - GPR_ASSERT(d != NULL); - d->start_ts = gpr_now(GPR_CLOCK_REALTIME); - /* TODO(hongyu): call census_tracing_start_op here. */ - grpc_iomgr_closure_init(d->on_done_recv, server_on_done_recv, elem); - if (initial_op) server_mutate_op(elem, initial_op); -} - -static void server_destroy_call_elem(grpc_call_element* elem) { - call_data* d = elem->call_data; - GPR_ASSERT(d != NULL); - /* TODO(hongyu): record rpc server stats and census_tracing_end_op here */ -} - -static void init_channel_elem(grpc_channel_element* elem, grpc_channel* master, - const grpc_channel_args* args, grpc_mdctx* mdctx, - int is_first, int is_last) { - channel_data* chand = elem->channel_data; - GPR_ASSERT(chand != NULL); - chand->path_str = grpc_mdstr_from_string(mdctx, ":path", 0); -} - -static void destroy_channel_elem(grpc_channel_element* elem) { - channel_data* chand = elem->channel_data; - GPR_ASSERT(chand != NULL); - if (chand->path_str != NULL) { - GRPC_MDSTR_UNREF(chand->path_str); - } -} - -const grpc_channel_filter grpc_client_census_filter = { - client_start_transport_op, - grpc_channel_next_op, - sizeof(call_data), - client_init_call_elem, - client_destroy_call_elem, - sizeof(channel_data), - init_channel_elem, - destroy_channel_elem, - grpc_call_next_get_peer, - "census-client"}; - -const grpc_channel_filter grpc_server_census_filter = { - server_start_transport_op, - grpc_channel_next_op, - sizeof(call_data), - server_init_call_elem, - server_destroy_call_elem, - sizeof(channel_data), - init_channel_elem, - destroy_channel_elem, - grpc_call_next_get_peer, - "census-server"}; diff --git a/src/core/channel/census_filter.h b/src/core/channel/census_filter.h deleted file mode 100644 index 4f9759f0db..0000000000 --- a/src/core/channel/census_filter.h +++ /dev/null @@ -1,44 +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_INTERNAL_CORE_CHANNEL_CENSUS_FILTER_H -#define GRPC_INTERNAL_CORE_CHANNEL_CENSUS_FILTER_H - -#include "src/core/channel/channel_stack.h" - -/* Census filters: provides tracing and stats collection functionalities. It - needs to reside right below the surface filter in the channel stack. */ -extern const grpc_channel_filter grpc_client_census_filter; -extern const grpc_channel_filter grpc_server_census_filter; - -#endif /* GRPC_INTERNAL_CORE_CHANNEL_CENSUS_FILTER_H */ diff --git a/src/core/surface/channel_create.c b/src/core/surface/channel_create.c index 4379b3d016..4d01be3d7d 100644 --- a/src/core/surface/channel_create.c +++ b/src/core/surface/channel_create.c @@ -38,7 +38,7 @@ #include -#include "src/core/channel/census_filter.h" +#include "src/core/census/census_filter.h" #include "src/core/channel/channel_args.h" #include "src/core/channel/client_channel.h" #include "src/core/channel/compress_filter.h" diff --git a/src/core/surface/secure_channel_create.c b/src/core/surface/secure_channel_create.c index 93a372928f..943bddfc0c 100644 --- a/src/core/surface/secure_channel_create.c +++ b/src/core/surface/secure_channel_create.c @@ -38,7 +38,7 @@ #include -#include "src/core/channel/census_filter.h" +#include "src/core/census/census_filter.h" #include "src/core/channel/channel_args.h" #include "src/core/channel/client_channel.h" #include "src/core/channel/compress_filter.h" diff --git a/src/core/surface/server.c b/src/core/surface/server.c index 27070836f3..22d399cf1f 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -41,7 +41,7 @@ #include #include -#include "src/core/channel/census_filter.h" +#include "src/core/census/census_filter.h" #include "src/core/channel/channel_args.h" #include "src/core/channel/connected_channel.h" #include "src/core/iomgr/iomgr.h" diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 0619f76e27..f5d5dc0f80 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -780,7 +780,7 @@ src/core/tsi/fake_transport_security.h \ src/core/tsi/ssl_transport_security.h \ src/core/tsi/transport_security.h \ src/core/tsi/transport_security_interface.h \ -src/core/channel/census_filter.h \ +src/core/census/census_filter.h \ src/core/channel/channel_args.h \ src/core/channel/channel_stack.h \ src/core/channel/client_channel.h \ @@ -902,8 +902,8 @@ src/core/surface/secure_channel_create.c \ src/core/tsi/fake_transport_security.c \ src/core/tsi/ssl_transport_security.c \ src/core/tsi/transport_security.c \ +src/core/census/census_filter.c \ src/core/census/grpc_context.c \ -src/core/channel/census_filter.c \ src/core/channel/channel_args.c \ src/core/channel/channel_stack.c \ src/core/channel/client_channel.c \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index 38bf532f44..cc74397cea 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -12222,9 +12222,9 @@ "include/grpc/grpc.h", "include/grpc/grpc_security.h", "include/grpc/status.h", + "src/core/census/census_filter.h", "src/core/census/context.h", "src/core/census/rpc_stat_id.h", - "src/core/channel/census_filter.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", "src/core/channel/client_channel.h", @@ -12347,14 +12347,14 @@ "include/grpc/grpc.h", "include/grpc/grpc_security.h", "include/grpc/status.h", + "src/core/census/census_filter.c", + "src/core/census/census_filter.h", "src/core/census/context.c", "src/core/census/context.h", "src/core/census/grpc_context.c", "src/core/census/initialize.c", "src/core/census/record_stat.c", "src/core/census/rpc_stat_id.h", - "src/core/channel/census_filter.c", - "src/core/channel/census_filter.h", "src/core/channel/channel_args.c", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.c", @@ -12694,9 +12694,9 @@ "include/grpc/compression.h", "include/grpc/grpc.h", "include/grpc/status.h", + "src/core/census/census_filter.h", "src/core/census/context.h", "src/core/census/rpc_stat_id.h", - "src/core/channel/census_filter.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", "src/core/channel/client_channel.h", @@ -12805,14 +12805,14 @@ "include/grpc/compression.h", "include/grpc/grpc.h", "include/grpc/status.h", + "src/core/census/census_filter.c", + "src/core/census/census_filter.h", "src/core/census/context.c", "src/core/census/context.h", "src/core/census/grpc_context.c", "src/core/census/initialize.c", "src/core/census/record_stat.c", "src/core/census/rpc_stat_id.h", - "src/core/channel/census_filter.c", - "src/core/channel/census_filter.h", "src/core/channel/channel_args.c", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.c", diff --git a/vsprojects/grpc/grpc.vcxproj b/vsprojects/grpc/grpc.vcxproj index a87ad29d49..950e385ee7 100644 --- a/vsprojects/grpc/grpc.vcxproj +++ b/vsprojects/grpc/grpc.vcxproj @@ -242,7 +242,7 @@ - + @@ -387,9 +387,9 @@ - + - + diff --git a/vsprojects/grpc/grpc.vcxproj.filters b/vsprojects/grpc/grpc.vcxproj.filters index c8812faa85..d6ecdbba41 100644 --- a/vsprojects/grpc/grpc.vcxproj.filters +++ b/vsprojects/grpc/grpc.vcxproj.filters @@ -64,11 +64,11 @@ src\core\tsi - + src\core\census - - src\core\channel + + src\core\census src\core\channel @@ -482,8 +482,8 @@ src\core\tsi - - src\core\channel + + src\core\census src\core\channel diff --git a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj index 06da784323..acd83c6080 100644 --- a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj @@ -225,7 +225,7 @@ - + @@ -330,9 +330,9 @@ - + - + diff --git a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters index 2d10960a79..12da3fa1e3 100644 --- a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -4,11 +4,11 @@ src\core\surface - + src\core\census - - src\core\channel + + src\core\census src\core\channel @@ -380,8 +380,8 @@ - - src\core\channel + + src\core\census src\core\channel -- cgit v1.2.3 From e09dc78e74f481dd06bf2f9ea643026f5e94bb5b Mon Sep 17 00:00:00 2001 From: Hongyu Chen Date: Fri, 21 Aug 2015 11:28:33 -0700 Subject: rename census_filter.{c,h} to grpc_filter.{c,h} --- BUILD | 12 +- Makefile | 4 +- build.json | 4 +- gRPC.podspec | 6 +- src/core/census/census_filter.c | 197 --------------------- src/core/census/census_filter.h | 44 ----- src/core/census/grpc_filter.c | 197 +++++++++++++++++++++ src/core/census/grpc_filter.h | 44 +++++ src/core/surface/channel_create.c | 2 +- src/core/surface/secure_channel_create.c | 2 +- src/core/surface/server.c | 2 +- tools/doxygen/Doxyfile.core.internal | 4 +- tools/run_tests/sources_and_headers.json | 12 +- vsprojects/grpc/grpc.vcxproj | 6 +- vsprojects/grpc/grpc.vcxproj.filters | 6 +- vsprojects/grpc_unsecure/grpc_unsecure.vcxproj | 6 +- .../grpc_unsecure/grpc_unsecure.vcxproj.filters | 6 +- 17 files changed, 277 insertions(+), 277 deletions(-) delete mode 100644 src/core/census/census_filter.c delete mode 100644 src/core/census/census_filter.h create mode 100644 src/core/census/grpc_filter.c create mode 100644 src/core/census/grpc_filter.h (limited to 'vsprojects/grpc_unsecure') diff --git a/BUILD b/BUILD index ae98fe02ae..043d38e1fc 100644 --- a/BUILD +++ b/BUILD @@ -143,7 +143,7 @@ cc_library( "src/core/tsi/ssl_transport_security.h", "src/core/tsi/transport_security.h", "src/core/tsi/transport_security_interface.h", - "src/core/census/census_filter.h", + "src/core/census/grpc_filter.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", "src/core/channel/client_channel.h", @@ -266,8 +266,8 @@ cc_library( "src/core/tsi/fake_transport_security.c", "src/core/tsi/ssl_transport_security.c", "src/core/tsi/transport_security.c", - "src/core/census/census_filter.c", "src/core/census/grpc_context.c", + "src/core/census/grpc_filter.c", "src/core/channel/channel_args.c", "src/core/channel/channel_stack.c", "src/core/channel/client_channel.c", @@ -410,7 +410,7 @@ cc_library( cc_library( name = "grpc_unsecure", srcs = [ - "src/core/census/census_filter.h", + "src/core/census/grpc_filter.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", "src/core/channel/client_channel.h", @@ -513,8 +513,8 @@ cc_library( "src/core/census/context.h", "src/core/census/rpc_stat_id.h", "src/core/surface/init_unsecure.c", - "src/core/census/census_filter.c", "src/core/census/grpc_context.c", + "src/core/census/grpc_filter.c", "src/core/channel/channel_args.c", "src/core/channel/channel_stack.c", "src/core/channel/client_channel.c", @@ -1018,8 +1018,8 @@ objc_library( "src/core/tsi/fake_transport_security.c", "src/core/tsi/ssl_transport_security.c", "src/core/tsi/transport_security.c", - "src/core/census/census_filter.c", "src/core/census/grpc_context.c", + "src/core/census/grpc_filter.c", "src/core/channel/channel_args.c", "src/core/channel/channel_stack.c", "src/core/channel/client_channel.c", @@ -1159,7 +1159,7 @@ objc_library( "src/core/tsi/ssl_transport_security.h", "src/core/tsi/transport_security.h", "src/core/tsi/transport_security_interface.h", - "src/core/census/census_filter.h", + "src/core/census/grpc_filter.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", "src/core/channel/client_channel.h", diff --git a/Makefile b/Makefile index 934c2c4863..8bcdc79fde 100644 --- a/Makefile +++ b/Makefile @@ -4080,8 +4080,8 @@ LIBGRPC_SRC = \ src/core/tsi/fake_transport_security.c \ src/core/tsi/ssl_transport_security.c \ src/core/tsi/transport_security.c \ - src/core/census/census_filter.c \ src/core/census/grpc_context.c \ + src/core/census/grpc_filter.c \ src/core/channel/channel_args.c \ src/core/channel/channel_stack.c \ src/core/channel/client_channel.c \ @@ -4354,8 +4354,8 @@ endif LIBGRPC_UNSECURE_SRC = \ src/core/surface/init_unsecure.c \ - src/core/census/census_filter.c \ src/core/census/grpc_context.c \ + src/core/census/grpc_filter.c \ src/core/channel/channel_args.c \ src/core/channel/channel_stack.c \ src/core/channel/client_channel.c \ diff --git a/build.json b/build.json index a0c9c8dfd8..70dec998ec 100644 --- a/build.json +++ b/build.json @@ -114,7 +114,7 @@ "include/grpc/status.h" ], "headers": [ - "src/core/census/census_filter.h", + "src/core/census/grpc_filter.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", "src/core/channel/client_channel.h", @@ -216,8 +216,8 @@ "src/core/transport/transport_impl.h" ], "src": [ - "src/core/census/census_filter.c", "src/core/census/grpc_context.c", + "src/core/census/grpc_filter.c", "src/core/channel/channel_args.c", "src/core/channel/channel_stack.c", "src/core/channel/client_channel.c", diff --git a/gRPC.podspec b/gRPC.podspec index 6878f5937b..0e826b5ba2 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -145,7 +145,7 @@ Pod::Spec.new do |s| 'src/core/tsi/ssl_transport_security.h', 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_interface.h', - 'src/core/census/census_filter.h', + 'src/core/census/grpc_filter.h', 'src/core/channel/channel_args.h', 'src/core/channel/channel_stack.h', 'src/core/channel/client_channel.h', @@ -275,8 +275,8 @@ Pod::Spec.new do |s| 'src/core/tsi/fake_transport_security.c', 'src/core/tsi/ssl_transport_security.c', 'src/core/tsi/transport_security.c', - 'src/core/census/census_filter.c', 'src/core/census/grpc_context.c', + 'src/core/census/grpc_filter.c', 'src/core/channel/channel_args.c', 'src/core/channel/channel_stack.c', 'src/core/channel/client_channel.c', @@ -415,7 +415,7 @@ Pod::Spec.new do |s| 'src/core/tsi/ssl_transport_security.h', 'src/core/tsi/transport_security.h', 'src/core/tsi/transport_security_interface.h', - 'src/core/census/census_filter.h', + 'src/core/census/grpc_filter.h', 'src/core/channel/channel_args.h', 'src/core/channel/channel_stack.h', 'src/core/channel/client_channel.h', diff --git a/src/core/census/census_filter.c b/src/core/census/census_filter.c deleted file mode 100644 index 31db686cf3..0000000000 --- a/src/core/census/census_filter.c +++ /dev/null @@ -1,197 +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/census/census_filter.h" - -#include -#include - -#include "include/grpc/census.h" -#include "src/core/census/rpc_stat_id.h" -#include "src/core/channel/channel_stack.h" -#include "src/core/channel/noop_filter.h" -#include "src/core/statistics/census_interface.h" -#include "src/core/statistics/census_rpc_stats.h" -#include -#include -#include -#include - -typedef struct call_data { - census_op_id op_id; - census_context* ctxt; - gpr_timespec start_ts; - int error; - - /* recv callback */ - grpc_stream_op_buffer* recv_ops; - grpc_iomgr_closure* on_done_recv; -} call_data; - -typedef struct channel_data { - grpc_mdstr* path_str; /* pointer to meta data str with key == ":path" */ -} channel_data; - -static void extract_and_annotate_method_tag(grpc_stream_op_buffer* sopb, - call_data* calld, - channel_data* chand) { - grpc_linked_mdelem* m; - size_t i; - for (i = 0; i < sopb->nops; i++) { - grpc_stream_op* op = &sopb->ops[i]; - if (op->type != GRPC_OP_METADATA) continue; - for (m = op->data.metadata.list.head; m != NULL; m = m->next) { - if (m->md->key == chand->path_str) { - gpr_log(GPR_DEBUG, "%s", - (const char*)GPR_SLICE_START_PTR(m->md->value->slice)); - /* Add method tag here */ - } - } - } -} - -static void client_mutate_op(grpc_call_element* elem, - grpc_transport_stream_op* op) { - call_data* calld = elem->call_data; - channel_data* chand = elem->channel_data; - if (op->send_ops) { - extract_and_annotate_method_tag(op->send_ops, calld, chand); - } -} - -static void client_start_transport_op(grpc_call_element* elem, - grpc_transport_stream_op* op) { - client_mutate_op(elem, op); - grpc_call_next_op(elem, op); -} - -static void server_on_done_recv(void* ptr, int success) { - grpc_call_element* elem = ptr; - call_data* calld = elem->call_data; - channel_data* chand = elem->channel_data; - if (success) { - extract_and_annotate_method_tag(calld->recv_ops, calld, chand); - } - calld->on_done_recv->cb(calld->on_done_recv->cb_arg, success); -} - -static void server_mutate_op(grpc_call_element* elem, - grpc_transport_stream_op* op) { - call_data* calld = elem->call_data; - if (op->recv_ops) { - /* substitute our callback for the op callback */ - calld->recv_ops = op->recv_ops; - calld->on_done_recv = op->on_done_recv; - op->on_done_recv = calld->on_done_recv; - } -} - -static void server_start_transport_op(grpc_call_element* elem, - grpc_transport_stream_op* op) { - call_data* calld = elem->call_data; - GPR_ASSERT((calld->op_id.upper != 0) || (calld->op_id.lower != 0)); - server_mutate_op(elem, op); - grpc_call_next_op(elem, op); -} - -static void client_init_call_elem(grpc_call_element* elem, - const void* server_transport_data, - grpc_transport_stream_op* initial_op) { - call_data* d = elem->call_data; - GPR_ASSERT(d != NULL); - d->start_ts = gpr_now(GPR_CLOCK_REALTIME); - if (initial_op) client_mutate_op(elem, initial_op); -} - -static void client_destroy_call_elem(grpc_call_element* elem) { - call_data* d = elem->call_data; - GPR_ASSERT(d != NULL); - /* TODO(hongyu): record rpc client stats and census_rpc_end_op here */ -} - -static void server_init_call_elem(grpc_call_element* elem, - const void* server_transport_data, - grpc_transport_stream_op* initial_op) { - call_data* d = elem->call_data; - GPR_ASSERT(d != NULL); - d->start_ts = gpr_now(GPR_CLOCK_REALTIME); - /* TODO(hongyu): call census_tracing_start_op here. */ - grpc_iomgr_closure_init(d->on_done_recv, server_on_done_recv, elem); - if (initial_op) server_mutate_op(elem, initial_op); -} - -static void server_destroy_call_elem(grpc_call_element* elem) { - call_data* d = elem->call_data; - GPR_ASSERT(d != NULL); - /* TODO(hongyu): record rpc server stats and census_tracing_end_op here */ -} - -static void init_channel_elem(grpc_channel_element* elem, grpc_channel* master, - const grpc_channel_args* args, grpc_mdctx* mdctx, - int is_first, int is_last) { - channel_data* chand = elem->channel_data; - GPR_ASSERT(chand != NULL); - chand->path_str = grpc_mdstr_from_string(mdctx, ":path", 0); -} - -static void destroy_channel_elem(grpc_channel_element* elem) { - channel_data* chand = elem->channel_data; - GPR_ASSERT(chand != NULL); - if (chand->path_str != NULL) { - GRPC_MDSTR_UNREF(chand->path_str); - } -} - -const grpc_channel_filter grpc_client_census_filter = { - client_start_transport_op, - grpc_channel_next_op, - sizeof(call_data), - client_init_call_elem, - client_destroy_call_elem, - sizeof(channel_data), - init_channel_elem, - destroy_channel_elem, - grpc_call_next_get_peer, - "census-client"}; - -const grpc_channel_filter grpc_server_census_filter = { - server_start_transport_op, - grpc_channel_next_op, - sizeof(call_data), - server_init_call_elem, - server_destroy_call_elem, - sizeof(channel_data), - init_channel_elem, - destroy_channel_elem, - grpc_call_next_get_peer, - "census-server"}; diff --git a/src/core/census/census_filter.h b/src/core/census/census_filter.h deleted file mode 100644 index 1453c05d28..0000000000 --- a/src/core/census/census_filter.h +++ /dev/null @@ -1,44 +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_INTERNAL_CORE_CHANNEL_CENSUS_FILTER_H -#define GRPC_INTERNAL_CORE_CHANNEL_CENSUS_FILTER_H - -#include "src/core/channel/channel_stack.h" - -/* Census filters: provides tracing and stats collection functionalities. It - needs to reside right below the surface filter in the channel stack. */ -extern const grpc_channel_filter grpc_client_census_filter; -extern const grpc_channel_filter grpc_server_census_filter; - -#endif /* GRPC_INTERNAL_CORE_CHANNEL_CENSUS_FILTER_H */ diff --git a/src/core/census/grpc_filter.c b/src/core/census/grpc_filter.c new file mode 100644 index 0000000000..fbedb35661 --- /dev/null +++ b/src/core/census/grpc_filter.c @@ -0,0 +1,197 @@ +/* + * + * 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/census/grpc_filter.h" + +#include +#include + +#include "include/grpc/census.h" +#include "src/core/census/rpc_stat_id.h" +#include "src/core/channel/channel_stack.h" +#include "src/core/channel/noop_filter.h" +#include "src/core/statistics/census_interface.h" +#include "src/core/statistics/census_rpc_stats.h" +#include +#include +#include +#include + +typedef struct call_data { + census_op_id op_id; + census_context* ctxt; + gpr_timespec start_ts; + int error; + + /* recv callback */ + grpc_stream_op_buffer* recv_ops; + grpc_iomgr_closure* on_done_recv; +} call_data; + +typedef struct channel_data { + grpc_mdstr* path_str; /* pointer to meta data str with key == ":path" */ +} channel_data; + +static void extract_and_annotate_method_tag(grpc_stream_op_buffer* sopb, + call_data* calld, + channel_data* chand) { + grpc_linked_mdelem* m; + size_t i; + for (i = 0; i < sopb->nops; i++) { + grpc_stream_op* op = &sopb->ops[i]; + if (op->type != GRPC_OP_METADATA) continue; + for (m = op->data.metadata.list.head; m != NULL; m = m->next) { + if (m->md->key == chand->path_str) { + gpr_log(GPR_DEBUG, "%s", + (const char*)GPR_SLICE_START_PTR(m->md->value->slice)); + /* Add method tag here */ + } + } + } +} + +static void client_mutate_op(grpc_call_element* elem, + grpc_transport_stream_op* op) { + call_data* calld = elem->call_data; + channel_data* chand = elem->channel_data; + if (op->send_ops) { + extract_and_annotate_method_tag(op->send_ops, calld, chand); + } +} + +static void client_start_transport_op(grpc_call_element* elem, + grpc_transport_stream_op* op) { + client_mutate_op(elem, op); + grpc_call_next_op(elem, op); +} + +static void server_on_done_recv(void* ptr, int success) { + grpc_call_element* elem = ptr; + call_data* calld = elem->call_data; + channel_data* chand = elem->channel_data; + if (success) { + extract_and_annotate_method_tag(calld->recv_ops, calld, chand); + } + calld->on_done_recv->cb(calld->on_done_recv->cb_arg, success); +} + +static void server_mutate_op(grpc_call_element* elem, + grpc_transport_stream_op* op) { + call_data* calld = elem->call_data; + if (op->recv_ops) { + /* substitute our callback for the op callback */ + calld->recv_ops = op->recv_ops; + calld->on_done_recv = op->on_done_recv; + op->on_done_recv = calld->on_done_recv; + } +} + +static void server_start_transport_op(grpc_call_element* elem, + grpc_transport_stream_op* op) { + call_data* calld = elem->call_data; + GPR_ASSERT((calld->op_id.upper != 0) || (calld->op_id.lower != 0)); + server_mutate_op(elem, op); + grpc_call_next_op(elem, op); +} + +static void client_init_call_elem(grpc_call_element* elem, + const void* server_transport_data, + grpc_transport_stream_op* initial_op) { + call_data* d = elem->call_data; + GPR_ASSERT(d != NULL); + d->start_ts = gpr_now(GPR_CLOCK_REALTIME); + if (initial_op) client_mutate_op(elem, initial_op); +} + +static void client_destroy_call_elem(grpc_call_element* elem) { + call_data* d = elem->call_data; + GPR_ASSERT(d != NULL); + /* TODO(hongyu): record rpc client stats and census_rpc_end_op here */ +} + +static void server_init_call_elem(grpc_call_element* elem, + const void* server_transport_data, + grpc_transport_stream_op* initial_op) { + call_data* d = elem->call_data; + GPR_ASSERT(d != NULL); + d->start_ts = gpr_now(GPR_CLOCK_REALTIME); + /* TODO(hongyu): call census_tracing_start_op here. */ + grpc_iomgr_closure_init(d->on_done_recv, server_on_done_recv, elem); + if (initial_op) server_mutate_op(elem, initial_op); +} + +static void server_destroy_call_elem(grpc_call_element* elem) { + call_data* d = elem->call_data; + GPR_ASSERT(d != NULL); + /* TODO(hongyu): record rpc server stats and census_tracing_end_op here */ +} + +static void init_channel_elem(grpc_channel_element* elem, grpc_channel* master, + const grpc_channel_args* args, grpc_mdctx* mdctx, + int is_first, int is_last) { + channel_data* chand = elem->channel_data; + GPR_ASSERT(chand != NULL); + chand->path_str = grpc_mdstr_from_string(mdctx, ":path", 0); +} + +static void destroy_channel_elem(grpc_channel_element* elem) { + channel_data* chand = elem->channel_data; + GPR_ASSERT(chand != NULL); + if (chand->path_str != NULL) { + GRPC_MDSTR_UNREF(chand->path_str); + } +} + +const grpc_channel_filter grpc_client_census_filter = { + client_start_transport_op, + grpc_channel_next_op, + sizeof(call_data), + client_init_call_elem, + client_destroy_call_elem, + sizeof(channel_data), + init_channel_elem, + destroy_channel_elem, + grpc_call_next_get_peer, + "census-client"}; + +const grpc_channel_filter grpc_server_census_filter = { + server_start_transport_op, + grpc_channel_next_op, + sizeof(call_data), + server_init_call_elem, + server_destroy_call_elem, + sizeof(channel_data), + init_channel_elem, + destroy_channel_elem, + grpc_call_next_get_peer, + "census-server"}; diff --git a/src/core/census/grpc_filter.h b/src/core/census/grpc_filter.h new file mode 100644 index 0000000000..1453c05d28 --- /dev/null +++ b/src/core/census/grpc_filter.h @@ -0,0 +1,44 @@ +/* + * + * 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_INTERNAL_CORE_CHANNEL_CENSUS_FILTER_H +#define GRPC_INTERNAL_CORE_CHANNEL_CENSUS_FILTER_H + +#include "src/core/channel/channel_stack.h" + +/* Census filters: provides tracing and stats collection functionalities. It + needs to reside right below the surface filter in the channel stack. */ +extern const grpc_channel_filter grpc_client_census_filter; +extern const grpc_channel_filter grpc_server_census_filter; + +#endif /* GRPC_INTERNAL_CORE_CHANNEL_CENSUS_FILTER_H */ diff --git a/src/core/surface/channel_create.c b/src/core/surface/channel_create.c index 1b3707a091..707251da89 100644 --- a/src/core/surface/channel_create.c +++ b/src/core/surface/channel_create.c @@ -38,7 +38,7 @@ #include -#include "src/core/census/census_filter.h" +#include "src/core/census/grpc_filter.h" #include "src/core/channel/channel_args.h" #include "src/core/channel/client_channel.h" #include "src/core/channel/compress_filter.h" diff --git a/src/core/surface/secure_channel_create.c b/src/core/surface/secure_channel_create.c index cf204e112b..eccee24698 100644 --- a/src/core/surface/secure_channel_create.c +++ b/src/core/surface/secure_channel_create.c @@ -38,7 +38,7 @@ #include -#include "src/core/census/census_filter.h" +#include "src/core/census/grpc_filter.h" #include "src/core/channel/channel_args.h" #include "src/core/channel/client_channel.h" #include "src/core/channel/compress_filter.h" diff --git a/src/core/surface/server.c b/src/core/surface/server.c index 145fa6ee1a..292bf6fab8 100644 --- a/src/core/surface/server.c +++ b/src/core/surface/server.c @@ -41,7 +41,7 @@ #include #include -#include "src/core/census/census_filter.h" +#include "src/core/census/grpc_filter.h" #include "src/core/channel/channel_args.h" #include "src/core/channel/connected_channel.h" #include "src/core/iomgr/iomgr.h" diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index 5b0abc571b..d27c5d9246 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -780,7 +780,7 @@ src/core/tsi/fake_transport_security.h \ src/core/tsi/ssl_transport_security.h \ src/core/tsi/transport_security.h \ src/core/tsi/transport_security_interface.h \ -src/core/census/census_filter.h \ +src/core/census/grpc_filter.h \ src/core/channel/channel_args.h \ src/core/channel/channel_stack.h \ src/core/channel/client_channel.h \ @@ -903,8 +903,8 @@ src/core/surface/secure_channel_create.c \ src/core/tsi/fake_transport_security.c \ src/core/tsi/ssl_transport_security.c \ src/core/tsi/transport_security.c \ -src/core/census/census_filter.c \ src/core/census/grpc_context.c \ +src/core/census/grpc_filter.c \ src/core/channel/channel_args.c \ src/core/channel/channel_stack.c \ src/core/channel/client_channel.c \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index c7e5af6e71..97659c11a6 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -12269,8 +12269,8 @@ "include/grpc/grpc.h", "include/grpc/grpc_security.h", "include/grpc/status.h", - "src/core/census/census_filter.h", "src/core/census/context.h", + "src/core/census/grpc_filter.h", "src/core/census/rpc_stat_id.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", @@ -12395,11 +12395,11 @@ "include/grpc/grpc.h", "include/grpc/grpc_security.h", "include/grpc/status.h", - "src/core/census/census_filter.c", - "src/core/census/census_filter.h", "src/core/census/context.c", "src/core/census/context.h", "src/core/census/grpc_context.c", + "src/core/census/grpc_filter.c", + "src/core/census/grpc_filter.h", "src/core/census/initialize.c", "src/core/census/record_stat.c", "src/core/census/rpc_stat_id.h", @@ -12744,8 +12744,8 @@ "include/grpc/compression.h", "include/grpc/grpc.h", "include/grpc/status.h", - "src/core/census/census_filter.h", "src/core/census/context.h", + "src/core/census/grpc_filter.h", "src/core/census/rpc_stat_id.h", "src/core/channel/channel_args.h", "src/core/channel/channel_stack.h", @@ -12856,11 +12856,11 @@ "include/grpc/compression.h", "include/grpc/grpc.h", "include/grpc/status.h", - "src/core/census/census_filter.c", - "src/core/census/census_filter.h", "src/core/census/context.c", "src/core/census/context.h", "src/core/census/grpc_context.c", + "src/core/census/grpc_filter.c", + "src/core/census/grpc_filter.h", "src/core/census/initialize.c", "src/core/census/record_stat.c", "src/core/census/rpc_stat_id.h", diff --git a/vsprojects/grpc/grpc.vcxproj b/vsprojects/grpc/grpc.vcxproj index aacf42d373..500cf9feb5 100644 --- a/vsprojects/grpc/grpc.vcxproj +++ b/vsprojects/grpc/grpc.vcxproj @@ -242,7 +242,7 @@ - + @@ -388,10 +388,10 @@ - - + + diff --git a/vsprojects/grpc/grpc.vcxproj.filters b/vsprojects/grpc/grpc.vcxproj.filters index 40551bf3e7..02060b7830 100644 --- a/vsprojects/grpc/grpc.vcxproj.filters +++ b/vsprojects/grpc/grpc.vcxproj.filters @@ -64,10 +64,10 @@ src\core\tsi - + src\core\census - + src\core\census @@ -485,7 +485,7 @@ src\core\tsi - + src\core\census diff --git a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj index 004565b6da..13c018c020 100644 --- a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj @@ -225,7 +225,7 @@ - + @@ -331,10 +331,10 @@ - - + + diff --git a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters index f2fa433881..5adcdd6092 100644 --- a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -4,10 +4,10 @@ src\core\surface - + src\core\census - + src\core\census @@ -383,7 +383,7 @@ - + src\core\census -- cgit v1.2.3 From 31ff8bcc1557537082bf8de32d175e3f766fba3a Mon Sep 17 00:00:00 2001 From: yang-g Date: Tue, 25 Aug 2015 14:09:06 -0700 Subject: add missing headers from 2495 --- BUILD | 6 ++++++ build.json | 2 ++ gRPC.podspec | 4 ++++ tools/doxygen/Doxyfile.core.internal | 2 ++ tools/run_tests/sources_and_headers.json | 8 ++++++++ vsprojects/grpc/grpc.vcxproj | 2 ++ vsprojects/grpc/grpc.vcxproj.filters | 9 +++++++++ vsprojects/grpc_unsecure/grpc_unsecure.vcxproj | 2 ++ vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters | 9 +++++++++ 9 files changed, 44 insertions(+) (limited to 'vsprojects/grpc_unsecure') diff --git a/BUILD b/BUILD index 607e3f481a..25b26b7b24 100644 --- a/BUILD +++ b/BUILD @@ -209,6 +209,8 @@ cc_library( "src/core/json/json_writer.h", "src/core/profiling/timers.h", "src/core/profiling/timers_preciseclock.h", + "src/core/statistics/census_interface.h", + "src/core/statistics/census_rpc_stats.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -476,6 +478,8 @@ cc_library( "src/core/json/json_writer.h", "src/core/profiling/timers.h", "src/core/profiling/timers_preciseclock.h", + "src/core/statistics/census_interface.h", + "src/core/statistics/census_rpc_stats.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -1229,6 +1233,8 @@ objc_library( "src/core/json/json_writer.h", "src/core/profiling/timers.h", "src/core/profiling/timers_preciseclock.h", + "src/core/statistics/census_interface.h", + "src/core/statistics/census_rpc_stats.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", diff --git a/build.json b/build.json index c3e784b4cf..54cae41546 100644 --- a/build.json +++ b/build.json @@ -182,6 +182,8 @@ "src/core/json/json_writer.h", "src/core/profiling/timers.h", "src/core/profiling/timers_preciseclock.h", + "src/core/statistics/census_interface.h", + "src/core/statistics/census_rpc_stats.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", diff --git a/gRPC.podspec b/gRPC.podspec index 0e826b5ba2..f6d09dbaa6 100644 --- a/gRPC.podspec +++ b/gRPC.podspec @@ -211,6 +211,8 @@ Pod::Spec.new do |s| 'src/core/json/json_writer.h', 'src/core/profiling/timers.h', 'src/core/profiling/timers_preciseclock.h', + 'src/core/statistics/census_interface.h', + 'src/core/statistics/census_rpc_stats.h', 'src/core/surface/byte_buffer_queue.h', 'src/core/surface/call.h', 'src/core/surface/channel.h', @@ -481,6 +483,8 @@ Pod::Spec.new do |s| 'src/core/json/json_writer.h', 'src/core/profiling/timers.h', 'src/core/profiling/timers_preciseclock.h', + 'src/core/statistics/census_interface.h', + 'src/core/statistics/census_rpc_stats.h', 'src/core/surface/byte_buffer_queue.h', 'src/core/surface/call.h', 'src/core/surface/channel.h', diff --git a/tools/doxygen/Doxyfile.core.internal b/tools/doxygen/Doxyfile.core.internal index d27c5d9246..06f0f4ee83 100644 --- a/tools/doxygen/Doxyfile.core.internal +++ b/tools/doxygen/Doxyfile.core.internal @@ -846,6 +846,8 @@ src/core/json/json_reader.h \ src/core/json/json_writer.h \ src/core/profiling/timers.h \ src/core/profiling/timers_preciseclock.h \ +src/core/statistics/census_interface.h \ +src/core/statistics/census_rpc_stats.h \ src/core/surface/byte_buffer_queue.h \ src/core/surface/call.h \ src/core/surface/channel.h \ diff --git a/tools/run_tests/sources_and_headers.json b/tools/run_tests/sources_and_headers.json index f2a2abe96d..c7df23a7c4 100644 --- a/tools/run_tests/sources_and_headers.json +++ b/tools/run_tests/sources_and_headers.json @@ -12340,6 +12340,8 @@ "src/core/security/secure_transport_setup.h", "src/core/security/security_connector.h", "src/core/security/security_context.h", + "src/core/statistics/census_interface.h", + "src/core/statistics/census_rpc_stats.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -12556,6 +12558,8 @@ "src/core/security/security_context.h", "src/core/security/server_auth_filter.c", "src/core/security/server_secure_chttp2.c", + "src/core/statistics/census_interface.h", + "src/core/statistics/census_rpc_stats.h", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_queue.h", @@ -12806,6 +12810,8 @@ "src/core/json/json_writer.h", "src/core/profiling/timers.h", "src/core/profiling/timers_preciseclock.h", + "src/core/statistics/census_interface.h", + "src/core/statistics/census_rpc_stats.h", "src/core/surface/byte_buffer_queue.h", "src/core/surface/call.h", "src/core/surface/channel.h", @@ -12992,6 +12998,8 @@ "src/core/profiling/stap_timers.c", "src/core/profiling/timers.h", "src/core/profiling/timers_preciseclock.h", + "src/core/statistics/census_interface.h", + "src/core/statistics/census_rpc_stats.h", "src/core/surface/byte_buffer.c", "src/core/surface/byte_buffer_queue.c", "src/core/surface/byte_buffer_queue.h", diff --git a/vsprojects/grpc/grpc.vcxproj b/vsprojects/grpc/grpc.vcxproj index 500cf9feb5..b17eea9235 100644 --- a/vsprojects/grpc/grpc.vcxproj +++ b/vsprojects/grpc/grpc.vcxproj @@ -308,6 +308,8 @@ + + diff --git a/vsprojects/grpc/grpc.vcxproj.filters b/vsprojects/grpc/grpc.vcxproj.filters index 02060b7830..a955e9e993 100644 --- a/vsprojects/grpc/grpc.vcxproj.filters +++ b/vsprojects/grpc/grpc.vcxproj.filters @@ -683,6 +683,12 @@ src\core\profiling + + src\core\statistics + + + src\core\statistics + src\core\surface @@ -845,6 +851,9 @@ {1d850ac6-e639-4eab-5338-4ba40272fcc9} + + {0ef49896-2313-4a3f-1ce2-716fa0e5c6ca} + {aeb18e82-5d25-0aad-8b02-a0a3470073ce} diff --git a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj index 13c018c020..a692c48f81 100644 --- a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj +++ b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj @@ -291,6 +291,8 @@ + + diff --git a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters index 5adcdd6092..1c4036d464 100644 --- a/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters +++ b/vsprojects/grpc_unsecure/grpc_unsecure.vcxproj.filters @@ -581,6 +581,12 @@ src\core\profiling + + src\core\statistics + + + src\core\statistics + src\core\surface @@ -740,6 +746,9 @@ {7f91d9bf-c9de-835a-d74d-b16f843b89a9} + + {e084164c-a069-00e3-db35-4e0b1cd6f0b7} + {6cd0127e-c24b-d43c-38f5-198db8d4322a} -- cgit v1.2.3