From 89cb86aeb0262e17ee39c1d791effe9515bd0dc8 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 4 Oct 2022 18:44:36 +0200 Subject: build, vtysh: extract vtysh commands from .xref Rather than running selected source files through the preprocessor and a bunch of perl regex'ing to get the list of all DEFUNs, use the data collected in frr.xref. This not only eliminates issues we've been having with preprocessor failures due to nonexistent header files, but is also much faster. Where extract.pl would take 5s, this now finishes in 0.2s. And since this is a non-parallelizable build step towards the end of the build (dependent on a lot of other things being done already), the speedup is actually noticeable. Also files containing CLI no longer need to be listed in `vtysh_scan` since the .xref data covers everything. `#ifndef VTYSH_EXTRACT_PL` checks are equally obsolete. Signed-off-by: David Lamparter --- pbrd/pbr_debug.c | 2 -- pbrd/pbr_vty.c | 2 -- pbrd/subdir.am | 4 ---- 3 files changed, 8 deletions(-) (limited to 'pbrd') diff --git a/pbrd/pbr_debug.c b/pbrd/pbr_debug.c index 82f045c46..99489777e 100644 --- a/pbrd/pbr_debug.c +++ b/pbrd/pbr_debug.c @@ -23,9 +23,7 @@ #include "command.h" #include "vector.h" -#ifndef VTYSH_EXTRACT_PL #include "pbrd/pbr_debug_clippy.c" -#endif #include "pbrd/pbr_debug.h" struct debug pbr_dbg_map = {0, "PBR map"}; diff --git a/pbrd/pbr_vty.c b/pbrd/pbr_vty.c index 6f53adb33..e8e5981ec 100644 --- a/pbrd/pbr_vty.c +++ b/pbrd/pbr_vty.c @@ -36,9 +36,7 @@ #include "pbrd/pbr_zebra.h" #include "pbrd/pbr_vty.h" #include "pbrd/pbr_debug.h" -#ifndef VTYSH_EXTRACT_PL #include "pbrd/pbr_vty_clippy.c" -#endif DEFUN_NOSH(pbr_map, pbr_map_cmd, "pbr-map PBRMAP seq (1-700)", "Create pbr-map or enter pbr-map command mode\n" diff --git a/pbrd/subdir.am b/pbrd/subdir.am index bbe3f2ab7..8a3bf31bf 100644 --- a/pbrd/subdir.am +++ b/pbrd/subdir.am @@ -5,10 +5,6 @@ if PBRD noinst_LIBRARIES += pbrd/libpbr.a sbin_PROGRAMS += pbrd/pbrd -vtysh_scan += \ - pbrd/pbr_vty.c \ - pbrd/pbr_debug.c \ - # end vtysh_daemons += pbrd man8 += $(MANBUILD)/frr-pbrd.8 endif -- cgit v1.2.3