Skip to contentSkip to conversation

Change LTTNG_POLL_GETNB behaviour for poll flavor

PATCH New Yannick Lamarre 2 participants 9 messages Apr 25, 2019 – May 7, 2019 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

PATCH v6 1/8 Fix: lttng_poll_mod calls compat_(e)poll_add

lttng_poll_mod should call compat_(e)poll_mod.

---
 src/common/compat/poll.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
src/common/compat/poll.h +2 -2
index d4bd87f5..fde54ddb 100644
@@ -177,7 +177,7 @@ extern int compat_epoll_del(struct lttng_poll_event *events, int fd);
 extern int compat_epoll_mod(struct lttng_poll_event *events,
 		int fd, uint32_t req_events);
 #define lttng_poll_mod(events, fd, req_events) \
-	compat_epoll_add(events, fd, req_events)
+	compat_epoll_mod(events, fd, req_events)
 
 /*
  * Set up the poll set limits variable poll_max_size
@@ -361,7 +361,7 @@ extern int compat_poll_del(struct lttng_poll_event *events, int fd);
 extern int compat_poll_mod(struct lttng_poll_event *events,
 		int fd, uint32_t req_events);
 #define lttng_poll_mod(events, fd, req_events) \
-	compat_poll_add(events, fd, req_events)
+	compat_poll_mod(events, fd, req_events)
 
 /*
  * Set up the poll set limits variable poll_max_size
Signature · 1 line
2.11.0
#2 lore raw

PATCH v6 2/8 Add Unit test to poll compatibility layer

In reply to a message not in the archive
---
 .gitignore                          |   1 +
 tests/unit/Makefile.am              |   9 +-
 tests/unit/test_utils_compat_poll.c | 233 ++++++++++++++++++++++++++++++++++++
 3 files changed, 242 insertions(+), 1 deletion(-)
 create mode 100644 tests/unit/test_utils_compat_poll.c
.gitignore +1 -0
index 19276012..b5d2a55a 100644
@@ -73,6 +73,7 @@ TAGS
 /tests/unit/test_session
 /tests/unit/test_uri
 /tests/unit/test_ust_data
+/tests/unit/test_utils_compat_poll
 /tests/unit/test_utils_parse_size_suffix
 /tests/unit/test_utils_parse_time_suffix
 /tests/unit/test_utils_expand_path
tests/unit/Makefile.am +8 -1
index 5f485f00..a949d3cd 100644
@@ -12,6 +12,7 @@ TESTS = test_kernel_data \
 	test_utils_parse_size_suffix \
 	test_utils_parse_time_suffix \
 	test_utils_expand_path \
+	test_utils_compat_poll \
 	test_string_utils \
 	test_notification \
 	ini_config/test_ini_config
@@ -28,7 +29,8 @@ LIBLTTNG_CTL=$(top_builddir)/src/lib/lttng-ctl/liblttng-ctl.la
 # Define test programs
 noinst_PROGRAMS = test_uri test_session test_kernel_data \
                   test_utils_parse_size_suffix test_utils_parse_time_suffix \
-                  test_utils_expand_path test_string_utils test_notification
+                  test_utils_expand_path test_utils_compat_poll \
+                  test_string_utils test_notification
 
 if HAVE_LIBLTTNG_UST_CTL
 noinst_PROGRAMS += test_ust_data
@@ -145,6 +147,11 @@ test_utils_parse_size_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL
 test_utils_parse_time_suffix_SOURCES = test_utils_parse_time_suffix.c
 test_utils_parse_time_suffix_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON)
 
+# compat_poll unit test
+test_utils_compat_poll_SOURCES = test_utils_compat_poll.c
+test_utils_compat_poll_LDADD  = $(LIBTAP) $(LIBHASHTABLE) $(DL_LIBS) \
+		      $(top_builddir)/src/common/compat/libcompat.la $(LIBCOMMON)
+
 # expand_path unit test
 test_utils_expand_path_SOURCES = test_utils_expand_path.c
 test_utils_expand_path_LDADD = $(LIBTAP) $(LIBHASHTABLE) $(LIBCOMMON) $(DL_LIBS)
tests/unit/test_utils_compat_poll.c new file +233 -0

233 lines not on this page · raw message

Signature · 1 line
2.11.0
#3 lore raw

PATCH v6 3/8 Change LTTNG_POLL_GETNB behaviour for poll flavor

In reply to a message not in the archive

Modify LTTNG_POLL_GETNB to provide compatibility with the epoll flavor. Since it is only used after a lttng_poll_wait call with no modification (add, del, mod) between, this change does not modify the behaviour in its current usage while ensuring similar API behavior between compatibility layer implementations.

---
 src/common/compat/poll.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
src/common/compat/poll.h +3 -1
index fde54ddb..5eb7ff9c 100644
@@ -315,10 +315,12 @@ static inline int __lttng_poll_get_prev_fd(struct lttng_poll_event *events,
 /*
  * For the following calls, consider 'e' to be a lttng_poll_event pointer and i
  * being the index of the events array.
+ * LTTNG_POLL_GETNB is always used after lttng_poll_wait, thus we can use the
+ * current list for test compatibility purposes.
  */
 #define LTTNG_POLL_GETFD(e, i) LTTNG_REF(e)->wait.events[i].fd
 #define LTTNG_POLL_GETEV(e, i) LTTNG_REF(e)->wait.events[i].revents
