From 4aaba75a822c6dde718d7fe646f7671b4f64d8a0 Mon Sep 17 00:00:00 2001 From: Alistair Veitch Date: Thu, 2 Jun 2016 17:11:46 -0700 Subject: initial implementation of resource handling --- test/core/census/README | 7 ++ test/core/census/data/resource_empty_name.pb | 1 + test/core/census/data/resource_empty_name.txt | 5 + test/core/census/data/resource_full.pb | 2 + test/core/census/data/resource_full.txt | 9 ++ test/core/census/data/resource_minimal_good.pb | 2 + test/core/census/data/resource_minimal_good.txt | 5 + test/core/census/data/resource_no_name.pb | 1 + test/core/census/data/resource_no_name.txt | 4 + test/core/census/data/resource_no_numerator.pb | 2 + test/core/census/data/resource_no_numerator.txt | 6 + test/core/census/data/resource_no_unit.pb | 2 + test/core/census/data/resource_no_unit.txt | 2 + test/core/census/resource_test.c | 157 ++++++++++++++++++++++++ 14 files changed, 205 insertions(+) create mode 100644 test/core/census/README create mode 100644 test/core/census/data/resource_empty_name.pb create mode 100644 test/core/census/data/resource_empty_name.txt create mode 100644 test/core/census/data/resource_full.pb create mode 100644 test/core/census/data/resource_full.txt create mode 100644 test/core/census/data/resource_minimal_good.pb create mode 100644 test/core/census/data/resource_minimal_good.txt create mode 100644 test/core/census/data/resource_no_name.pb create mode 100644 test/core/census/data/resource_no_name.txt create mode 100644 test/core/census/data/resource_no_numerator.pb create mode 100644 test/core/census/data/resource_no_numerator.txt create mode 100644 test/core/census/data/resource_no_unit.pb create mode 100644 test/core/census/data/resource_no_unit.txt create mode 100644 test/core/census/resource_test.c (limited to 'test') diff --git a/test/core/census/README b/test/core/census/README new file mode 100644 index 0000000000..d5363b7233 --- /dev/null +++ b/test/core/census/README @@ -0,0 +1,7 @@ +Test source and data files for Census. + +binary proto files (*.pb) in data directory are generated from the *.txt file, +via: + +BASE="filename" +cat $BASE.txt | protoc --encode=google.census.Resource census.proto > $BASE.pb diff --git a/test/core/census/data/resource_empty_name.pb b/test/core/census/data/resource_empty_name.pb new file mode 100644 index 0000000000..4d547445fa --- /dev/null +++ b/test/core/census/data/resource_empty_name.pb @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/core/census/data/resource_empty_name.txt b/test/core/census/data/resource_empty_name.txt new file mode 100644 index 0000000000..271fd3274c --- /dev/null +++ b/test/core/census/data/resource_empty_name.txt @@ -0,0 +1,5 @@ +# Name is present, but empty. +name : '' +unit { + numerator : SECS +} diff --git a/test/core/census/data/resource_full.pb b/test/core/census/data/resource_full.pb new file mode 100644 index 0000000000..e4c6a2aef5 --- /dev/null +++ b/test/core/census/data/resource_full.pb @@ -0,0 +1,2 @@ + + full_resource"A resource with everything defined \ No newline at end of file diff --git a/test/core/census/data/resource_full.txt b/test/core/census/data/resource_full.txt new file mode 100644 index 0000000000..1aa2fafe3a --- /dev/null +++ b/test/core/census/data/resource_full.txt @@ -0,0 +1,9 @@ +# A full resource definition - all fields filled out. +name : 'full_resource' +description : 'A resource with everything defined' +unit { + # Megabits per second. + prefix : 6 + numerator : BITS + denominator : SECS +} diff --git a/test/core/census/data/resource_minimal_good.pb b/test/core/census/data/resource_minimal_good.pb new file mode 100644 index 0000000000..7100c462bf --- /dev/null +++ b/test/core/census/data/resource_minimal_good.pb @@ -0,0 +1,2 @@ + + minimal_good \ No newline at end of file diff --git a/test/core/census/data/resource_minimal_good.txt b/test/core/census/data/resource_minimal_good.txt new file mode 100644 index 0000000000..a7a7e71dd6 --- /dev/null +++ b/test/core/census/data/resource_minimal_good.txt @@ -0,0 +1,5 @@ +# A minimal "good" Resource definition: has a name and numerator/unit. +name : 'minimal_good' +unit { + numerator : SECS +} diff --git a/test/core/census/data/resource_no_name.pb b/test/core/census/data/resource_no_name.pb new file mode 100644 index 0000000000..4d547445fa --- /dev/null +++ b/test/core/census/data/resource_no_name.pb @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/test/core/census/data/resource_no_name.txt b/test/core/census/data/resource_no_name.txt new file mode 100644 index 0000000000..8f12a91d35 --- /dev/null +++ b/test/core/census/data/resource_no_name.txt @@ -0,0 +1,4 @@ +# The minimal good Resource without a name. +unit { + numerator : SECS +} diff --git a/test/core/census/data/resource_no_numerator.pb b/test/core/census/data/resource_no_numerator.pb new file mode 100644 index 0000000000..2a5cceee70 --- /dev/null +++ b/test/core/census/data/resource_no_numerator.pb @@ -0,0 +1,2 @@ + +resource_no_numeratorýÿÿÿÿÿÿÿÿ \ No newline at end of file diff --git a/test/core/census/data/resource_no_numerator.txt b/test/core/census/data/resource_no_numerator.txt new file mode 100644 index 0000000000..fc1fec74a2 --- /dev/null +++ b/test/core/census/data/resource_no_numerator.txt @@ -0,0 +1,6 @@ +# Resource without a numerator +name : 'resource_no_numerator' +unit { + prefix : -3 + denominator : SECS +} diff --git a/test/core/census/data/resource_no_unit.pb b/test/core/census/data/resource_no_unit.pb new file mode 100644 index 0000000000..9dca2620e0 --- /dev/null +++ b/test/core/census/data/resource_no_unit.pb @@ -0,0 +1,2 @@ + +resource_no_unit \ No newline at end of file diff --git a/test/core/census/data/resource_no_unit.txt b/test/core/census/data/resource_no_unit.txt new file mode 100644 index 0000000000..c5d5115ceb --- /dev/null +++ b/test/core/census/data/resource_no_unit.txt @@ -0,0 +1,2 @@ +# The minimal good resource without a unit +name : 'resource_no_unit' diff --git a/test/core/census/resource_test.c b/test/core/census/resource_test.c new file mode 100644 index 0000000000..bfb76bcfb5 --- /dev/null +++ b/test/core/census/resource_test.c @@ -0,0 +1,157 @@ +/* + * + * Copyright 2016, Google Inc. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above + * copyright notice, this list of conditions and the following disclaimer + * in the documentation and/or other materials provided with the + * distribution. + * * Neither the name of Google Inc. nor the names of its + * contributors may be used to endorse or promote products derived from + * this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * + */ + +#include "src/core/ext/census/resource.h" +#include +#include +#include +#include +#include +#include +#include +#include "src/core/ext/census/base_resources.h" +#include "test/core/util/test_config.h" + +// Test all the functionality for dealing with Resources. + +// Just startup and shutdown resources subsystem. +static void test_enable_disable() { + initialize_resources(); + shutdown_resources(); +} + +// A blank/empty initialization should not work. +static void test_empty_definition() { + initialize_resources(); + int32_t rid = census_define_resource(NULL, 0); + GPR_ASSERT(rid == -1); + uint8_t buffer[50] = {0}; + rid = census_define_resource(buffer, 50); + GPR_ASSERT(rid == -1); + shutdown_resources(); +} + +// Given a file name, read raw proto and define the resource included within. +// Returns resource id from census_define_resource(). +static int32_t define_resource_from_file(const char *file) { + const size_t buf_size = 512; + uint8_t buffer[buf_size]; + FILE *input = fopen(file, "r"); + GPR_ASSERT(input != NULL); + size_t nbytes = fread(buffer, 1, buf_size, input); + GPR_ASSERT(nbytes != 0 && nbytes < buf_size); + int32_t rid = census_define_resource(buffer, nbytes); + GPR_ASSERT(fclose(input) == 0); + return rid; +} + +// Test definition of a single resource, using a proto read from a file. The +// `succeed` parameter indicates whether we expect the definition to succeed or +// fail. `name` is used to check that the returned resource can be looked up by +// name. +static void test_define_single_resource(const char *file, const char *name, + bool succeed) { + gpr_log(GPR_INFO, "Test defining resource \"%s\"\n", name); + initialize_resources(); + int32_t rid = define_resource_from_file(file); + if (succeed) { + GPR_ASSERT(rid >= 0); + int32_t rid2 = census_resource_id(name); + GPR_ASSERT(rid == rid2); + } else { + GPR_ASSERT(rid < 0); + } + shutdown_resources(); +} + +// Try deleting various resources (both those that exist and those that don't). +static void test_delete_resource() { + initialize_resources(); + // Try deleting resource before any are defined. + census_delete_resource(0); + // Create and check a couple of resources. + int32_t rid1 = define_resource_from_file( + "test/core/census/data/resource_minimal_good.pb"); + int32_t rid2 = + define_resource_from_file("test/core/census/data/resource_full.pb"); + GPR_ASSERT(rid1 >= 0 && rid2 >= 0 && rid1 != rid2); + int32_t rid3 = census_resource_id("minimal_good"); + int32_t rid4 = census_resource_id("full_resource"); + GPR_ASSERT(rid1 == rid3 && rid2 == rid4); + // Try deleting non-existant resources. + census_delete_resource(-1); + census_delete_resource(rid1 + rid2 + 1); + census_delete_resource(10000000); + // Delete one of the previously defined resources and check for deletion. + census_delete_resource(rid1); + rid3 = census_resource_id("minimal_good"); + GPR_ASSERT(rid3 < 0); + // Check that re-adding works. + rid1 = define_resource_from_file( + "test/core/census/data/resource_minimal_good.pb"); + GPR_ASSERT(rid1 >= 0); + rid3 = census_resource_id("minimal_good"); + GPR_ASSERT(rid1 == rid3); + shutdown_resources(); +} + +// Test define base resources. +static void test_base_resources() { + initialize_resources(); + define_base_resources(); + int32_t rid1 = census_resource_id("client_rpc_latency"); + int32_t rid2 = census_resource_id("server_rpc_latency"); + GPR_ASSERT(rid1 >= 0 && rid2 >= 0 && rid1 != rid2); + shutdown_resources(); +} + +int main(int argc, char **argv) { + grpc_test_init(argc, argv); + test_enable_disable(); + test_empty_definition(); + test_define_single_resource("test/core/census/data/resource_minimal_good.pb", + "minimal_good", true); + test_define_single_resource("test/core/census/data/resource_full.pb", + "full_resource", true); + test_define_single_resource("test/core/census/data/resource_no_name.pb", + "resource_no_name", false); + test_define_single_resource("test/core/census/data/resource_no_numerator.pb", + "resource_no_numerator", false); + test_define_single_resource("test/core/census/data/resource_no_unit.pb", + "resource_no_unit", false); + test_define_single_resource("test/core/census/data/resource_empty_name.pb", + "resource_empty_name", false); + test_delete_resource(); + test_base_resources(); + return 0; +} -- cgit v1.2.3 From 7a97fe2c10e5b55c5f28f7031c2c67fc47581e09 Mon Sep 17 00:00:00 2001 From: Alistair Veitch Date: Fri, 3 Jun 2016 12:10:45 -0700 Subject: use macro rather than constant in array size --- test/core/census/resource_test.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/test/core/census/resource_test.c b/test/core/census/resource_test.c index bfb76bcfb5..1375d56a6b 100644 --- a/test/core/census/resource_test.c +++ b/test/core/census/resource_test.c @@ -64,12 +64,12 @@ static void test_empty_definition() { // Given a file name, read raw proto and define the resource included within. // Returns resource id from census_define_resource(). static int32_t define_resource_from_file(const char *file) { - const size_t buf_size = 512; - uint8_t buffer[buf_size]; +#define BUF_SIZE 512 + uint8_t buffer[BUF_SIZE]; FILE *input = fopen(file, "r"); GPR_ASSERT(input != NULL); - size_t nbytes = fread(buffer, 1, buf_size, input); - GPR_ASSERT(nbytes != 0 && nbytes < buf_size); + size_t nbytes = fread(buffer, 1, BUF_SIZE, input); + GPR_ASSERT(nbytes != 0 && nbytes < BUF_SIZE); int32_t rid = census_define_resource(buffer, nbytes); GPR_ASSERT(fclose(input) == 0); return rid; -- cgit v1.2.3 From 8c7618e88d6a272e17fc67072f6700e0dc4080ab Mon Sep 17 00:00:00 2001 From: Alistair Veitch Date: Tue, 26 Jul 2016 10:30:36 -0700 Subject: Fix memory overwrite in proto decding; fix test for windows --- src/core/ext/census/resource.c | 6 ++++-- test/core/census/resource_test.c | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'test') diff --git a/src/core/ext/census/resource.c b/src/core/ext/census/resource.c index 905de2d63d..63bfb75b47 100644 --- a/src/core/ext/census/resource.c +++ b/src/core/ext/census/resource.c @@ -156,9 +156,11 @@ static bool validate_units_helper(pb_istream_t *stream, int *count, gpr_free(*bup); } *bup = new_bup; - if (!pb_decode_varint(stream, (uint64_t *)(*bup + *count - 1))) { + uint64_t value; + if (!pb_decode_varint(stream, &value)) { return false; } + *(*bup + *count - 1) = (google_census_Resource_BasicUnit)value; } return true; } @@ -290,7 +292,7 @@ int32_t define_resource(const resource *base) { resources[id]->name = gpr_malloc(len); memcpy(resources[id]->name, base->name, len); if (base->description) { - len = strlen(base->description); + len = strlen(base->description) + 1; resources[id]->description = gpr_malloc(len); memcpy(resources[id]->description, base->description, len); } diff --git a/test/core/census/resource_test.c b/test/core/census/resource_test.c index 1375d56a6b..e1556d7d7b 100644 --- a/test/core/census/resource_test.c +++ b/test/core/census/resource_test.c @@ -66,10 +66,10 @@ static void test_empty_definition() { static int32_t define_resource_from_file(const char *file) { #define BUF_SIZE 512 uint8_t buffer[BUF_SIZE]; - FILE *input = fopen(file, "r"); + FILE *input = fopen(file, "rb"); GPR_ASSERT(input != NULL); size_t nbytes = fread(buffer, 1, BUF_SIZE, input); - GPR_ASSERT(nbytes != 0 && nbytes < BUF_SIZE); + GPR_ASSERT(nbytes != 0 && nbytes < BUF_SIZE && feof(input) && !ferror(input)); int32_t rid = census_define_resource(buffer, nbytes); GPR_ASSERT(fclose(input) == 0); return rid; -- cgit v1.2.3 From 6e5c33c3e26ee1d43e2083034e05ffd0dc105934 Mon Sep 17 00:00:00 2001 From: Vijay Pai Date: Sat, 30 Jul 2016 02:56:46 -0700 Subject: Don't assert if we're not able to set affinity for some reason --- test/cpp/qps/limit_cores.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/cpp/qps/limit_cores.cc b/test/cpp/qps/limit_cores.cc index 59ed369067..b5c222542b 100644 --- a/test/cpp/qps/limit_cores.cc +++ b/test/cpp/qps/limit_cores.cc @@ -68,9 +68,9 @@ int LimitCores(const int* cores, int cores_size) { cores_set++; } } - GPR_ASSERT(sched_setaffinity(0, size, cpup) == 0); + bool affinity_set = (sched_setaffinity(0, size, cpup) == 0); CPU_FREE(cpup); - return cores_set; + return affinity_set ? cores_set : num_cores; } } // namespace testing -- cgit v1.2.3 From 8eec9ec6af48d739e5c9346da011e88ad947ab7e Mon Sep 17 00:00:00 2001 From: David Garcia Quintas Date: Mon, 1 Aug 2016 17:05:04 -0700 Subject: Changed census static metadata keys for tracing and tag propagation --- src/core/lib/transport/static_metadata.c | 22 ++++++------ src/core/lib/transport/static_metadata.h | 56 +++++++++++++++--------------- test/core/end2end/fuzzers/hpack.dictionary | 4 +-- tools/codegen/core/gen_static_metadata.py | 4 +-- 4 files changed, 43 insertions(+), 43 deletions(-) (limited to 'test') diff --git a/src/core/lib/transport/static_metadata.c b/src/core/lib/transport/static_metadata.c index c396c1e0b5..8f3e5b5b40 100644 --- a/src/core/lib/transport/static_metadata.c +++ b/src/core/lib/transport/static_metadata.c @@ -51,15 +51,15 @@ uintptr_t grpc_static_mdelem_user_data[GRPC_STATIC_MDELEM_COUNT] = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; const uint8_t grpc_static_metadata_elem_indices[GRPC_STATIC_MDELEM_COUNT * 2] = - {11, 35, 10, 35, 12, 35, 12, 49, 13, 35, 14, 35, 15, 35, 16, 35, 17, 35, - 19, 35, 20, 35, 21, 35, 24, 35, 25, 35, 26, 35, 27, 35, 28, 35, 29, 35, - 30, 18, 30, 35, 31, 35, 32, 35, 36, 35, 37, 35, 38, 35, 39, 35, 42, 33, - 42, 34, 42, 48, 42, 53, 42, 54, 42, 55, 42, 56, 43, 33, 43, 48, 43, 53, - 46, 0, 46, 1, 46, 2, 50, 35, 57, 35, 58, 35, 59, 35, 60, 35, 61, 35, - 62, 35, 63, 35, 64, 35, 65, 35, 66, 35, 67, 35, 68, 40, 68, 70, 68, 73, - 69, 81, 69, 82, 71, 35, 72, 35, 74, 35, 75, 35, 76, 35, 77, 35, 78, 41, - 78, 51, 78, 52, 79, 35, 80, 35, 83, 3, 83, 4, 83, 5, 83, 6, 83, 7, - 83, 8, 83, 9, 84, 35, 85, 86, 87, 35, 88, 35, 89, 35, 90, 35, 91, 35}; + {11, 33, 10, 33, 12, 33, 12, 49, 13, 33, 14, 33, 15, 33, 16, 33, 17, 33, + 19, 33, 20, 33, 21, 33, 22, 33, 23, 33, 24, 33, 25, 33, 26, 33, 27, 33, + 28, 18, 28, 33, 29, 33, 30, 33, 34, 33, 35, 33, 36, 33, 37, 33, 40, 31, + 40, 32, 40, 48, 40, 53, 40, 54, 40, 55, 40, 56, 42, 31, 42, 48, 42, 53, + 45, 0, 45, 1, 45, 2, 50, 33, 57, 33, 58, 33, 59, 33, 60, 33, 61, 33, + 62, 33, 63, 33, 64, 33, 65, 33, 66, 33, 67, 33, 68, 38, 68, 70, 68, 73, + 69, 81, 69, 82, 71, 33, 72, 33, 74, 33, 75, 33, 76, 33, 77, 33, 78, 39, + 78, 51, 78, 52, 79, 33, 80, 33, 83, 3, 83, 4, 83, 5, 83, 6, 83, 7, + 83, 8, 83, 9, 84, 33, 85, 86, 87, 33, 88, 33, 89, 33, 90, 33, 91, 33}; const char *const grpc_static_metadata_strings[GRPC_STATIC_MDSTR_COUNT] = { "0", @@ -84,8 +84,6 @@ const char *const grpc_static_metadata_strings[GRPC_STATIC_MDSTR_COUNT] = { ":authority", "authorization", "cache-control", - "census-bin", - "census-binary-bin", "content-disposition", "content-encoding", "content-language", @@ -105,11 +103,13 @@ const char *const grpc_static_metadata_strings[GRPC_STATIC_MDSTR_COUNT] = { "GET", "grpc", "grpc-accept-encoding", + "grpc-census-bin", "grpc-encoding", "grpc-internal-encoding-request", "grpc-message", "grpc-status", "grpc-timeout", + "grpc-tracing-bin", "gzip", "gzip, deflate", "host", diff --git a/src/core/lib/transport/static_metadata.h b/src/core/lib/transport/static_metadata.h index 491c8cf125..b51bacac50 100644 --- a/src/core/lib/transport/static_metadata.h +++ b/src/core/lib/transport/static_metadata.h @@ -90,58 +90,58 @@ extern grpc_mdstr grpc_static_mdstr_table[GRPC_STATIC_MDSTR_COUNT]; #define GRPC_MDSTR_AUTHORIZATION (&grpc_static_mdstr_table[20]) /* "cache-control" */ #define GRPC_MDSTR_CACHE_CONTROL (&grpc_static_mdstr_table[21]) -/* "census-bin" */ -#define GRPC_MDSTR_CENSUS_BIN (&grpc_static_mdstr_table[22]) -/* "census-binary-bin" */ -#define GRPC_MDSTR_CENSUS_BINARY_BIN (&grpc_static_mdstr_table[23]) /* "content-disposition" */ -#define GRPC_MDSTR_CONTENT_DISPOSITION (&grpc_static_mdstr_table[24]) +#define GRPC_MDSTR_CONTENT_DISPOSITION (&grpc_static_mdstr_table[22]) /* "content-encoding" */ -#define GRPC_MDSTR_CONTENT_ENCODING (&grpc_static_mdstr_table[25]) +#define GRPC_MDSTR_CONTENT_ENCODING (&grpc_static_mdstr_table[23]) /* "content-language" */ -#define GRPC_MDSTR_CONTENT_LANGUAGE (&grpc_static_mdstr_table[26]) +#define GRPC_MDSTR_CONTENT_LANGUAGE (&grpc_static_mdstr_table[24]) /* "content-length" */ -#define GRPC_MDSTR_CONTENT_LENGTH (&grpc_static_mdstr_table[27]) +#define GRPC_MDSTR_CONTENT_LENGTH (&grpc_static_mdstr_table[25]) /* "content-location" */ -#define GRPC_MDSTR_CONTENT_LOCATION (&grpc_static_mdstr_table[28]) +#define GRPC_MDSTR_CONTENT_LOCATION (&grpc_static_mdstr_table[26]) /* "content-range" */ -#define GRPC_MDSTR_CONTENT_RANGE (&grpc_static_mdstr_table[29]) +#define GRPC_MDSTR_CONTENT_RANGE (&grpc_static_mdstr_table[27]) /* "content-type" */ -#define GRPC_MDSTR_CONTENT_TYPE (&grpc_static_mdstr_table[30]) +#define GRPC_MDSTR_CONTENT_TYPE (&grpc_static_mdstr_table[28]) /* "cookie" */ -#define GRPC_MDSTR_COOKIE (&grpc_static_mdstr_table[31]) +#define GRPC_MDSTR_COOKIE (&grpc_static_mdstr_table[29]) /* "date" */ -#define GRPC_MDSTR_DATE (&grpc_static_mdstr_table[32]) +#define GRPC_MDSTR_DATE (&grpc_static_mdstr_table[30]) /* "deflate" */ -#define GRPC_MDSTR_DEFLATE (&grpc_static_mdstr_table[33]) +#define GRPC_MDSTR_DEFLATE (&grpc_static_mdstr_table[31]) /* "deflate,gzip" */ -#define GRPC_MDSTR_DEFLATE_COMMA_GZIP (&grpc_static_mdstr_table[34]) +#define GRPC_MDSTR_DEFLATE_COMMA_GZIP (&grpc_static_mdstr_table[32]) /* "" */ -#define GRPC_MDSTR_EMPTY (&grpc_static_mdstr_table[35]) +#define GRPC_MDSTR_EMPTY (&grpc_static_mdstr_table[33]) /* "etag" */ -#define GRPC_MDSTR_ETAG (&grpc_static_mdstr_table[36]) +#define GRPC_MDSTR_ETAG (&grpc_static_mdstr_table[34]) /* "expect" */ -#define GRPC_MDSTR_EXPECT (&grpc_static_mdstr_table[37]) +#define GRPC_MDSTR_EXPECT (&grpc_static_mdstr_table[35]) /* "expires" */ -#define GRPC_MDSTR_EXPIRES (&grpc_static_mdstr_table[38]) +#define GRPC_MDSTR_EXPIRES (&grpc_static_mdstr_table[36]) /* "from" */ -#define GRPC_MDSTR_FROM (&grpc_static_mdstr_table[39]) +#define GRPC_MDSTR_FROM (&grpc_static_mdstr_table[37]) /* "GET" */ -#define GRPC_MDSTR_GET (&grpc_static_mdstr_table[40]) +#define GRPC_MDSTR_GET (&grpc_static_mdstr_table[38]) /* "grpc" */ -#define GRPC_MDSTR_GRPC (&grpc_static_mdstr_table[41]) +#define GRPC_MDSTR_GRPC (&grpc_static_mdstr_table[39]) /* "grpc-accept-encoding" */ -#define GRPC_MDSTR_GRPC_ACCEPT_ENCODING (&grpc_static_mdstr_table[42]) +#define GRPC_MDSTR_GRPC_ACCEPT_ENCODING (&grpc_static_mdstr_table[40]) +/* "grpc-census-bin" */ +#define GRPC_MDSTR_GRPC_CENSUS_BIN (&grpc_static_mdstr_table[41]) /* "grpc-encoding" */ -#define GRPC_MDSTR_GRPC_ENCODING (&grpc_static_mdstr_table[43]) +#define GRPC_MDSTR_GRPC_ENCODING (&grpc_static_mdstr_table[42]) /* "grpc-internal-encoding-request" */ -#define GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST (&grpc_static_mdstr_table[44]) +#define GRPC_MDSTR_GRPC_INTERNAL_ENCODING_REQUEST (&grpc_static_mdstr_table[43]) /* "grpc-message" */ -#define GRPC_MDSTR_GRPC_MESSAGE (&grpc_static_mdstr_table[45]) +#define GRPC_MDSTR_GRPC_MESSAGE (&grpc_static_mdstr_table[44]) /* "grpc-status" */ -#define GRPC_MDSTR_GRPC_STATUS (&grpc_static_mdstr_table[46]) +#define GRPC_MDSTR_GRPC_STATUS (&grpc_static_mdstr_table[45]) /* "grpc-timeout" */ -#define GRPC_MDSTR_GRPC_TIMEOUT (&grpc_static_mdstr_table[47]) +#define GRPC_MDSTR_GRPC_TIMEOUT (&grpc_static_mdstr_table[46]) +/* "grpc-tracing-bin" */ +#define GRPC_MDSTR_GRPC_TRACING_BIN (&grpc_static_mdstr_table[47]) /* "gzip" */ #define GRPC_MDSTR_GZIP (&grpc_static_mdstr_table[48]) /* "gzip, deflate" */ diff --git a/test/core/end2end/fuzzers/hpack.dictionary b/test/core/end2end/fuzzers/hpack.dictionary index af075c09ef..3157dfca3f 100644 --- a/test/core/end2end/fuzzers/hpack.dictionary +++ b/test/core/end2end/fuzzers/hpack.dictionary @@ -21,8 +21,6 @@ "\x0A:authority" "\x0Dauthorization" "\x0Dcache-control" -"\x0Acensus-bin" -"\x11census-binary-bin" "\x13content-disposition" "\x10content-encoding" "\x10content-language" @@ -42,11 +40,13 @@ "\x03GET" "\x04grpc" "\x14grpc-accept-encoding" +"\x0Fgrpc-census-bin" "\x0Dgrpc-encoding" "\x1Egrpc-internal-encoding-request" "\x0Cgrpc-message" "\x0Bgrpc-status" "\x0Cgrpc-timeout" +"\x10grpc-tracing-bin" "\x04gzip" "\x0Dgzip, deflate" "\x04host" diff --git a/tools/codegen/core/gen_static_metadata.py b/tools/codegen/core/gen_static_metadata.py index c3c04966df..859adcbeb1 100755 --- a/tools/codegen/core/gen_static_metadata.py +++ b/tools/codegen/core/gen_static_metadata.py @@ -50,8 +50,8 @@ CONFIG = [ 'host', 'grpc-message', 'grpc-status', - 'census-bin', - 'census-binary-bin', + 'grpc-tracing-bin', + 'grpc-census-bin', '', ('grpc-status', '0'), ('grpc-status', '1'), -- cgit v1.2.3