aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Noah Eisen <ncteisen@gmail.com>2017-07-31 19:46:08 -0700
committerGravatar GitHub <noreply@github.com>2017-07-31 19:46:08 -0700
commit6ba3dff070d21819ee1801fcf3ed5040a9fe062d (patch)
tree9550229c41ac603cf9cb5e13eacc545f2fef1781
parentb667f12cef5efd2b379efd7a0bbddd2acd59ad0c (diff)
parent309f20802d951d20c3114366da48d4c9c7a723d2 (diff)
Merge pull request #12009 from ncteisen/convinient-fuzz
Convenient Fuzz Tracing
-rw-r--r--doc/environment_variables.md3
-rw-r--r--test/core/end2end/fuzzers/api_fuzzer.c5
2 files changed, 7 insertions, 1 deletions
diff --git a/doc/environment_variables.md b/doc/environment_variables.md
index ff89b4c9b9..036824d573 100644
--- a/doc/environment_variables.md
+++ b/doc/environment_variables.md
@@ -102,6 +102,9 @@ some configuration as environment variables that can be set.
- INFO - log INFO and ERROR message
- ERROR - log only errors
+* GRPC_TRACE_FUZZER
+ if set, the fuzzers will output trace (it is usually supressed).
+
* GRPC_DNS_RESOLVER
Declares which DNS resolver to use. The default is ares if gRPC is built with
c-ares support. Otherwise, the value of this environment variable is ignored.
diff --git a/test/core/end2end/fuzzers/api_fuzzer.c b/test/core/end2end/fuzzers/api_fuzzer.c
index 281a1af20c..01fa4f748f 100644
--- a/test/core/end2end/fuzzers/api_fuzzer.c
+++ b/test/core/end2end/fuzzers/api_fuzzer.c
@@ -34,6 +34,7 @@
#include "src/core/lib/iomgr/timer.h"
#include "src/core/lib/iomgr/timer_manager.h"
#include "src/core/lib/slice/slice_internal.h"
+#include "src/core/lib/support/env.h"
#include "src/core/lib/surface/server.h"
#include "src/core/lib/transport/metadata.h"
#include "test/core/end2end/data/ssl_test_data.h"
@@ -731,7 +732,9 @@ static validator *make_finished_batch_validator(call_state *cs,
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
grpc_test_only_set_slice_hash_seed(0);
- if (squelch) gpr_set_log_function(dont_log);
+ char *grpc_trace_fuzzer = gpr_getenv("GRPC_TRACE_FUZZER");
+ if (squelch && grpc_trace_fuzzer == NULL) gpr_set_log_function(dont_log);
+ gpr_free(grpc_trace_fuzzer);
input_stream inp = {data, data + size};
grpc_tcp_client_connect_impl = my_tcp_client_connect;
gpr_now_impl = now_impl;