-#define LTTNG_POLL_GETNB(e) LTTNG_REF(e)->wait.nb_fd
+#define LTTNG_POLL_GETNB(e) LTTNG_REF(e)->current.nb_fd
 #define LTTNG_POLL_GETSZ(e) LTTNG_REF(e)->wait.events_size
 #define LTTNG_POLL_GET_PREV_FD(e, i, nb_fd) \
 	__lttng_poll_get_prev_fd(LTTNG_REF(e), i, nb_fd)
Signature · 1 line
2.11.0
#4 lore raw

PATCH v6 4/8 Adapt poll layer behaviour to match the epoll layer

In reply to a message not in the archive
---
 src/common/compat/compat-poll.c | 30 ++++++++++++++++++++----------
 1 file changed, 20 insertions(+), 10 deletions(-)
src/common/compat/compat-poll.c +20 -10
index b45b39dc..2318920a 100644
@@ -1,5 +1,6 @@
 /*
  * Copyright (C)  2011 - David Goulet <[email protected]>
+ * Copyright (C)  2019 - Yannick Lamarre <[email protected]>
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License, version 2 only,
@@ -204,10 +205,10 @@ int compat_poll_mod(struct lttng_poll_event *events, int fd,
 		uint32_t req_events)
 {
 	int i;
-	bool fd_found = false;
 	struct compat_poll_event_array *current;
 
-	if (events == NULL || events->current.events == NULL || fd < 0) {
+	if (events == NULL || events->current.nb_fd == 0 ||
+			events->current.events == NULL || fd < 0) {
 		ERR("Bad compat poll mod arguments");
 		goto error;
 	}
@@ -216,16 +217,16 @@ int compat_poll_mod(struct lttng_poll_event *events, int fd,
 
 	for (i = 0; i < current->nb_fd; i++) {
 		if (current->events[i].fd == fd) {
-			fd_found = true;
 			current->events[i].events = req_events;
 			events->need_update = 1;
 			break;
 		}
 	}
 
-	if (!fd_found) {
-		goto error;
-	}
+	/*
+	 * The epoll flavor doesn't flag modifying a non-included FD as an
+	 * error.
+	 */
 
 	return 0;
 
@@ -238,11 +239,12 @@ error:
  */
 int compat_poll_del(struct lttng_poll_event *events, int fd)
 {
-	int new_size, i, count = 0, ret;
+	int i, count = 0, ret;
+	uint32_t new_size;
 	struct compat_poll_event_array *current;
 
-	if (events == NULL || events->current.events == NULL || fd < 0) {
-		ERR("Wrong arguments for poll del");
+	if (events == NULL || events->current.nb_fd == 0 ||
+			events->current.events == NULL || fd < 0) {
 		goto error;
 	}
 
@@ -257,13 +259,20 @@ int compat_poll_del(struct lttng_poll_event *events, int fd)
 			count++;
 		}
 	}
