]> git.proxmox.com Git - mirror_frr.git/commit - sharpd/sharp_logpump.c
lib: rewrite zlog lock-free & TLS-buffered
authorDavid Lamparter <equinox@opensourcerouting.org>
Sat, 6 May 2017 04:40:17 +0000 (06:40 +0200)
committerDavid Lamparter <equinox@diac24.net>
Wed, 1 Apr 2020 04:53:26 +0000 (06:53 +0200)
commit0bdeb5e58d8fdf8b0f30461a388768112b0e080c
tree8a5889d3b10b0b89a6fbf403f3bc7a3a040fce3e
parent6f00dd6658acd0dc04f6c65e28452c2de93c99d5
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>
33 files changed:
bfdd/bfdd.c
bgpd/rfapi/rfapi_vty.c
configure.ac
ldpd/ldpd.c
ldpd/log.c
lib/clippy.c
lib/command.c
lib/command.h
lib/frr_pthread.c
lib/grammar_sandbox_main.c
lib/libfrr.c
lib/log.c
lib/log.h
lib/log_int.h [deleted file]
lib/log_vty.c
lib/log_vty.h
lib/subdir.am
lib/thread.c
lib/zlog.c [new file with mode: 0644]
lib/zlog.h [new file with mode: 0644]
lib/zlog_targets.c [new file with mode: 0644]
lib/zlog_targets.h [new file with mode: 0644]
pimd/pim_mlag.c
sharpd/sharp_logpump.c
tests/bgpd/test_peer_attr.c
tests/lib/cli/common_cli.c
tests/lib/northbound/test_oper_data.c
tests/lib/test_segv.c
tests/lib/test_sig.c
tests/lib/test_zlog.c
vtysh/vtysh.c
watchfrr/watchfrr.c
watchfrr/watchfrr_vty.c