Minor debug support

reviewable/pr8797/r1
Sree Kuchibhotla 8 years ago
parent 6bed2d6ade
commit a0749a6fe8
  1. 15
      Makefile
  2. 2
      build.yaml
  3. 29
      src/core/lib/iomgr/ev_epoll_linux.c
  4. 23
      tools/run_tests/sources_and_headers.json
  5. 48
      vsprojects/vcxproj/google_benchmark/google_benchmark.vcxproj
  6. 118
      vsprojects/vcxproj/google_benchmark/google_benchmark.vcxproj.filters

@ -111,7 +111,7 @@ CXX_dbg = $(DEFAULT_CXX)
LD_dbg = $(DEFAULT_CC)
LDXX_dbg = $(DEFAULT_CXX)
CPPFLAGS_dbg = -O0
DEFINES_dbg = _DEBUG DEBUG
DEFINES_dbg = _DEBUG DEBUG PO_DEBUG
VALID_CONFIG_easan = 1
REQUIRE_CUSTOM_LIBRARIES_easan = 1
@ -6809,19 +6809,6 @@ endif
LIBGOOGLE_BENCHMARK_SRC = \
third_party/google_benchmark/src/benchmark.cc \
third_party/google_benchmark/src/benchmark_register.cc \
third_party/google_benchmark/src/colorprint.cc \
third_party/google_benchmark/src/commandlineflags.cc \
third_party/google_benchmark/src/complexity.cc \
third_party/google_benchmark/src/console_reporter.cc \
third_party/google_benchmark/src/csv_reporter.cc \
third_party/google_benchmark/src/json_reporter.cc \
third_party/google_benchmark/src/reporter.cc \
third_party/google_benchmark/src/sleep.cc \
third_party/google_benchmark/src/string_util.cc \
third_party/google_benchmark/src/sysinfo.cc \
third_party/google_benchmark/src/timers.cc \
PUBLIC_HEADERS_CXX += \

@ -3662,7 +3662,7 @@ configs:
DEFINES: NDEBUG
dbg:
CPPFLAGS: -O0
DEFINES: _DEBUG DEBUG
DEFINES: _DEBUG DEBUG PO_DEBUG
easan:
CC: clang
CPPFLAGS: -O0 -fsanitize-coverage=edge -fsanitize=address -fno-omit-frame-pointer

