Fixes: #747

Signed-off-by: Philippe Proulx <[email protected]>
---
 src/bin/lttng-sessiond/ht-cleanup.c |  5 +++++
 src/bin/lttng-sessiond/main.c       | 10 ++++++++++
 src/bin/lttng-sessiond/ust-thread.c |  5 +++++
 3 files changed, 20 insertions(+)

diff --git a/src/bin/lttng-sessiond/ht-cleanup.c 
b/src/bin/lttng-sessiond/ht-cleanup.c
index 0469f92..8f841ed 100644
--- a/src/bin/lttng-sessiond/ht-cleanup.c
+++ b/src/bin/lttng-sessiond/ht-cleanup.c
@@ -90,6 +90,11 @@ restart:
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
+                       /* Do not waste time if no returned events for this fd 
*/
+                       if (!revents) {
+                               continue;
+                       }
+
                        /* Thread quit pipe has been closed. Killing thread. */
                        ret = sessiond_check_thread_quit_pipe(pollfd, revents);
                        if (ret) {
diff --git a/src/bin/lttng-sessiond/main.c b/src/bin/lttng-sessiond/main.c
index 81b5e94..e97f560 100644
--- a/src/bin/lttng-sessiond/main.c
+++ b/src/bin/lttng-sessiond/main.c
@@ -1034,6 +1034,11 @@ static void *thread_manage_kernel(void *data)
 
                        health_code_update();
 
+                       /* Do not waste time if no returned events for this fd 
*/
+                       if (!revents) {
+                               continue;
+                       }
+
                        /* Thread quit pipe has been closed. Killing thread. */
                        ret = sessiond_check_thread_quit_pipe(pollfd, revents);
                        if (ret) {
@@ -1482,6 +1487,11 @@ static void *thread_manage_apps(void *data)
 
                        health_code_update();
 
+                       /* Do not waste time if no returned events for this fd 
*/
+                       if (!revents) {
+                               continue;
+                       }
+
                        /* Thread quit pipe has been closed. Killing thread. */
                        ret = sessiond_check_thread_quit_pipe(pollfd, revents);
                        if (ret) {
diff --git a/src/bin/lttng-sessiond/ust-thread.c 
b/src/bin/lttng-sessiond/ust-thread.c
index d92c1f9..2a87444 100644
--- a/src/bin/lttng-sessiond/ust-thread.c
+++ b/src/bin/lttng-sessiond/ust-thread.c
@@ -92,6 +92,11 @@ restart:
                        revents = LTTNG_POLL_GETEV(&events, i);
                        pollfd = LTTNG_POLL_GETFD(&events, i);
 
+                       /* Do not waste time if no returned events for this fd 
*/
+                       if (!revents) {
+                               continue;
+                       }
+
                        /* Thread quit pipe has been closed. Killing thread. */
                        ret = sessiond_check_thread_quit_pipe(pollfd, revents);
                        if (ret) {
-- 
2.1.3


_______________________________________________
lttng-dev mailing list
[email protected]
http://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

Reply via email to