Commit Graph

649 Commits

Author SHA1 Message Date
Donald Sharp
215a213d3f
Merge pull request #7366 from eololab/add-disable-rpath-option-in-configure
build: add --disable-rpath option in configure
2020-10-27 20:20:24 -04:00
Quentin Young
552e2a306a lib: add trace.h, frrtrace(), support for USDT
Previous commits added LTTng tracepoints. This was primarily for testing
/ trial purposes; in practice we'd like to support arbitrary tracing
methods, and especially USDT probes, which SystemTap and dtrace expect,
and which are supported on at least one flavor of BSD (FreeBSD).

To that end this patch adds an frr-specific tracing macro, frrtrace(),
which proxies into either DTRACE_PROBEn() or tracepoint() macros
depending on whether --enable-usdt or --enable-lttng is passed at
compile time.

At some point this could be tweaked to allow compiling in both types of
probes. Ideally there should be some logic there to use LTTng's optional
support for generating USDT probes when both are requested.

No additional libraries are required to use USDT, since these probes are
a kernel feature and only need the <sys/sdt.h> header.

- add --enable-usdt to toggle use of LTTng tracepoints or USDT probes
- add new trace.h library header for use with tracepoint definition
  headers
- add frrtrace() wrapper macro; this should be used to define
  tracepoints instead of using tracepoint() or DTRACE_PROBEn()

Compilation with USDT does nothing as of this commit; the existing LTTng
tracepoints need to be converted to use the frrtrace*() macros in a
subsequent commit.

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-10-23 15:13:51 -04:00
Quentin Young
0cbcadccf7 lib, configure.ac: initial LTTng support
This commit adds initial support for LTTng.

When --enable-lttng=no or is not specified, no tracing code is included.
When --enable-lttng=yes, LTTng tracing events are (will be) generated.

configure.ac:
- add --enable-lttng
- define HAVE_LTTNG when enabled
- minimum LTTng version: 2.12.0

lib:
- add trace.[ch]
- update subdir.am

Signed-off-by: Quentin Young <qlyoung@nvidia.com>
2020-10-23 15:13:51 -04:00
Emanuele Bovisio
7134d0e9b2 build: add --disable-rpath option in configure
Add an option to remove RPATH entry from binary files.
Useful for cross-compilation, otherwise libtool hardcodes
the building path.

Signed-off-by: Emanuele Bovisio <emanuele.bovisio@eolo.it>
2020-10-23 10:00:08 +02:00
Zoran Pericic
354196c027 nhrp: Make vici socket path configurable
nhrp: Configure vici socket path using

configure --with-vici-socket=/var/run/charon.vici

If not specified default to /var/run/charon.vici

Signed-off-by: Zoran Peričić <zpericic@netst.org>
2020-10-12 19:34:53 +02:00
Igor Ryzhov
0eb5751da9 vtysh: respect --disable-daemon configure flags
Don't install nodes for daemons that are disabled by configure flags.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-09-29 14:03:57 +03:00
Igor Ryzhov
80525224c3 build: remove redundant commas
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2020-09-27 19:22:02 +03:00
Donald Sharp
32d9e333b7 doc: Update Documentation to note Solaris Unsupported status
With the change of Solaris going from Supported -> UnSupported
the documentation needed to be updated to reflect the reality
on the ground.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-09-21 10:02:20 -04:00
Donald Sharp
cae8bc967c *: Remove solaris from FRR
The Solaris code has gone through a deprecation cycle.  No-one
has said anything to us and worse of all we don't have any test
systems running Solaris to know if we are making changes that
are breaking on Solaris.  Remove it from the system so
we can clean up a bit.

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-09-21 10:02:20 -04:00
Donald Sharp
c8a3405af8 *: Update version string
Update the version string to reflect work towards next release

Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2020-09-09 10:10:54 -04:00
Donald Sharp
9dc0503345
Merge pull request #6376 from opensourcerouting/bump-libyang-req-version-1.x
build, yang: bump libyang minimum required version to 1.0.184
2020-09-08 12:06:10 -04:00
Jakub Urbańczyk
4efd721d1e zebra: remove fuzzing stuff
The fuzzing code that is in the master branch is outdated and unused, so it
is worth to remove it to improve readablity of the code.

All the code related to the fuzzing is in the `fuzz` branch.

Signed-off-by: Jakub Urbańczyk <xthaid@gmail.com>
2020-08-25 17:31:07 +02:00
Renato Westphal
240b7826f6 build, yang: bump libyang minimum required version to 1.0.184
It's time to say good bye to libyang 0.16.105. The recently
released libyang 1.0.184 includes numerous bug fixes and performance
improvements that we need.

