---
netlink.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/netlink.c b/netlink.c
index 650a6fd..65cc5d7 100644
--- a/netlink.c
+++ b/netlink.c
@@ -18,6 +18,7 @@
#include
#include
#include
+#include
#include
#include
#include
@@ -604,6 +605,7 @@ int nl_route_dup(int s_src, unsigned int ifi_src,
char buf[NLBUFSIZ * 8];
uint32_t seq;
unsigned i;
+ struct timespec start, now;
seq = nl_send(s_src, &req, RTM_GETROUTE, NLM_F_DUMP, sizeof(req));
@@ -706,6 +708,7 @@ int nl_route_dup(int s_src, unsigned int ifi_src,
* can safely ignore that and repeat the requests. This avoids the need
* to calculate dependencies: let the kernel do that.
*/
+ clock_gettime(CLOCK_MONOTONIC, &start);
for (i = 0; i < dup_routes; i++) {
for (nh = (struct nlmsghdr *)buf, left = nlmsgs_size;
NLMSG_OK(nh, left);
@@ -724,6 +727,9 @@ int nl_route_dup(int s_src, unsigned int ifi_src,
return rc;
}
}
+ clock_gettime(CLOCK_MONOTONIC, &now);
+ debug("route dependency handling time: %f s",
+ (now.tv_sec - start.tv_sec) + (now.tv_nsec - start.tv_nsec)/1.0e9);
return 0;
}
--
2.53.0