]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: When using dev build add pointer information to %pBD
authorDonald Sharp <sharpd@nvidia.com>
Mon, 11 Mar 2024 14:40:22 +0000 (10:40 -0400)
committerton31337 <3352707+ton31337@users.noreply.github.com>
Thu, 14 Mar 2024 09:45:09 +0000 (09:45 +0000)
When building FRR with `--enable-dev-build`.  Add a bit of
code to include the pointer value as part of the output.
Helps with tracking down issues and let's us see more data
when using the dev build option.

New output:

2024/03/08 19:48:56 BGP: [V0J1J-W5RHA] 11.0.20.1/32(0x5759ddf8d7c0) for 11.0.20.1/32

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
bgpd/bgp_table.c
doc/developer/logging.rst

index 8465ada996710da24f587d1a28ecf1d4a2159777..781909b65dd7b046c5e4f06302c0778574424487 100644 (file)
@@ -239,7 +239,11 @@ static ssize_t printfrr_bd(struct fbuf *buf, struct printfrr_eargs *ea,
        if (!dest)
                return bputs(buf, "(null)");
 
+#if !defined(DEV_BUILD)
        /* need to get the real length even if buffer too small */
        prefix2str(p, cbuf, sizeof(cbuf));
        return bputs(buf, cbuf);
+#else
+       return bprintfrr(buf, "%s(%p)", prefix2str(p, cbuf, sizeof(cbuf)), dest);
+#endif
 }
index 6058b8c0fca4f546edd1a2ccc646eb8c461c5ae6..82cc8b205eabb14dc6ce94fdfd8791f815f2d7be 100644 (file)
@@ -383,7 +383,8 @@ bgpd
 
 .. frrfmt:: %pBD (struct bgp_dest *)
 
-   Print prefix for a BGP destination.
+   Print prefix for a BGP destination.  When using ``--enable-dev-build`` include
+   the pointer value for the bgp_dest.
 
    :frrfmtout:`fe80::1234/64`