From: Stefano Brivio <sbrivio@redhat.com>
To: Martin Schitter <ms+git@mur.at>
Cc: passt-dev@passt.top
Subject: Re: [PATCH v2 2/3] Timekeeping: Resolving Route Dependencies
Date: Thu, 17 Sep 2026 21:08:19 +0200 (CEST) [thread overview]
Message-ID: <20260917210818.4900083a@elisabeth> (raw)
In-Reply-To: <20260908181631.537802-3-ms+git@mur.at>
On Tue, 8 Sep 2026 18:13:13 +0000
Martin Schitter <ms+git@mur.at> wrote:
> ---
> 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 <errno.h>
> #include <sys/types.h>
> #include <limits.h>
> +#include <time.h>
> #include <unistd.h>
> #include <signal.h>
> #include <stdlib.h>
> @@ -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);
This adds overhead (even if minimal) in a general case, but it's only
used for debug() messages.
> 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);
And anyway, I'm not sure I see the value of this. Which other functions
should we profile? Does it help at all to do this once you're done
developing it?
I would suggest to simply drop this patch. I understand you needed that
for development but you already explain in the commit message for 3/3
how it improves thing, and that's all the documentation we possibly
need for the future, I think.
>
> return 0;
> }
--
Stefano
next prev parent reply other threads:[~2026-09-17 19:08 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 18:13 [PATCH v2] Fix for Bug #221 -- Issue concerning bigger routing tables Martin Schitter
2026-09-08 18:13 ` [PATCH v2 1/3] Fix handling of netlink multipart route dumps Martin Schitter
2026-09-17 19:08 ` Stefano Brivio
2026-09-08 18:13 ` [PATCH v2 2/3] Timekeeping: Resolving Route Dependencies Martin Schitter
2026-09-17 19:08 ` Stefano Brivio [this message]
2026-09-08 18:13 ` [PATCH v2 3/3] Optimize route dependency solver Martin Schitter
2026-09-17 19:08 ` Stefano Brivio
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260917210818.4900083a@elisabeth \
--to=sbrivio@redhat.com \
--cc=ms+git@mur.at \
--cc=passt-dev@passt.top \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://passt.top/passt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).