diff --git a/CHANGES b/CHANGES index 7fa5062a5d..13e625f3c3 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,31 @@ +6.1.0-dev.538 | 2023-10-11 15:20:27 +0200 + + * ci/update-zeekygen-docs.sh: Do output stderr by default (Arne Welzel, Corelight) + + stderr was only produced when there was a real failure as it had been a + bit noisy previously, but has hidden actual problems. Now that there is + less noise, just output stderr all the time. + + * zeekygen: Disable zeek_init() handlers causing error output (Arne Welzel, Corelight) + + These modules have zeek_init() handlers with actual logic that has side-effects + and error outputs. Just disable them during zeekygen runs. + + * zeekygen/example: Squelch unused function warning (Arne Welzel, Corelight) + + * iosource/pcap: Support configurable buffer size (Arne Welzel, Corelight) + + On Linux with a default ext4 or tmpfs filesystem, the default buffer size for + reading a pcap is chosen as 4k (strace/gdb validated). When reading large pcaps + containing raw data transfers, the syscall overhead for read becomes visible + in profiles. Support configurability of the buffer size and default to 128kb. + + When processing a ~830M PCAP (16 UDP connections, each transferring ~50MB) in + bare mode, this change improves runtime from 1.39 sec to 1.29 sec. Increasing + the buffer further didn't provide a noticeable boost. + + * util/setvbuf: Respect buf argument (Arne Welzel, Corelight) + 6.1.0-dev.531 | 2023-10-11 14:09:22 +0200 * protocol/ldap: Add doc-id/doc-description to .evt file (Arne Welzel, Corelight) diff --git a/VERSION b/VERSION index fa200f4eec..e649eeac10 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -6.1.0-dev.531 +6.1.0-dev.538 diff --git a/ci/update-zeekygen-docs.sh b/ci/update-zeekygen-docs.sh index c4722237cb..278588752b 100755 --- a/ci/update-zeekygen-docs.sh +++ b/ci/update-zeekygen-docs.sh @@ -13,7 +13,6 @@ source_dir="$(cd $dir/.. && pwd)" build_dir=$source_dir/build conf_file=$build_dir/zeekygen-test.conf output_dir=$source_dir/doc -zeek_error_file=$build_dir/zeekygen-test-stderr.txt if [ -n "$1" ]; then output_dir=$1 @@ -29,11 +28,10 @@ cd $build_dir export ZEEK_SEED_FILE=$source_dir/testing/btest/random.seed function run_zeek { - ZEEK_ALLOW_INIT_ERRORS=1 zeek -X $conf_file zeekygen >/dev/null 2>$zeek_error_file + ZEEK_ALLOW_INIT_ERRORS=1 zeek -X $conf_file zeekygen >/dev/null if [ $? -ne 0 ]; then - echo "Failed running zeek with zeekygen config file $conf_file" - echo "See stderr in $zeek_error_file" + echo "Failed running zeek with zeekygen config file $conf_file" >&2 exit 1 fi } diff --git a/scripts/zeekygen/__load__.zeek b/scripts/zeekygen/__load__.zeek index 2cfa93d48b..80a530bc3b 100644 --- a/scripts/zeekygen/__load__.zeek +++ b/scripts/zeekygen/__load__.zeek @@ -21,7 +21,14 @@ @load ./example.zeek -event zeek_init() +event zeek_init() &priority=1000 { + # Disable events in modules that use zeek_init() to do stuff and may + # fail when run under zeekygen. For the purpose of zeekygen, we could + # probably disable all modules, too. + disable_module_events("Control"); + disable_module_events("Management::Agent::Runtime"); + disable_module_events("Management::Controller::Runtime"); + disable_module_events("Management::Node"); terminate(); } diff --git a/scripts/zeekygen/example.zeek b/scripts/zeekygen/example.zeek index 360d044b64..681457d402 100644 --- a/scripts/zeekygen/example.zeek +++ b/scripts/zeekygen/example.zeek @@ -173,7 +173,7 @@ export { # This function isn't exported, so it won't appear anywhere in the generated # documentation. So using ``##``-style comments is pointless here. -function function_without_proto(tag: string): string +function function_without_proto(tag: string): string &is_used { # Zeekygen-style comments only apply to entities at global-scope so # Zeekygen doesn't associate the following comments with anything. diff --git a/testing/btest/Baseline/doc.zeekygen.identifier/test.rst b/testing/btest/Baseline/doc.zeekygen.identifier/test.rst index 219c92da8b..b24dc870a3 100644 --- a/testing/btest/Baseline/doc.zeekygen.identifier/test.rst +++ b/testing/btest/Baseline/doc.zeekygen.identifier/test.rst @@ -240,6 +240,7 @@ :source-code: zeekygen/example.zeek 176 184 :Type: :zeek:type:`function` (tag: :zeek:type:`string`) : :zeek:type:`string` + :Attributes: :zeek:attr:`&is_used` .. zeek:type:: ZeekygenExample::PrivateRecord