+
+	/* The fd was not in our set, return no error as with epoll. */
+	if (current->nb_fd == count) {
+		goto end;
+	}
+
 	/* No fd duplicate should be ever added into array. */
 	assert(current->nb_fd - 1 == count);
 	current->nb_fd = count;
 
 	/* Resize array if needed. */
 	new_size = 1U << utils_get_count_order_u32(current->nb_fd);
-	if (new_size != current->alloc_size && new_size >= current->init_size) {
+	if (new_size != current->alloc_size && new_size >= current->init_size
+			&& current->nb_fd != 0) {
 		ret = resize_poll_event(current, new_size);
 		if (ret < 0) {
 			goto error;
@@ -272,6 +281,7 @@ int compat_poll_del(struct lttng_poll_event *events, int fd)
 
 	events->need_update = 1;
 
+end:
 	return 0;
 
 error:
Signature · 1 line
2.11.0
#5 lore raw

PATCH v6 5/8 Fix: hang in thread_rotation when using compat-poll

In reply to a message not in the archive

Add missing verification to prevent a blocking read on an empty fd.

---
 src/bin/lttng-sessiond/rotation-thread.c | 4 ++++
 1 file changed, 4 insertions(+)
src/bin/lttng-sessiond/rotation-thread.c +4 -0
index 6669372d..b86b1668 100644
@@ -974,6 +974,10 @@ void *thread_rotation(void *data)
 			int fd = LTTNG_POLL_GETFD(&thread.events, i);
 			uint32_t revents = LTTNG_POLL_GETEV(&thread.events, i);
 
+			if (!revents) {
+				/* No activity for this FD (poll implementation). */
+				continue;
+			}
 			DBG("[rotation-thread] Handling fd (%i) activity (%u)",
 					fd, revents);
 
Signature · 1 line
2.11.0
#6 lore raw

PATCH v6 6/8 Change lttng_poll_wait behaviour of compat-poll to match compat-epoll

In reply to a message not in the archive

This removes the need to verify for idle file descriptors and mitigates risks of bug due to behaviour mismatch.

---
 src/common/compat/compat-poll.c | 38 ++++++++++++++++++++++++++++++++++----
 1 file changed, 34 insertions(+), 4 deletions(-)
src/common/compat/compat-poll.c +34 -4
index 2318920a..0220b278 100644
@@ -293,7 +293,9 @@ error:
  */
 int compat_poll_wait(struct lttng_poll_event *events, int timeout)
 {
-	int ret;
+	int ret, active_fd_count;
+	int idle_pfd_index = 0;
+	size_t i;
 
 	if (events == NULL || events->current.events == NULL) {
 		ERR("poll wait arguments error");
@@ -325,11 +327,39 @@ int compat_poll_wait(struct lttng_poll_event *events, int timeout)
 		goto error;
 	}
 
+	active_fd_count = ret;
+
 	/*
-	 * poll() should always iterate on all FDs since we handle the pollset in
-	 * user space and after poll returns, we have to try every fd for a match.
+	 * Swap all active pollfd structs to the beginning of the
+	 * array to emulate compat-epoll behaviour. This algorithm takes
+	 * advantage of poll's returned value and the burst nature of active
+	 * events on the file descriptors. The while loop guarantees that
+	 * idle_pfd will always point to an idle fd.
 	 */
-	return events->wait.nb_fd;
+	if (active_fd_count == events->wait.nb_fd) {
+		goto end;
+	}
+	while (idle_pfd_index < active_fd_count &&
+			events->wait.events[idle_pfd_index].revents != 0) {
+		idle_pfd_index++;
+	}
+
+	for (i = idle_pfd_index + 1; idle_pfd_index < active_fd_count;
+			i++) {
+		struct pollfd swap_pfd;
+		struct pollfd *idle_pfd = &events->wait.events[idle_pfd_index];
+		struct pollfd *current_pfd = &events->wait.events[i];
+
+		if (ipfd->revents != 0) {
+			swap_pfd = *current_pfd;
+			*current_pfd = *idle_pfd;
+			*idle_pfd = swap_pfd;
+			idle_pfd_index++;
+		}
+	}
+
+end:
+	return ret;
 
 error:
 	return -1;
Signature · 1 line
2.11.0
#7 lore raw

PATCH v6 7/8 Clean code base from redundant verification

In reply to a message not in the archive

Remove redundant verification for file descriptors with 0 revents in code base.

---
 src/bin/lttng-consumerd/health-consumerd.c   |  5 -----
 src/bin/lttng-relayd/health-relayd.c         |  5 -----
 src/bin/lttng-relayd/live.c                  | 10 ----------
 src/bin/lttng-relayd/main.c                  | 16 ----------------
 src/bin/lttng-sessiond/agent-thread.c        |  5 -----
 src/bin/lttng-sessiond/client.c              |  5 -----
 src/bin/lttng-sessiond/dispatch.c            |  5 -----
 src/bin/lttng-sessiond/health.c              |  5 -----
 src/bin/lttng-sessiond/ht-cleanup.c          |  5 -----
 src/bin/lttng-sessiond/manage-apps.c         |  5 -----
 src/bin/lttng-sessiond/manage-consumer.c     | 10 ----------
 src/bin/lttng-sessiond/manage-kernel.c       |  5 -----
 src/bin/lttng-sessiond/notification-thread.c |  3 ---
 src/bin/lttng-sessiond/notify-apps.c         |  5 -----
 src/bin/lttng-sessiond/register.c            |  5 -----
 src/bin/lttng-sessiond/rotation-thread.c     |  4 ----
 src/common/consumer/consumer.c               | 10 ----------
 17 files changed, 108 deletions(-)
src/bin/lttng-consumerd/health-consumerd.c +0 -5
index 15b71a1a..dc8b32aa 100644
@@ -266,11 +266,6 @@ restart:
 			revents = LTTNG_POLL_GETEV(&events, i);
 			pollfd = LTTNG_POLL_GETFD(&events, i);
 
-			if (!revents) {
-				/* No activity for this FD (poll implementation). */
-				continue;
-			}
-
 			/* Thread quit pipe has been closed. Killing thread. */
 			ret = check_health_quit_pipe(pollfd, revents);
 			if (ret) {
src/bin/lttng-relayd/health-relayd.c +0 -5
index 9b4eefcd..4a2dc65a 100644
@@ -343,11 +343,6 @@ restart:
 			revents = LTTNG_POLL_GETEV(&events, i);
 			pollfd = LTTNG_POLL_GETFD(&events, i);
 
-			if (!revents) {
-				/* No activity for this FD (poll implementation). */
-				continue;
-			}
-
 			/* Thread quit pipe has been closed. Killing thread. */
 			ret = check_health_quit_pipe(pollfd, revents);
 			if (ret) {
src/bin/lttng-relayd/live.c +0 -10
index 9efab8a7..9503ba47 100644
@@ -543,11 +543,6 @@ restart:
 			revents = LTTNG_POLL_GETEV(&events, i);
 			pollfd = LTTNG_POLL_GETFD(&events, i);
 
-			if (!revents) {
-				/* No activity for this FD (poll implementation). */
-				continue;
-			}
-
 			/* Thread quit pipe has been closed. Killing thread. */
 			ret = check_thread_quit_pipe(pollfd, revents);
 			if (ret) {
@@ -2000,11 +1995,6 @@ restart:
 
 			health_code_update();
 
-			if (!revents) {
-				/* No activity for this FD (poll implementation). */
-				continue;
-			}
-
 			/* Thread quit pipe has been closed. Killing thread. */
 			ret = check_thread_quit_pipe(pollfd, revents);
 			if (ret) {
src/bin/lttng-relayd/main.c +0 -16
index e81bdeff..0ee27efc 100644
@@ -858,14 +858,6 @@ restart:
 			revents = LTTNG_POLL_GETEV(&events, i);
 			pollfd = LTTNG_POLL_GETFD(&events, i);
 
-			if (!revents) {
-				/*
-				 * No activity for this FD (poll
-				 * implementation).
-				 */
-				continue;
-			}
-
 			/* Thread quit pipe has been closed. Killing thread. */
 			ret = check_thread_quit_pipe(pollfd, revents);
 			if (ret) {
@@ -3813,14 +3805,6 @@ restart:
 
 			health_code_update();
 
-			if (!revents) {
-				/*
-				 * No activity for this FD (poll
-				 * implementation).
-				 */
-				continue;
-			}
-
 			/* Thread quit pipe has been closed. Killing thread. */
 			ret = check_thread_quit_pipe(pollfd, revents);
 			if (ret) {
src/bin/lttng-sessiond/agent-thread.c +0 -5
index f7be1ef7..575f6aee 100644
@@ -404,11 +404,6 @@ restart:
 			revents = LTTNG_POLL_GETEV(&events, i);
 			pollfd = LTTNG_POLL_GETFD(&events, i);
 
-			if (!revents) {
-				/* No activity for this FD (poll implementation). */
-				continue;
-			}
-
 			/* Thread quit pipe has been closed. Killing thread. */
 			if (pollfd == quit_pipe_read_fd) {
 				goto exit;
src/bin/lttng-sessiond/client.c +0 -5
index f3002f91..4565a18c 100644
@@ -2090,11 +2090,6 @@ static void *thread_manage_clients(void *data)
 
 			health_code_update();
 
-			if (!revents) {
-				/* No activity for this FD (poll implementation). */
-				continue;
-			}
-
 			if (pollfd == thread_quit_pipe_fd) {
 				err = 0;
 				goto exit;
src/bin/lttng-sessiond/dispatch.c +0 -5
index 04b3954c..a637f23d 100644
@@ -144,11 +144,6 @@ static void sanitize_wait_queue(struct ust_reg_wait_queue *wait_queue)
 		uint32_t revents = LTTNG_POLL_GETEV(&events, i);
 		int pollfd = LTTNG_POLL_GETFD(&events, i);
 
-		if (!revents) {
-			/* No activity for this FD (poll implementation). */
-			continue;
-		}
-
 		cds_list_for_each_entry_safe(wait_node, tmp_wait_node,
 				&wait_queue->head, head) {
 			if (pollfd == wait_node->app->sock &&
src/bin/lttng-sessiond/health.c +0 -5
index 9474a856..9ff6bd1a 100644
@@ -165,11 +165,6 @@ restart:
 			revents = LTTNG_POLL_GETEV(&events, i);
 			pollfd = LTTNG_POLL_GETFD(&events, i);
 
-			if (!revents) {
-				/* No activity for this FD (poll implementation). */
-				continue;
-			}
-
 			/* Event on the registration socket */
 			if (pollfd == sock) {
 				if (revents & LPOLLIN) {
src/bin/lttng-sessiond/ht-cleanup.c +0 -5
index 91c0544c..02244f0c 100644
@@ -155,11 +155,6 @@ static void *thread_ht_cleanup(void *data)
 			revents = LTTNG_POLL_GETEV(&events, i);
 			pollfd = LTTNG_POLL_GETFD(&events, i);
 
-			if (!revents) {
-				/* No activity for this FD (poll implementation). */
-				continue;
-			}
-
 			if (pollfd != ht_cleanup_pipe[0]) {
 				continue;
 			}
src/bin/lttng-sessiond/manage-apps.c +0 -5
index f9ec356d..356c147a 100644
@@ -123,11 +123,6 @@ static void *thread_application_management(void *data)
 
 			health_code_update();
 
-			if (!revents) {
-				/* No activity for this FD (poll implementation). */
-				continue;
-			}
-
 			if (pollfd == quit_pipe_read_fd) {
 				err = 0;
 				goto exit;
src/bin/lttng-sessiond/manage-consumer.c +0 -10
index b710c61f..fa802adc 100644
@@ -134,11 +134,6 @@ void *thread_consumer_management(void *data)
 
 		health_code_update();
 
-		if (!revents) {
-			/* No activity for this FD (poll implementation). */
-			continue;
-		}
-
 		/* Thread quit pipe has been closed. Killing thread. */
 		if (pollfd == quit_pipe_read_fd) {
 			err = 0;
@@ -298,11 +293,6 @@ void *thread_consumer_management(void *data)
 
 			health_code_update();
 
-			if (!revents) {
-				/* No activity for this FD (poll implementation). */
-				continue;
-			}
-
 			/*
 			 * Thread quit pipe has been triggered, flag that we should stop
 			 * but continue the current loop to handle potential data from
src/bin/lttng-sessiond/manage-kernel.c +0 -5
index 34887d7b..f656c9f5 100644
@@ -267,11 +267,6 @@ static void *thread_kernel_management(void *data)
 
 			health_code_update();
 
-			if (!revents) {
-				/* No activity for this FD (poll implementation). */
-				continue;
-			}
-
 			if (pollfd == quit_pipe_read_fd) {
 				err = 0;
 				goto exit;
src/bin/lttng-sessiond/notification-thread.c +0 -3
index 7998f7e2..8c2892bd 100644
@@ -570,9 +570,6 @@ void *thread_notification(void *data)
 			int fd = LTTNG_POLL_GETFD(&state.events, i);
 			uint32_t revents = LTTNG_POLL_GETEV(&state.events, i);
 
-			if (!revents) {
-				continue;
-			}
 			DBG("[notification-thread] Handling fd (%i) activity (%u)", fd, revents);
 
 			if (fd == state.notification_channel_socket) {
src/bin/lttng-sessiond/notify-apps.c +0 -5
index bc7405c7..17f3cd0c 100644
@@ -109,11 +109,6 @@ restart:
 			revents = LTTNG_POLL_GETEV(&events, i);
 			pollfd = LTTNG_POLL_GETFD(&events, i);
 
-			if (!revents) {
-				/* No activity for this FD (poll implementation). */
-				continue;
-			}
-
 			/* Thread quit pipe has been closed. Killing thread. */
 			if (pollfd == quit_pipe_read_fd) {
 				err = 0;
src/bin/lttng-sessiond/register.c +0 -5
index 6ce25ad0..e809834f 100644
@@ -239,11 +239,6 @@ static void *thread_application_registration(void *data)
 			revents = LTTNG_POLL_GETEV(&events, i);
 			pollfd = LTTNG_POLL_GETFD(&events, i);
 
-			if (!revents) {
-				/* No activity for this FD (poll implementation). */
-				continue;
-			}
-
 			/* Thread quit pipe has been closed. Killing thread. */
 			if (pollfd == quit_pipe_read_fd) {
 				err = 0;
src/bin/lttng-sessiond/rotation-thread.c +0 -4
index b86b1668..6669372d 100644
@@ -974,10 +974,6 @@ void *thread_rotation(void *data)
 			int fd = LTTNG_POLL_GETFD(&thread.events, i);
 			uint32_t revents = LTTNG_POLL_GETEV(&thread.events, i);
 
-			if (!revents) {
-				/* No activity for this FD (poll implementation). */
-				continue;
-			}
 			DBG("[rotation-thread] Handling fd (%i) activity (%u)",
 					fd, revents);
 
src/common/consumer/consumer.c +0 -10
index 10273e66..c70d95a5 100644
@@ -2396,11 +2396,6 @@ restart:
 			revents = LTTNG_POLL_GETEV(&events, i);
 			pollfd = LTTNG_POLL_GETFD(&events, i);
 
-			if (!revents) {
-				/* No activity for this FD (poll implementation). */
-				continue;
-			}
-
 			if (pollfd == lttng_pipe_get_readfd(ctx->consumer_metadata_pipe)) {
 				if (revents & LPOLLIN) {
 					ssize_t pipe_len;
@@ -2990,11 +2985,6 @@ restart:
 			revents = LTTNG_POLL_GETEV(&events, i);
 			pollfd = LTTNG_POLL_GETFD(&events, i);
 
-			if (!revents) {
-				/* No activity for this FD (poll implementation). */
-				continue;
-			}
-
 			if (pollfd == ctx->consumer_channel_pipe[0]) {
 				if (revents & LPOLLIN) {
 					enum consumer_channel_action action;
Signature · 1 line
2.11.0
#8 lore raw

PATCH v6 8/8 Clean-up: correct typo from epoll to poll

In reply to a message not in the archive
---
 src/common/compat/poll.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
src/common/compat/poll.h +1 -1
index 5eb7ff9c..d7020f36 100644
@@ -358,7 +358,7 @@ extern int compat_poll_del(struct lttng_poll_event *events, int fd);
 	compat_poll_del(events, fd)
 
 /*
- * Modify an fd's events in the epoll set.
+ * Modify an fd's events in the poll set.
  */
 extern int compat_poll_mod(struct lttng_poll_event *events,
 		int fd, uint32_t req_events);
Signature · 1 line
2.11.0
#9 lore raw

Re: [PATCH lttng-tools v6 0/8] Change in compat (e)poll

In reply to a message not in the archive

All merged in master and stable-2.11.

I made some minor changes to the messages of the unit tests.

"Fix: lttng_poll_mod calls compat_(e)poll_add" was backported to stable-2.10.

Thanks!
Jérémie

Quoted 40 lines · Yannick Lamarre

From v5, fixed compilation problem in unit test and changed the title of some commits.

Yannick Lamarre (8):
Fix: lttng_poll_mod calls compat_(e)poll_add
Add Unit test to poll compatibility layer
Change LTTNG_POLL_GETNB behaviour for poll flavor
Adapt poll layer behaviour to match the epoll layer
Fix: hang in thread_rotation when using compat-poll
Change lttng_poll_wait behaviour of compat-poll to match compat-epoll Clean code base from redundant verification
Clean-up: correct typo from epoll to poll

 .gitignore                                   |   1 +
 src/bin/lttng-consumerd/health-consumerd.c   |   5 -
 src/bin/lttng-relayd/health-relayd.c         |   5 -
 src/bin/lttng-relayd/live.c                  |  10 --
 src/bin/lttng-relayd/main.c                  |  16 --
 src/bin/lttng-sessiond/agent-thread.c        |   5 -
 src/bin/lttng-sessiond/client.c              |   5 -
 src/bin/lttng-sessiond/dispatch.c            |   5 -
 src/bin/lttng-sessiond/health.c              |   5 -
 src/bin/lttng-sessiond/ht-cleanup.c          |   5 -
 src/bin/lttng-sessiond/manage-apps.c         |   5 -
 src/bin/lttng-sessiond/manage-consumer.c     |  10 --
 src/bin/lttng-sessiond/manage-kernel.c       |   5 -
 src/bin/lttng-sessiond/notification-thread.c |   3 -
 src/bin/lttng-sessiond/notify-apps.c         |   5 -
 src/bin/lttng-sessiond/register.c            |   5 -
 src/common/compat/compat-poll.c              |  68 ++++++--
 src/common/compat/poll.h                     |  10 +-
 src/common/consumer/consumer.c               |  10 --
 tests/unit/Makefile.am                       |   9 +-
 tests/unit/test_utils_compat_poll.c          | 233 +++++++++++++++++++++++++++
 21 files changed, 302 insertions(+), 123 deletions(-)
 create mode 100644 tests/unit/test_utils_compat_poll.c
Signature · 1 line
2.11.0