This is an automatic generated email to let you know that the following patch 
were queued at the 
http://git.linuxtv.org/cgit.cgi/v4l-utils.git tree:

Subject: cec-compliance: further improvements to CEC_EVENT_LOST_MSGS fail info
Author:  Hans Verkuil <hverk...@xs4all.nl>
Date:    Wed Oct 10 18:46:48 2018 +0200

Show the number of messages that can be immediately dequeued from
the receive queue, and how many messages trickle in afterwards and
over how many seconds.

Signed-off-by: Hans Verkuil <hverk...@xs4all.nl>

 utils/cec-compliance/cec-test-adapter.cpp | 50 ++++++++++++++++++-------------
 1 file changed, 30 insertions(+), 20 deletions(-)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=9d7d01f24b5e8ac73fbed783cffd5c0f5f6e8a87
diff --git a/utils/cec-compliance/cec-test-adapter.cpp 
b/utils/cec-compliance/cec-test-adapter.cpp
index 6a8ce90947e0..2cf0447cb234 100644
--- a/utils/cec-compliance/cec-test-adapter.cpp
+++ b/utils/cec-compliance/cec-test-adapter.cpp
@@ -1026,6 +1026,7 @@ int testLostMsgs(struct node *node)
        fail_on_test(tx_queue_depth == 0 || tx_queue_depth > 19);
 
        unsigned pending_msgs = 0;
+       unsigned pending_quick_msgs = 0;
        unsigned pending_tx_ok_msgs = 0;
        unsigned pending_tx_timed_out_msgs = 0;
        unsigned pending_tx_arb_lost_msgs = 0;
@@ -1033,26 +1034,31 @@ int testLostMsgs(struct node *node)
        unsigned pending_tx_low_drive_msgs = 0;
        unsigned pending_tx_error_msgs = 0;
        unsigned pending_rx_msgs = 0;
-
-       fcntl(node->fd, F_SETFL, fcntl(node->fd, F_GETFL) & ~O_NONBLOCK);
-       msg.timeout = 3000;
-
-       while (!doioctl(node, CEC_RECEIVE, &msg)) {
-               pending_msgs++;
-               if (!msg.sequence)
-                       pending_rx_msgs++;
-               else if (msg.tx_status & CEC_TX_STATUS_TIMEOUT)
-                       pending_tx_timed_out_msgs++;
-               else if (msg.tx_status & CEC_TX_STATUS_OK)
-                       pending_tx_ok_msgs++;
-               else if (msg.tx_status & CEC_TX_STATUS_NACK)
-                       pending_tx_nack_msgs++;
-               else if (msg.tx_status & CEC_TX_STATUS_ARB_LOST)
-                       pending_tx_arb_lost_msgs++;
-               else if (msg.tx_status & CEC_TX_STATUS_LOW_DRIVE)
-                       pending_tx_low_drive_msgs++;
-               else
-                       pending_tx_error_msgs++;
+       time_t start = time(NULL);
+
+       for (unsigned i = 0; i < 2; i++) {
+               msg.timeout = 3000;
+
+               while (!doioctl(node, CEC_RECEIVE, &msg)) {
+                       pending_msgs++;
+                       if (i == 0)
+                               pending_quick_msgs++;
+                       if (!msg.sequence)
+                               pending_rx_msgs++;
+                       else if (msg.tx_status & CEC_TX_STATUS_TIMEOUT)
+                               pending_tx_timed_out_msgs++;
+                       else if (msg.tx_status & CEC_TX_STATUS_OK)
+                               pending_tx_ok_msgs++;
+                       else if (msg.tx_status & CEC_TX_STATUS_NACK)
+                               pending_tx_nack_msgs++;
+                       else if (msg.tx_status & CEC_TX_STATUS_ARB_LOST)
+                               pending_tx_arb_lost_msgs++;
+                       else if (msg.tx_status & CEC_TX_STATUS_LOW_DRIVE)
+                               pending_tx_low_drive_msgs++;
+                       else
+                               pending_tx_error_msgs++;
+               }
+               fcntl(node->fd, F_SETFL, fcntl(node->fd, F_GETFL) & 
~O_NONBLOCK);
        }
 
        /*
@@ -1076,6 +1082,10 @@ int testLostMsgs(struct node *node)
                        printf("\t\tError transmits: %d\n", 
pending_tx_error_msgs);
                if (pending_rx_msgs)
                        printf("\t\tReceived messages: %d\n", pending_rx_msgs);
+               if (pending_quick_msgs < pending_msgs)
+                       printf("\t\tReceived %d messages immediately, and %d 
over %ld seconds\n",
+                              pending_quick_msgs, pending_msgs - 
pending_quick_msgs,
+                              time(NULL) - start);
                return fail("There were %d messages in the receive queue for %d 
transmits\n",
                            pending_msgs, xfer_cnt);
        }

_______________________________________________
linuxtv-commits mailing list
linuxtv-commits@linuxtv.org
https://www.linuxtv.org/cgi-bin/mailman/listinfo/linuxtv-commits

Reply via email to