]> rtime.felk.cvut.cz Git - can-benchmark.git/commitdiff
Gather some statistics
authorMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 3 Dec 2010 17:15:18 +0000 (18:15 +0100)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Fri, 3 Dec 2010 17:15:18 +0000 (18:15 +0100)
latester/latester.c

index f57de3a765604f23f2932cdb64698b8b274e5fd9..d178e1eb907f990b43b331ce86d06ab2fd88b0e2 100644 (file)
@@ -72,6 +72,10 @@ struct options opt = {
        .length = 2,
 };
 
+struct {
+       unsigned enobufs;
+} stats;
+
 int num_interfaces = 0;
 int count = 0;                 /* Number of sent messages */
 int completion_pipe[2];
@@ -539,6 +543,7 @@ void *measure_thread(void *arg)
                ret = send_frame(pfd[0].fd);                            \
                if (ret != sizeof(struct can_frame)) {                  \
                        if (ret == -1 && errno == ENOBUFS && opt.period_us == 0 && !opt.oneattime) { \
+                               stats.enobufs++;                        \
                                /* Ignore this error - pfifo_fast qeuue is full */ \
                        } else                                          \
                                error(1, errno, "send_frame (line %d)", __LINE__); \