aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Vijay Pai <vpai@google.com>2017-10-20 06:09:44 -0700
committerGravatar Vijay Pai <vpai@google.com>2017-10-30 13:31:07 -0700
commitcb36615ddd0d8446032c2fda936337b330cd3f7f (patch)
tree5aff104cdf8d021907cf88eb78f91020696690f5
parent662ec97674dd0918f4db4c21f5f47038c535a9ba (diff)
GPR_ATTRIBUTE_NO_TSAN doesn't reach through function calls, so use a friend
-rw-r--r--src/core/ext/transport/chttp2/transport/flow_control.h8
-rw-r--r--test/cpp/microbenchmarks/bm_fullstack_trickle.cc21
2 files changed, 19 insertions, 10 deletions
diff --git a/src/core/ext/transport/chttp2/transport/flow_control.h b/src/core/ext/transport/chttp2/transport/flow_control.h
index d5107d467b..905161497d 100644
--- a/src/core/ext/transport/chttp2/transport/flow_control.h
+++ b/src/core/ext/transport/chttp2/transport/flow_control.h
@@ -32,6 +32,12 @@ struct grpc_chttp2_stream;
extern "C" grpc_tracer_flag grpc_flowctl_trace;
+namespace grpc {
+namespace testing {
+ class TrickledCHTTP2; // to make this a friend
+} // namespace testing
+} // namespace grpc
+
namespace grpc_core {
namespace chttp2 {
@@ -203,6 +209,7 @@ class TransportFlowControl {
}
private:
+ friend class ::grpc::testing::TrickledCHTTP2;
double TargetLogBdp();
double SmoothLogBdp(grpc_exec_ctx* exec_ctx, double value);
FlowControlAction::Urgency DeltaUrgency(int32_t value,
@@ -297,6 +304,7 @@ class StreamFlowControl {
}
private:
+ friend class ::grpc::testing::TrickledCHTTP2;
TransportFlowControl* const tfc_;
const grpc_chttp2_stream* const s_;
diff --git a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc
index 389b8c90ab..25d243a104 100644
--- a/test/cpp/microbenchmarks/bm_fullstack_trickle.cc
+++ b/test/cpp/microbenchmarks/bm_fullstack_trickle.cc
@@ -21,6 +21,7 @@
#include <benchmark/benchmark.h>
#include <gflags/gflags.h>
#include <fstream>
+
#include "src/core/ext/transport/chttp2/transport/chttp2_transport.h"
#include "src/core/ext/transport/chttp2/transport/internal.h"
#include "src/core/lib/iomgr/timer_manager.h"
@@ -142,17 +143,17 @@ class TrickledCHTTP2 : public EndpointPairFixture {
client->lists[GRPC_CHTTP2_LIST_STALLED_BY_STREAM].head != nullptr,
server->lists[GRPC_CHTTP2_LIST_STALLED_BY_TRANSPORT].head != nullptr,
server->lists[GRPC_CHTTP2_LIST_STALLED_BY_STREAM].head != nullptr,
- client->flow_control->remote_window(),
- server->flow_control->remote_window(),
- client->flow_control->announced_window(),
- server->flow_control->announced_window(),
- client_stream ? client_stream->flow_control->remote_window_delta() : -1,
- server_stream ? server_stream->flow_control->remote_window_delta() : -1,
- client_stream ? client_stream->flow_control->local_window_delta() : -1,
- server_stream ? server_stream->flow_control->local_window_delta() : -1,
- client_stream ? client_stream->flow_control->announced_window_delta()
+ client->flow_control->remote_window_,
+ server->flow_control->remote_window_,
+ client->flow_control->announced_window_,
+ server->flow_control->announced_window_,
+ client_stream ? client_stream->flow_control->remote_window_delta_ : -1,
+ server_stream ? server_stream->flow_control->remote_window_delta_ : -1,
+ client_stream ? client_stream->flow_control->local_window_delta_ : -1,
+ server_stream ? server_stream->flow_control->local_window_delta_ : -1,
+ client_stream ? client_stream->flow_control->announced_window_delta_
: -1,
- server_stream ? server_stream->flow_control->announced_window_delta()
+ server_stream ? server_stream->flow_control->announced_window_delta_
: -1,
client->settings[GRPC_PEER_SETTINGS]
[GRPC_CHTTP2_SETTINGS_INITIAL_WINDOW_SIZE],