From afbb41fa2e9fbccd392469756ef657cc3461bfe1 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Thu, 14 Feb 2019 17:41:52 +0100 Subject: [PATCH] WIP measure latency + remove wrong comment --- CMakeLists.txt | 6 +++++- src/evt_core.c | 2 +- src/meas_lat.c | 13 +++++++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 src/meas_lat.c diff --git a/CMakeLists.txt b/CMakeLists.txt index e15c728..df58272 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,13 +26,17 @@ list(APPEND CSOURCES ) add_executable(donar ${CSOURCES} src/donar.c) +add_executable(measlat ${CSOURCES} src/meas_lat.c) find_package(PkgConfig REQUIRED) pkg_search_module(GLIB REQUIRED glib-2.0) + target_include_directories(donar PRIVATE ${GLIB_INCLUDE_DIRS}) target_link_libraries(donar ${GLIB_LDFLAGS}) +target_include_directories(measlat PRIVATE ${GLIB_INCLUDE_DIRS}) +target_link_libraries(measlat ${GLIB_LDFLAGS}) -install(TARGETS donar +install(TARGETS donar measlat RUNTIME DESTINATION bin LIBRARY DESTINATION lib) \ No newline at end of file diff --git a/src/evt_core.c b/src/evt_core.c index 40cf303..939bb85 100644 --- a/src/evt_core.c +++ b/src/evt_core.c @@ -80,7 +80,7 @@ void evt_core_add_fd(struct evt_core_ctx* ctx, char* name, int fd) { } g_array_append_val (cat->socklist, fd); - g_hash_table_insert(ctx->socklist, key, cat); // broken + g_hash_table_insert(ctx->socklist, key, cat); add_fd_to_epoll(ctx->epollfd, fd, cat->flags); } diff --git a/src/meas_lat.c b/src/meas_lat.c new file mode 100644 index 0000000..14220b1 --- /dev/null +++ b/src/meas_lat.c @@ -0,0 +1,13 @@ +#include +#include +#include "evt_core.h" + +int main(void) { + struct evt_core_ctx evts = {0}; + struct evt_core_cat udp_read = {}; + struct evt_core_cat timer = {}; + + evt_core_init(&evts); + + return 0; +}