Correction to closure.cc,bm_chttp2_hpack and few more

reviewable/pr13058/r4
Yash Tibrewal 7 years ago
parent 3150744c71
commit 0032548674
  1. 37
      err
  2. BIN
      grpc_c.32.ruby
  3. BIN
      grpc_c.64.ruby
  4. 1
      memory_usage.csv
  5. 49
      remove_exec_ctx.py
  6. 1
      scenario_result.json
  7. 2
      src/core/ext/filters/client_channel/subchannel_index.cc
  8. 10
      src/core/lib/iomgr/closure.cc
  9. 4
      src/core/lib/iomgr/combiner.cc
  10. 2
      src/core/lib/iomgr/executor.cc
  11. 4
      src/core/lib/iomgr/pollset_windows.cc
  12. 5
      src/core/lib/iomgr/tcp_windows.cc
  13. 2
      test/core/debug/stats_test.cc
  14. 2
      test/cpp/microbenchmarks/bm_chttp2_hpack.cc
  15. 2
      test/cpp/microbenchmarks/bm_chttp2_transport.cc

37
err

@ -1,37 +0,0 @@
src/core/ext/transport/inproc/inproc_transport.cc: In function ‘void grpc_inproc_transport_init()’:
src/core/ext/transport/inproc/inproc_transport.cc:1092:17: error: unused variable ‘exec_ctx’ [-Werror=unused-variable]
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
^
src/core/ext/transport/inproc/inproc_transport.cc: In function ‘grpc_channel* grpc_inproc_channel_create(grpc_server*, grpc_channel_args*, void*)’:
src/core/ext/transport/inproc/inproc_transport.cc:1158:17: error: unused variable ‘exec_ctx’ [-Werror=unused-variable]
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
^
src/core/ext/transport/inproc/inproc_transport.cc: In function ‘void grpc_inproc_transport_shutdown()’:
src/core/ext/transport/inproc/inproc_transport.cc:1192:17: error: unused variable ‘exec_ctx’ [-Werror=unused-variable]
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
^
cc1plus: all warnings being treated as errors
make: *** [/usr/local/google/home/yashkt/grpc-projects/grpc-c-fork/grpc/objs/opt/src/core/ext/transport/inproc/inproc_transport.o] Error 1
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc: In function ‘void grpc_ares_request_unref(grpc_ares_request*)’:
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc:111:21: error: unused variable ‘new_exec_ctx’ [-Werror=unused-variable]
grpc_exec_ctx new_exec_ctx = GRPC_EXEC_CTX_INIT;
^
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc: In function ‘void on_srv_query_done_cb(void*, int, int, unsigned char*, int)’:
src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.cc:229:17: error: unused variable ‘exec_ctx’ [-Werror=unused-variable]
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
^
cc1plus: all warnings being treated as errors
make: *** [/usr/local/google/home/yashkt/grpc-projects/grpc-c-fork/grpc/objs/opt/src/core/ext/filters/client_channel/resolver/dns/c_ares/grpc_ares_wrapper.o] Error 1
src/cpp/common/channel_arguments.cc: In destructor ‘grpc::ChannelArguments::~ChannelArguments()’:
src/cpp/common/channel_arguments.cc:70:17: error: unused variable ‘exec_ctx’ [-Werror=unused-variable]
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
^
src/cpp/common/channel_arguments.cc: In member function ‘void grpc::ChannelArguments::SetSocketMutator(grpc_socket_mutator*)’:
src/cpp/common/channel_arguments.cc:99:17: error: unused variable ‘exec_ctx’ [-Werror=unused-variable]
grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT;
^
cc1plus: all warnings being treated as errors
make: *** [/usr/local/google/home/yashkt/grpc-projects/grpc-c-fork/grpc/objs/opt/src/cpp/common/channel_arguments.o] Error 1
src/proto/grpc/testing/services.proto: warning: Import src/proto/grpc/testing/stats.proto but not used.
src/proto/grpc/testing/services.proto: warning: Import src/proto/grpc/testing/stats.proto but not used.
make: Target `all' not remade because of errors.

Binary file not shown.

Binary file not shown.

@ -1 +0,0 @@
8771.168889,165387,4457938,8698.928889,210284,,
unable to load file from head commit

@ -1,49 +0,0 @@
import os
import sys
import re
def repl_fn(m):
ret = ''
ret = ret + m.groups()[0] + '('
for i in range(1, len(m.groups())):
if(m.groups()[i] != None):
ret = ret + m.groups()[i]
else:
break
ret = ret + ')'
print '\n' + m.group() + '\nwith\n' + ret + '\n'
return ret
def work_on(fname):
with open(fname) as f:
p = re.compile(r'((?:\b[^\s\(\),]+)|(?:\(\*[^\s\(\),]+\)))\s*' + # function name or function pointer
r'\(\s*' + # open brackets
r'(?:(?:exec_ctx)|(?:grpc_exec_ctx\s*\*\s*exec_ctx)|(?:&\s*exec_ctx))' + # first exec_ctx paramenter
r'\s*,?' + # comma after exec_ctx
r'(\s*[^\),]+)?' + # all but first argument
r'(\s*,\s*[^\),]+)?' + # all but first argument
r'(\s*,\s*[^\),]+)?' + # all but first argument
r'(\s*,\s*[^\),]+)?' + # all but first argument
r'(\s*,\s*[^\),]+)?' + # all but first argument
r'(\s*,\s*[^\),]+)?' + # all but first argument
r'(\s*,\s*[^\),]+)?' + # all but first argument
r'(\s*,\s*[^\),]+)?' + # all but first argument
r'(\s*,\s*[^\),]+)?' + # all but first argument
r'(\s*,\s*[^\),]+)?' + # all but first argument
r'(\s*,\s*[^\),]+)?' + # all but first argument
r'\s*\)') # close brackets
res = p.sub(repl_fn, f.read())
f = open(fname, 'w')
f.write(res)
f.close()
#print res
def main():
file_list = []
for line in sys.stdin:
work_on(line.strip())
if __name__ == '__main__':
main()

File diff suppressed because one or more lines are too long

@ -134,7 +134,7 @@ void grpc_subchannel_index_unref(void) {
if (gpr_unref(&g_refcount)) {
ExecCtx _local_exec_ctx;
gpr_mu_destroy(&g_mu);
gpr_avl_unref(g_subchannel_index, &exec_ctx);
gpr_avl_unref(g_subchannel_index, exec_ctx);
grpc_exec_ctx_finish();
}
}

@ -135,8 +135,8 @@ grpc_closure* grpc_closure_create(grpc_iomgr_cb_func cb, void* cb_arg,
}
#ifndef NDEBUG
void grpc_closure_run(const char* file, int line, grpc_exec_ctx* exec_ctx,
grpc_closure* c, grpc_error* error) {
void grpc_closure_run(const char* file, int line, grpc_closure* c,
grpc_error* error) {
#else
void grpc_closure_run(grpc_closure* c, grpc_error* error) {
#endif
@ -156,8 +156,8 @@ void grpc_closure_run(grpc_closure* c, grpc_error* error) {
}
#ifndef NDEBUG
void grpc_closure_sched(const char* file, int line, grpc_exec_ctx* exec_ctx,
grpc_closure* c, grpc_error* error) {
void grpc_closure_sched(const char* file, int line, grpc_closure* c,
grpc_error* error) {
#else
void grpc_closure_sched(grpc_closure* c, grpc_error* error) {
#endif
@ -187,7 +187,7 @@ void grpc_closure_sched(grpc_closure* c, grpc_error* error) {
#ifndef NDEBUG
void grpc_closure_list_sched(const char* file, int line,
grpc_exec_ctx* exec_ctx, grpc_closure_list* list) {
grpc_closure_list* list) {
#else
void grpc_closure_list_sched(grpc_closure_list* list) {
#endif

@ -161,7 +161,7 @@ static void combiner_exec(grpc_closure* cl, grpc_error* error) {
GRPC_STATS_INC_COMBINER_LOCKS_INITIATED();
GPR_TIMER_MARK("combiner.initiated", 0);
gpr_atm_no_barrier_store(&lock->initiating_exec_ctx_or_null,
(gpr_atm)&exec_ctx);
(gpr_atm)exec_ctx);
// first element on this list: add it to the list of combiner locks
// executing within this exec_ctx
push_last_on_exec_ctx(lock);
@ -170,7 +170,7 @@ static void combiner_exec(grpc_closure* cl, grpc_error* error) {
// offload for one or two actions, and that's fine
gpr_atm initiator =
gpr_atm_no_barrier_load(&lock->initiating_exec_ctx_or_null);
if (initiator != 0 && initiator != (gpr_atm)&exec_ctx) {
if (initiator != 0 && initiator != (gpr_atm)exec_ctx) {
gpr_atm_no_barrier_store(&lock->initiating_exec_ctx_or_null, 0);
}
}

@ -206,7 +206,7 @@ static void executor_push(grpc_closure* closure, grpc_error* error,
}
thread_state* ts = (thread_state*)gpr_tls_get(&g_this_thread_state);
if (ts == NULL) {
ts = &g_thread_state[GPR_HASH_POINTER(&exec_ctx, cur_thread_count)];
ts = &g_thread_state[GPR_HASH_POINTER(exec_ctx, cur_thread_count)];
} else {
GRPC_STATS_INC_EXECUTOR_SCHEDULED_TO_SELF();
}

@ -160,10 +160,10 @@ grpc_error* grpc_pollset_work(grpc_pollset* pollset,
while (!worker.kicked) {
if (gpr_cv_wait(&worker.cv, &grpc_polling_mu,
grpc_millis_to_timespec(deadline, GPR_CLOCK_REALTIME))) {
grpc_exec_ctx_invalidate_now(exec_ctx);
grpc_exec_ctx_invalidate_now();
break;
}
grpc_exec_ctx_invalidate_now(exec_ctx);
grpc_exec_ctx_invalidate_now();
}
} else {
pollset->kicked_without_pollers = 0;

@ -366,8 +366,7 @@ static void win_add_to_pollset_set(grpc_endpoint* ep, grpc_pollset_set* pss) {
grpc_iocp_add_socket(tcp->socket);
}
static void win_delete_from_pollset_set(grpc_exec_ctx* exec_ctx,
grpc_endpoint* ep,
static void win_delete_from_pollset_set(grpc_endpoint* ep,
grpc_pollset_set* pss) {}
/* Initiates a shutdown of the TCP endpoint. This will queue abort callbacks
@ -446,7 +445,7 @@ grpc_endpoint* grpc_tcp_create(grpc_winsocket* socket,
tcp->resource_user = grpc_resource_user_create(resource_quota, peer_string);
/* Tell network status tracking code about the new endpoint */
grpc_network_status_register_endpoint(&tcp->base);
grpc_resource_quota_unref_internal(exec_ctx, resource_quota);
grpc_resource_quota_unref_internal(resource_quota);
return &tcp->base;
}

@ -95,7 +95,7 @@ TEST_P(HistogramTest, IncHistogram) {
Snapshot snapshot;
ExecCtx _local_exec_ctx;
grpc_stats_inc_histogram[kHistogram](&exec_ctx, j);
grpc_stats_inc_histogram[kHistogram](j);
grpc_exec_ctx_finish();
auto delta = snapshot.delta();

@ -443,7 +443,7 @@ static void UnrefHeader(void* user_data, grpc_mdelem md) {
GRPC_MDELEM_UNREF(md);
}
template <class Fixture, void (*OnHeader)(grpc_exec_ctx*, void*, grpc_mdelem)>
template <class Fixture, void (*OnHeader)(void*, grpc_mdelem)>
static void BM_HpackParserParseHeader(benchmark::State& state) {
TrackCounters track_counters;
ExecCtx _local_exec_ctx;

@ -152,7 +152,7 @@ class Fixture {
private:
DummyEndpoint* ep_;
grpc_exec_ctx _local_exec_ctx;
ExecCtx _local_exec_ctx;
grpc_transport* t_;
};

Loading…
Cancel
Save