Skip to content

Commit 4560588

Browse files
Merge pull request #80 from hi-rajat-kumar/master
build-fix: conditionally compile `epoll_pwait2()` only when your comp…
2 parents 8d2ab31 + 177b0fb commit 4560588

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,14 @@ be insignificant. However, the keys are case sensitive.
422422
throughput_units
423423
throughput
424424

425+
## Compile Neper
426+
427+
To compile `neper`, run `make` or `make all` on your CLI. This will create all the eight binaries, `tcp_rr`, `tcp_stream`, `tcp_crr`, `udp_rr`, `udp_stream`, `psp_stream`, `psp_crr` and `psp_rr` for you.
428+
429+
You can enable the use of `epoll_pwait2()` by passing defination `-DHAVE_EPOLL_PWAIT2` under `CFLAGS` of `Makefile`. Before enabling it make sure that your libc has `epoll_pwait2()` support.
430+
431+
To build a docker image, run `make image` from your CLI.
432+
425433
## Running in Kubernetes
426434

427435
When running `neper` in Kubernetes for network performance testing, it is important to ensure that the client and server pods are running on different nodes. This provides a more realistic network path and avoids the test being skewed by the node's internal loopback traffic.

thread.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ int neper_epoll_wait(int epfd, struct epoll_event *events, int maxevents,
359359
return epoll_wait(epfd, events, maxevents, ms);
360360
}
361361

362-
#ifdef __NR_epoll_pwait2
362+
#ifdef HAVE_EPOLL_PWAIT2
363363
int neper_epoll_pwait2(int epfd, struct epoll_event *events, int maxevents,
364364
struct timespec *timeout)
365365
{
@@ -401,7 +401,7 @@ void start_worker_threads(struct options *opts, struct callbacks *cb,
401401
*/
402402
int64_t rounding_ns = 500000;
403403
poll_wait poll_func = neper_epoll_wait;
404-
#ifdef __NR_epoll_pwait2
404+
#ifdef HAVE_EPOLL_PWAIT2
405405
struct epoll_event events;
406406
epoll_pwait2(-1, &events, 0, NULL, NULL); /* Sets EINVAL or ENOSYS. */
407407
if (errno != ENOSYS) {

0 commit comments

Comments
 (0)