- Minor code formatting change in merge
* 'misc_cleanup' of https://github.com/MaxKellermann/zeek:
Desc: move realloc() call out of the loop
SerializationFormat: move realloc() call out of the loop
PacketDumper: remove unused types
* origin/topic/timw/264-alternative:
Add better error messaging when RegisterFd/UnregisterFd fail
Update Supervisor code for the new IOSource API
Show percentage of packets dropped in the final process output
Update NEWS and docs submodule
Remove concept of multiple timer managers
Test changes caused by minor order-of-operation changes related to the new loop architecture
Have terminate_processing() raise SIGTERM instead of calling the signal handler directly
PktSrc iosource changes to match the new IOSource API
Broker manager changes to match the new IOSource API and loop architecture
DNS_Mgr changes to match the new IOSource API and loop architecture
Threading changes for the new loop architecture
Add Trigger manager for managing triggers created by things like 'when' statements
Make TimerMgr an IOSource
Modify IOSource Manager to implement new loop architecture
Minor amount of code cleanup in Pcap IO source
IOSource API changes for new loop architecture
Type and variable usage cleanup in Net.h
Remove #include of some iosource files from Net.h
Only allow a single trace file (-r) or interface (-i) option on the command-line
Remove CQ_TimerMgr in favor of PQ_TimerMgr
- All timers are now handled by a single global timer manager, which simplifies how they handled by the IOSource manager.
- This change flows down a number of changes to other parts of the code. The timer manager tag field is removed, which means that matching connections to a timer manager is also removed. This removes the ability to tag a connection as internal or external, since that's how the connections where differentiated. This in turn removes the `current_conns_extern` field from the `ConnStats` record type in the script layer.
- threading::Manager is no longer an IOSource.
- threading::MsgThread is now an IOSource. This allows threads themselves to signal when they have data to process instead of continually checking each of the threads on every loop pass.
- Make the thread heartbeat timer an actual timer and let it fire as necessary instead of checking to see if it should fire
- Adds new trigger namespace
- Adds trigger::Manager class as a new IOSource for keeping track of triggers and integrating them into the loop. Previously the loop relied on the event manager Drain() method to process all triggers on every loop, but now that the loop actively waits for events to occur, triggers would not fire when they needed to. Adding them as part of the loop ensures they're checked.
- This allows the loop to check what the next timeout is and use that as the basis for the timeout of the poll
- This commit also removes the TimerMgr::Tag type, since it causes a name clash with other code in IOSource
- Removes entire FindSoonest method that includes all of the calls to select() for checking for ready sources
- Removes FD_Set checking against IOSources
- Adds system for registering and unregistering file descriptors from IOSources. This allows individual sources to mark themselves as ready to be checked by the loop as they become available.
- Adds entirely new loop architecture based on checking the IOSources for when their next timeout is, and then waiting for either that timeout or when the next source is ready. This also implements the polling based on what the OS supports, instead of just calling select() on all platforms. Currently it supports kqueue, epoll, and plain poll.
- Adds system for pinging the loop to force it to wake up
- Removed GetFD and NextTimestamp methods
- Removed concept of idle sources
- Renamed Init to InitSource to avoid a name clash with the thread code
- Added GetNextTimeout method
This commit also removes the FD_Set file since it's no longer used
Don't copy those path segments - instead, use std::string_view to
store references into the existing std::strings. This saves a good
amount of allocation overhead.
When defining a function, remember the location where the function header
was and restore it before calling `end_func()`. Inside `end_func()`, a
`BroFunc` object is created using the current global location information.
This came up while experimenting with zeek script profiling and wondering
why the locations set for `BroFunc` were "somewhere" in the middle of
functions instead of spanning them.
During merge I split the test for bro_init/bro_done/bro_script_loaded
event errors into individual tests since the other testing of the zeek
versions of those events seemed fine to otherwise keep.
* origin/topic/robin/631-deprecation-v2:
Update NEWS for naming changes.
Small cleanup and updating submodules.
Remove test for legacy plugin.
Remove legancy symlinks in aux/.
Add warnings when loading scripts ending in ".bro", or using legacy environment variables.
Fix missing rename.
No longer symlink local.zeek to local.bro.
Update notice user agent.
Remove old_comm_usage_is_ok.
Remove bro-config.h.in and bro-path-dev.in.
Change Bro wrapper script to now abort when old executable names are still used.
Remove APIs that were explicitly deprecated to be removed in 3.1.
* origin/topic/jsiwek/supervisor: (44 commits)
Add note that Supervisor script APIs are unstable until 4.0
Move command-line arg parsing functions to Options.{h,cc}
Add btests for supervisor stem/leaf process revival
Move supervisor control events into SupervisorControl namespace
Fix supervisor "destroy" call on nodes not currently alive
Move supervisor source files into supervisor/
Address supervisor code re-factoring feedback from Robin
Convert supervisor internals to rapidjson
Add Supervisor documentation
Add supervisor btests
Improve logging of supervised node errors
Fix supervised node inheritence of command-line script paths
Improve normalize_path() util function
Use a timer to check for death of supervised node's parent
Improve supervisor checks for parent process termination
Improve handling of premature supervisor stem exit
Improve supervisor signal handler safety
Remove unused supervisor config options
Cleanup minor Supervisor TODOs
Improve supervisor debug logging
...