summaryrefslogtreecommitdiff
path: root/src/tools/operf
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/operf')
-rw-r--r--src/tools/operf/CMakeLists.txt5
-rw-r--r--src/tools/operf/operf.c12
-rw-r--r--src/tools/operf/operf_client.c12
-rw-r--r--src/tools/operf/operf_server.c4
4 files changed, 16 insertions, 17 deletions
diff --git a/src/tools/operf/CMakeLists.txt b/src/tools/operf/CMakeLists.txt
index 895d706c..b6faf04e 100644
--- a/src/tools/operf/CMakeLists.txt
+++ b/src/tools/operf/CMakeLists.txt
@@ -4,6 +4,11 @@ include_directories(${CMAKE_CURRENT_BINARY_DIR})
include_directories(${CMAKE_SOURCE_DIR}/include)
include_directories(${CMAKE_BINARY_DIR}/include)
+get_filename_component(CURRENT_SOURCE_PARENT_DIR
+ ${CMAKE_CURRENT_SOURCE_DIR} DIRECTORY)
+
+include_directories(${CURRENT_SOURCE_PARENT_DIR})
+
find_library(LIBM_LIBRARIES m)
if(NOT LIBM_LIBRARIES)
message(FATAL_ERROR "libm not found")
diff --git a/src/tools/operf/operf.c b/src/tools/operf/operf.c
index 69fc5cb9..fe387724 100644
--- a/src/tools/operf/operf.c
+++ b/src/tools/operf/operf.c
@@ -39,14 +39,24 @@
#define _POSIX_C_SOURCE 199506L
#define __XSI_VISIBLE 500
-#include <ouroboros/fqueue.h>
#include <ouroboros/dev.h>
+#include <ouroboros/fccntl.h>
+#include <ouroboros/fqueue.h>
+
+#include "time_utils.h"
#include <stdio.h>
#include <string.h>
#include <pthread.h>
#include <stdint.h>
#include <stdbool.h>
+#include <signal.h>
+#include <stdlib.h>
+#include <sys/time.h>
+#include <arpa/inet.h>
+#include <math.h>
+#include <errno.h>
+#include <float.h>
#define OPERF_BUF_SIZE (1024 * 1024)
diff --git a/src/tools/operf/operf_client.c b/src/tools/operf/operf_client.c
index c6f32440..1518bdf5 100644
--- a/src/tools/operf/operf_client.c
+++ b/src/tools/operf/operf_client.c
@@ -36,18 +36,6 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <ouroboros/dev.h>
-#include <ouroboros/fccntl.h>
-#include <ouroboros/time_utils.h>
-
-#include <signal.h>
-#include <stdlib.h>
-#include <sys/time.h>
-#include <arpa/inet.h>
-#include <math.h>
-#include <errno.h>
-#include <float.h>
-
static void busy_wait_until(const struct timespec * deadline)
{
struct timespec now;
diff --git a/src/tools/operf/operf_server.c b/src/tools/operf/operf_server.c
index ac6306af..11eb92fc 100644
--- a/src/tools/operf/operf_server.c
+++ b/src/tools/operf/operf_server.c
@@ -36,10 +36,6 @@
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#include <stdlib.h>
-#include <signal.h>
-#include <arpa/inet.h>
-
void shutdown_server(int signo, siginfo_t * info, void * c)
{
(void) info;