Despite the major version bump from 0.x to 1.x, the libyang API is
the same except for a single backward-incompatible change in the
user types interface (which we're currently not using). Hence no
code changes were necessary to adapt FRR to libyang 1.x.

This commit also reintroduces some leafrefs that needed to be
removed from our YANG modules due to a bug that was present on
libyang 0.16.105.

Signed-off-by: Renato Westphal <renato@opensourcerouting.org>
2020-08-07 14:07:46 -03:00
Jafar Al-Gharaibeh
e063f27136 build: Allow removal of build configs from version string
A new config option `--disable-version-build-config`
allows you to show short version string by dropping
"configured with:" and all of its build configs

Signed-off-by: Jafar Al-Gharaibeh <jafar@atcorp.com>
2020-06-19 11:15:43 -05:00
David Lamparter
5c90637711 build: use configfile mode in init script
This only applies for split-config;  the init script would create an
empty config file with default permissions.

Reported-by: Robert Scheck <robert@fedoraproject.org>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-05-11 21:50:27 +02:00
Donald Sharp
f3a9e1ab65 *: Update version string
Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-05-11 08:04:15 -04:00
David Lamparter
209135f188 build: silence idiotic libtool warnings
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27 10:02:11 +02:00
David Lamparter
94cfb0692e build: make clippy Makefile rules nicer
These are easy to get subtly wrong, and doing so can cause
nondeterministic failures when racing in parallel builds.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2020-04-27 09:52:41 +02:00
Santosh P K
09133ff4f7
Merge pull request #5451 from opensourcerouting/rcu-log
logging subsystem rewrite
2020-04-16 20:23:44 +05:30
David Lamparter
4c015942b1 build: fix git detection for worktrees
When using additional git worktrees, .git is not a directory.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-08 16:30:12 +02:00
David Lamparter
0bdeb5e58d lib: rewrite zlog lock-free & TLS-buffered
This is a full rewrite of the "back end" logging code.  It now uses a
lock-free list to iterate over logging targets, and the targets
themselves are as lock-free as possible.  (syslog() may have a hidden
internal mutex in the C library;  the file/fd targets use a single
write() call which should ensure atomicity kernel-side.)

Note that some functionality is lost in this patch:
- Solaris printstack() backtraces are ditched (unlikely to come back)
- the `log-filter` machinery is gone (re-added in followup commit)
- `terminal monitor` is temporarily stubbed out.  The old code had a
  race condition with VTYs going away.  It'll likely come back rewritten
  and with vtysh support.
- The `zebra_ext_log` hook is gone.  Instead, it's now much easier to
  add a "proper" logging target.

v2: TLS buffer to get some actual performance

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-04-01 06:53:26 +02:00
Ruben Kerkhof
5fa861b052 build: enable -Wundef warnings
Now that we've fixed all of them, enable them by default if the compiler
supports it.

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-30 11:22:58 +02:00
David Lamparter
ac92fc9e9f build: gcc -fplugin=frr-format support
Try to find the plugin and add it to CFLAGS if successful.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-29 10:45:46 +02:00
David Lamparter
aef4a13f4f sharpd: add "logpump" to bulk test logging
This just generates log messages in bulk for testing logging backend
performance.  It's in sharpd so the full "context" of being in a daemon
is available (e.g. different logging configs, parallel load in the main
thread.)

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-03-24 15:58:36 +01:00
Ruben Kerkhof
87559aa474 build: disable pimd on MacOS
Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-20 15:20:29 +01:00
Ruben Kerkhof
0476fdad7a build: really disable pimd on OpenBSD
For some reason the check did not work

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-18 17:51:18 +01:00
Mark Stapp
3fa94379a7 build: disable VRRPD if not linux
Only allow configure to try to build VRRPD on linux; other
platforms disable it.

Signed-off-by: Mark Stapp <mjs@voltanet.io>
2020-03-18 08:26:31 -04:00
Ruben Kerkhof
f616c954f8 build: no need for braces in variables
If the variable is the only word between quotes, there's no need to use
braces.

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-11 12:30:47 +01:00
Ruben Kerkhof
31d7b6daee build: no need to compare with "x"
As long as the arguments of the test are quoted,
modern shells handle it just fine.

A bunch of the tests already did this, convert the rest.

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-11 12:09:13 +01:00
Ruben Kerkhof
7075f6a058 build: quote the right hand side of tests too
For consistency

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-11 11:53:15 +01:00
Ruben Kerkhof
9377fc4f5d build: always quote variables in tests
If they are not defined, ./configure will throw hard to debug errors
like:
./configure: line 1678: test: =: unary operator expected

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-11 11:27:04 +01:00
Ruben Kerkhof
7cda3a87d1 build: fix building with -Werror=undef
In the unlikely event you are building with -Werror=undef, several
configure checks fail. Fix those.

Signed-off-by: Ruben Kerkhof <ruben@rubenkerkhof.com>
2020-03-10 16:27:50 +01:00
Donald Sharp
e2b26a4d4e configure: Fixup --disable-irdp option to reflect reality
The help text was not properly setup for `--disable-irdp` fix
it.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-02-16 14:39:49 -05:00
David Lamparter
d60693fdf8 build: accept libunwind without pkg-config
NetBSD installs LLVM's libunwind without a pkg-config file, but it
works perfectly fine.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-01-17 15:50:50 +01:00
David Lamparter
9c1be10509 build: fix shell == mis-use
The "test" program uses =, not ==.  A lot of shells accept == as an
extension, but not all do and it's technically out of spec.

Signed-off-by: David Lamparter <equinox@diac24.net>
2020-01-17 13:53:59 +01:00
Quentin Young
b4fd9ea7f0 configure.ac: add --enable-clang-coverage
Like gcov but better!
Also has a driveby fix for --enable-dev-build being mutually exclusive
with --enable-gcov...

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-16 16:26:22 -05:00
Donald Sharp
26c4ab2f43 *: Modify version number of build
With the pull of the 7.3 stabilization branch, update the
version number we will auto generate.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2020-01-14 08:21:57 -05:00
Quentin Young
982187afb5 configure.ac: make msan & ubsan flags additive
These were setting = SAN_FLAGS, we want to add to the variable. Note
MSAN can't be used with any other sanitizer (except UBSan) but the
compiler will complain about that if you use it wrong so we don't need
to enforce it here.

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-03 15:03:37 -05:00
Quentin Young
0beeb6760b configure.ac: add --enable-undefined-sanitizer
For UBSan

Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com>
2020-01-01 21:09:35 -05:00
Donald Sharp
fd193241e9 zebra: Do not build mlag protobuf support if version 3 is not avail
Older versions of protobuf-c do not support version 3 of the
protocol.  Add a check into the system to see if we have
version 3 available and if so, compile it in.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-12-15 09:37:51 -05:00
David Lamparter
d621815a0e zebra: create zebra_cumulus_mlag module
This is pretty much just to get rid of the HAVE_CUMULUS.  The
hook/module API is as "wtf" as it was before...

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-11 11:40:47 +01:00
David Lamparter
684959068c build: apply DFLT_NAME/profiles in init script
Hopefully at some point we can get rid of the --enable-datacenter switch
and just have the init script do magic.  Should already work for Cumulus
as it is.

NB: the profile name can't be baked into the package.  The whole point
is to make the package profile-agnostic;  in theory at some point the
exact same package files should work on both, say, a Cumulus switch and
a Linux software BGP DFZ router.

Signed-off-by: David Lamparter <equinox@diac24.net>
2019-12-06 15:13:32 +01:00
Donald Sharp
f75e802d8a *: Allow disabling of getrusage calls
getrusage, in a heavily stressed system, can account for
signficant running time due to process switching to the kernel.
Allow the end-operator to specify `--disable-cpu-time` to
avoid this call.  Additionally we cause `show thread cpu` to
not show up if this is selected.

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-10-16 13:34:59 -04:00
Rafael Zalamena
65209e4fbf configure.ac: fix memory sanitizer test
We should test for `-fsanitize=memory` instead of `-fsanitize=thread`
when enabling memory sanitizer. While here, fix the error message.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
2019-10-08 21:24:26 -03:00
Donald Sharp
d3fc71f304
Merge pull request #4912 from lucize/carescross
clippy: don't fail on CARES and libcap when clippy-only selected
2019-09-24 08:14:45 -04:00
Donald Sharp
da44fd80f0 configure: Update versioning
We have pulled the 7.2 branch let's update the master branch
to say it's 7.3

Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
2019-09-20 14:36:01 -04:00
Lucian Cristian
2cd3abe419 clippy: fail libcap test only when !enable_clippy_only
when building native clippy we don't need libcap

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
2019-09-13 07:16:18 +03:00
Lucian Cristian
2163a630eb clippy: CARES fail only if !enable_clippy_only
test for CARES otherwise config will fail with conditional "CARES" not defined

Signed-off-by: Lucian Cristian <lucian.cristian@gmail.com>
2019-09-13 07:12:34 +03:00
Quentin Young
68376178e5
Merge pull request #4919 from opensourcerouting/config-warnings
build: error out on implicit missing libcap, warn for protobuf FPM
2019-09-03 14:55:38 -04:00
David Lamparter
7bfe765ae0 build: only build without libcap on request
Linux FRR builds without libcap are massively slow due to the
signal-based UID/GID synchronization across threads.  This disables the
automatic fallback to build without libcap;  it can still be requested
with "--disable-capabilities" but if the option isn't given in either
direction and we can't find libcap that's an error now.

Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2019-09-02 20:52:56 +02:00