@ -97,6 +97,9 @@ typedef enum {
} poll_obj_type;
typedef struct poll_obj {
#ifdef PO_DEBUG
poll_obj_type obj_type;
#endif
gpr_mu mu;
struct polling_island *pi;
} poll_obj;
@ -946,6 +949,9 @@ static grpc_fd *fd_create(int fd, const char *name) {
* would be holding a lock to it anyway. */
gpr_mu_lock(&new_fd->po.mu);
new_fd->po.pi = NULL;
#ifdef PO_DEBUG
new_fd->po.obj_type = POLL_OBJ_FD;
#endif
gpr_atm_rel_store(&new_fd->refst, (gpr_atm)1);
new_fd->fd = fd;
@ -1281,6 +1287,9 @@ static void pollset_init(grpc_pollset *pollset, gpr_mu **mu) {
gpr_mu_init(&pollset->po.mu);
*mu = &pollset->po.mu;
pollset->po.pi = NULL;
#ifdef PO_DEBUG
pollset->po.obj_type = POLL_OBJ_POLLSET;
#endif
pollset->root_worker.next = pollset->root_worker.prev = &pollset->root_worker;
pollset->kicked_without_pollers = false;
@ -1656,10 +1665,15 @@ static grpc_error *pollset_work(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
}
static void add_poll_object(grpc_exec_ctx *exec_ctx, poll_obj *bag,
poll_obj *item, poll_obj_type bag_type,
poll_obj_type bag_type, poll_obj *item,
poll_obj_type item_type) {
GPR_TIMER_BEGIN("add_poll_object", 0);
#ifdef PO_DEBUG
GPR_ASSERT(item->obj_type == item_type);
GPR_ASSERT(bag->obj_type == bag_type);
#endif
grpc_error *error = GRPC_ERROR_NONE;
polling_island *pi_new = NULL;
@ -1802,7 +1816,7 @@ retry:
static void pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
grpc_fd *fd) {
add_poll_object(exec_ctx, &pollset->po, &fd->po, POLL_OBJ_POLLSET,
add_poll_object(exec_ctx, &pollset->po, POLL_OBJ_POLLSET, &fd->po,
POLL_OBJ_FD);
}
@ -1812,8 +1826,11 @@ static void pollset_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset *pollset,
static grpc_pollset_set *pollset_set_create(void) {
grpc_pollset_set *pss = gpr_malloc(sizeof(*pss));
pss->po.pi = NULL;
gpr_mu_init(&pss->po.mu);
pss->po.pi = NULL;
#ifdef PO_DEBUG
pss->po.obj_type = POLL_OBJ_POLLSET_SET;
#endif
return pss;
}
@ -1831,7 +1848,7 @@ static void pollset_set_destroy(grpc_pollset_set *pss) {
static void pollset_set_add_fd(grpc_exec_ctx *exec_ctx, grpc_pollset_set *pss,
grpc_fd *fd) {
add_poll_object(exec_ctx, &pss->po, &fd->po, POLL_OBJ_POLLSET_SET,
add_poll_object(exec_ctx, &pss->po, POLL_OBJ_POLLSET_SET, &fd->po,
POLL_OBJ_FD);
}
@ -1842,7 +1859,7 @@ static void pollset_set_del_fd(grpc_exec_ctx *exec_ctx, grpc_pollset_set *pss,
static void pollset_set_add_pollset(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *pss, grpc_pollset *ps) {
add_poll_object(exec_ctx, &pss->po, &ps->po, POLL_OBJ_POLLSET_SET,
add_poll_object(exec_ctx, &pss->po, POLL_OBJ_POLLSET_SET, &ps->po,
POLL_OBJ_POLLSET);
}
@ -1854,7 +1871,7 @@ static void pollset_set_del_pollset(grpc_exec_ctx *exec_ctx,
static void pollset_set_add_pollset_set(grpc_exec_ctx *exec_ctx,
grpc_pollset_set *bag,
grpc_pollset_set *item) {
add_poll_object(exec_ctx, &bag->po, &item->po, POLL_OBJ_POLLSET_SET,
add_poll_object(exec_ctx, &bag->po, POLL_OBJ_POLLSET_SET, &item->po,
POLL_OBJ_POLLSET_SET);
}

@ -6203,28 +6203,7 @@
},
{
"deps": [],
"headers": [
"third_party/google_benchmark/include/benchmark/benchmark.h",
"third_party/google_benchmark/include/benchmark/benchmark_api.h",
"third_party/google_benchmark/include/benchmark/macros.h",
"third_party/google_benchmark/include/benchmark/reporter.h",
"third_party/google_benchmark/src/arraysize.h",
"third_party/google_benchmark/src/benchmark_api_internal.h",
"third_party/google_benchmark/src/check.h",
"third_party/google_benchmark/src/colorprint.h",
"third_party/google_benchmark/src/commandlineflags.h",
"third_party/google_benchmark/src/complexity.h",
"third_party/google_benchmark/src/cycleclock.h",
"third_party/google_benchmark/src/internal_macros.h",
"third_party/google_benchmark/src/log.h",
"third_party/google_benchmark/src/mutex.h",
"third_party/google_benchmark/src/re.h",
"third_party/google_benchmark/src/sleep.h",
"third_party/google_benchmark/src/stat.h",
"third_party/google_benchmark/src/string_util.h",
"third_party/google_benchmark/src/sysinfo.h",
"third_party/google_benchmark/src/timers.h"
],
"headers": [],
"is_filegroup": false,
"language": "c++",
"name": "google_benchmark",

@ -147,53 +147,7 @@
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\include\benchmark\benchmark.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\include\benchmark\benchmark_api.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\include\benchmark\macros.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\include\benchmark\reporter.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\arraysize.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\benchmark_api_internal.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\check.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\colorprint.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\commandlineflags.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\complexity.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\cycleclock.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\internal_macros.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\log.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\mutex.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\re.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\sleep.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\stat.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\string_util.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\sysinfo.h" />
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\timers.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\benchmark.cc">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\benchmark_register.cc">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\colorprint.cc">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\commandlineflags.cc">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\complexity.cc">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\console_reporter.cc">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\csv_reporter.cc">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\json_reporter.cc">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\reporter.cc">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\sleep.cc">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\string_util.cc">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\sysinfo.cc">
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\timers.cc">
<ClCompile Include="$(SolutionDir)\..\vsprojects\dummy.c">
</ClCompile>
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />

@ -1,125 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\benchmark.cc">
<Filter>third_party\google_benchmark\src</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\benchmark_register.cc">
<Filter>third_party\google_benchmark\src</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\colorprint.cc">
<Filter>third_party\google_benchmark\src</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\commandlineflags.cc">
<Filter>third_party\google_benchmark\src</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\complexity.cc">
<Filter>third_party\google_benchmark\src</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\console_reporter.cc">
<Filter>third_party\google_benchmark\src</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\csv_reporter.cc">
<Filter>third_party\google_benchmark\src</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\json_reporter.cc">
<Filter>third_party\google_benchmark\src</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\reporter.cc">
<Filter>third_party\google_benchmark\src</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\sleep.cc">
<Filter>third_party\google_benchmark\src</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\string_util.cc">
<Filter>third_party\google_benchmark\src</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\sysinfo.cc">
<Filter>third_party\google_benchmark\src</Filter>
</ClCompile>
<ClCompile Include="$(SolutionDir)\..\third_party\google_benchmark\src\timers.cc">
<Filter>third_party\google_benchmark\src</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\include\benchmark\benchmark.h">
<Filter>third_party\google_benchmark\include\benchmark</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\include\benchmark\benchmark_api.h">
<Filter>third_party\google_benchmark\include\benchmark</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\include\benchmark\macros.h">
<Filter>third_party\google_benchmark\include\benchmark</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\include\benchmark\reporter.h">
<Filter>third_party\google_benchmark\include\benchmark</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\arraysize.h">
<Filter>third_party\google_benchmark\src</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\benchmark_api_internal.h">
<Filter>third_party\google_benchmark\src</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\check.h">
<Filter>third_party\google_benchmark\src</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\colorprint.h">
<Filter>third_party\google_benchmark\src</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\commandlineflags.h">
<Filter>third_party\google_benchmark\src</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\complexity.h">
<Filter>third_party\google_benchmark\src</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\cycleclock.h">
<Filter>third_party\google_benchmark\src</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\internal_macros.h">
<Filter>third_party\google_benchmark\src</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\log.h">
<Filter>third_party\google_benchmark\src</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\mutex.h">
<Filter>third_party\google_benchmark\src</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\re.h">
<Filter>third_party\google_benchmark\src</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\sleep.h">
<Filter>third_party\google_benchmark\src</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\stat.h">
<Filter>third_party\google_benchmark\src</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\string_util.h">
<Filter>third_party\google_benchmark\src</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\sysinfo.h">
<Filter>third_party\google_benchmark\src</Filter>
</ClInclude>
<ClInclude Include="$(SolutionDir)\..\third_party\google_benchmark\src\timers.h">
<Filter>third_party\google_benchmark\src</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<Filter Include="third_party">
<UniqueIdentifier>{7458b63d-7ba4-103d-2bed-3e3ad30d8237}</UniqueIdentifier>
</Filter>
<Filter Include="third_party\google_benchmark">
<UniqueIdentifier>{54a154e8-669b-a7c1-9b6e-bd1aab2f86e3}</UniqueIdentifier>
</Filter>
<Filter Include="third_party\google_benchmark\include">
<UniqueIdentifier>{f54c3cb1-ec20-a651-6956-78379b51e1a5}</UniqueIdentifier>
</Filter>
<Filter Include="third_party\google_benchmark\include\benchmark">
<UniqueIdentifier>{0483a457-8050-4565-bc15-09695bf7b822}</UniqueIdentifier>
</Filter>
<Filter Include="third_party\google_benchmark\src">
<UniqueIdentifier>{c39ff2d1-691e-4614-4d75-4bc20db05e09}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>

Loading…
Cancel
Save