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: measure pings per second
Author:  Hans Verkuil <hans.verk...@cisco.com>
Date:    Mon Aug 6 11:29:24 2018 +0200

As part of the adapter test check how many pings per second you can
do towards both a valid and invalid LA and warn if it is less than
the expected value.

Check this for 5 full consecutive seconds since the remote side might
be sending messages as well which can influence this value.

Also fix a bug in DQEVENT test in testAdapLogAddrs(): you can get pin
events with the CEC_EVENT_FL_INITIAL_STATE flag set, thus causing a fail.

Signed-off-by: Hans Verkuil <hans.verk...@cisco.com>

 utils/cec-compliance/cec-test-adapter.cpp | 51 +++++++++++++++++++++++++++++++
 1 file changed, 51 insertions(+)

---

http://git.linuxtv.org/cgit.cgi/v4l-utils.git/commit/?id=90905c2e4b17d7595256f3824e2d30d19b0df1a1
diff --git a/utils/cec-compliance/cec-test-adapter.cpp 
b/utils/cec-compliance/cec-test-adapter.cpp
index 09ed54266d85..80263b6872ad 100644
--- a/utils/cec-compliance/cec-test-adapter.cpp
+++ b/utils/cec-compliance/cec-test-adapter.cpp
@@ -222,6 +222,7 @@ int testTransmit(struct node *node)
 {
        struct cec_msg msg = { };
        unsigned i, la = node->log_addr[0];
+       unsigned valid_la = 15, invalid_la = 15;
        bool tested_self = false;
        bool tested_valid_la = false;
        bool tested_invalid_la = false;
@@ -292,6 +293,7 @@ int testTransmit(struct node *node)
                        if (tested_valid_la)
                                continue;
                        tested_valid_la = true;
+                       valid_la = i;
                        // Send message to a remote LA
                        memset(&msg, 0xff, sizeof(msg));
                        msg.msg[0] = (la << 4) | i;
@@ -338,6 +340,7 @@ int testTransmit(struct node *node)
                        if (tested_invalid_la)
                                continue;
                        tested_invalid_la = true;
+                       invalid_la = i;
                        // Send message to a remote non-existent LA
                        memset(&msg, 0xff, sizeof(msg));
                        msg.msg[0] = (la << 4) | i;
@@ -382,6 +385,54 @@ int testTransmit(struct node *node)
                }
        }
 
+       if (tested_valid_la) {
+               time_t cur_t = time(NULL), t;
+               time_t last_t = cur_t + 7;
+               unsigned max_cnt = 0;
+               unsigned cnt = 0;
+       
+               do {
+                       t = time(NULL);
+                       if (t != cur_t) {
+                               if (cnt > max_cnt)
+                                       max_cnt = cnt;
+                               cnt = 0;
+                               cur_t = t;
+                       }
+                       cec_msg_init(&msg, la, valid_la);
+                       fail_on_test(doioctl(node, CEC_TRANSMIT, &msg));
+                       cnt++;
+               } while (t < last_t);
+               // A ping can take 10 * 2.4 + 4.5 + 7 * 2.4 = 45.3 ms (SFT)
+               if (max_cnt < 21)
+                       warn("Could only do %u pings per second to a valid LA, 
expected at least 21\n",
+                            max_cnt);
+       }
+
+       if (tested_invalid_la) {
+               time_t cur_t = time(NULL), t;
+               time_t last_t = cur_t + 7;
+               unsigned max_cnt = 0;
+               unsigned cnt = 0;
+       
+               do {
+                       t = time(NULL);
+                       if (t != cur_t) {
+                               if (cnt > max_cnt)
+                                       max_cnt = cnt;
+                               cnt = 0;
+                               cur_t = t;
+                       }
+                       cec_msg_init(&msg, la, invalid_la);
+                       fail_on_test(doioctl(node, CEC_TRANSMIT, &msg));
+                       cnt++;
+               } while (t < last_t);
+               // A ping to an invalid LA can take 2 * (10 * 2.4 + 4.5) + (3 + 
7) * 2.4 = 81 ms (SFT)
+               if (max_cnt < 12)
+                       warn("Could only do %u pings per second to an invalid 
LA, expected at least 12\n",
+                            max_cnt);
+       }
+
        return 0;
 }
 

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

Reply via email to