All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yannick Lamarre <ylamarre@efficios.com>
To: lttng-dev@lists.lttng.org
Cc: jgalar@efficios.com
Subject: [PATCH lttng-tools v3 3/8] Change LTTNG_POLL_GETNB behaviour for poll flavor
Date: Fri, 22 Mar 2019 14:19:23 -0400	[thread overview]
Message-ID: <20190322181928.6186-3-ylamarre__38786.9956948393$1553278929$gmane$org@efficios.com> (raw)
In-Reply-To: <20190322181928.6186-1-ylamarre@efficios.com>

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.

Signed-off-by: Yannick Lamarre <ylamarre@efficios.com>
---
 src/common/compat/poll.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/common/compat/poll.h b/src/common/compat/poll.h
index fde54ddb..5eb7ff9c 100644
--- a/src/common/compat/poll.h
+++ b/src/common/compat/poll.h
@@ -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)
-- 
2.11.0

  parent reply	other threads:[~2019-03-22 18:19 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20190322181928.6186-1-ylamarre@efficios.com>
2019-03-22 18:19 ` [PATCH lttng-tools v3 2/8] Add Unit test to poll compatibility layer Yannick Lamarre
2019-03-22 18:19 ` Yannick Lamarre [this message]
2019-03-22 18:19 ` [PATCH lttng-tools v3 4/8] Adapt poll layer behaviour to match the epoll layer Yannick Lamarre
2019-03-22 18:19 ` [PATCH lttng-tools v3 5/8] Fix hang in thread_rotation when using compat-poll Yannick Lamarre
2019-03-22 18:19 ` [PATCH lttng-tools v3 6/8] Change lttng_poll_wait behaviour of compat-poll to match compat-epoll Yannick Lamarre
2019-03-22 18:19 ` [PATCH lttng-tools v3 7/8] Clean code base from redundant verification Yannick Lamarre
2019-03-22 18:19 ` [PATCH lttng-tools v3 8/8] Fix typo Yannick Lamarre
2019-03-22 18:50 ` [PATCH lttng-tools v3 1/8] Fix: lttng_poll_mod calls compat_(e)poll_add Jonathan Rajotte-Julien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='20190322181928.6186-3-ylamarre__38786.9956948393$1553278929$gmane$org@efficios.com' \
    --to=ylamarre@efficios.com \
    --cc=jgalar@efficios.com \
    --cc=lttng-dev@lists.lttng.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.