mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge remote-tracking branch 'origin/topic/awelzel/update-zeekygen-docs-show-stderr'
* origin/topic/awelzel/update-zeekygen-docs-show-stderr: ci/update-zeekygen-docs.sh: Do output stderr by default zeekygen: Disable zeek_init() handlers causing error output zeekygen/example: Squelch unused function warning
This commit is contained in:
commit
01bf1d4764
6 changed files with 41 additions and 7 deletions
28
CHANGES
28
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
|
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)
|
* protocol/ldap: Add doc-id/doc-description to .evt file (Arne Welzel, Corelight)
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
6.1.0-dev.531
|
6.1.0-dev.538
|
||||||
|
|
|
@ -13,7 +13,6 @@ source_dir="$(cd $dir/.. && pwd)"
|
||||||
build_dir=$source_dir/build
|
build_dir=$source_dir/build
|
||||||
conf_file=$build_dir/zeekygen-test.conf
|
conf_file=$build_dir/zeekygen-test.conf
|
||||||
output_dir=$source_dir/doc
|
output_dir=$source_dir/doc
|
||||||
zeek_error_file=$build_dir/zeekygen-test-stderr.txt
|
|
||||||
|
|
||||||
if [ -n "$1" ]; then
|
if [ -n "$1" ]; then
|
||||||
output_dir=$1
|
output_dir=$1
|
||||||
|
@ -29,11 +28,10 @@ cd $build_dir
|
||||||
export ZEEK_SEED_FILE=$source_dir/testing/btest/random.seed
|
export ZEEK_SEED_FILE=$source_dir/testing/btest/random.seed
|
||||||
|
|
||||||
function run_zeek {
|
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
|
if [ $? -ne 0 ]; then
|
||||||
echo "Failed running zeek with zeekygen config file $conf_file"
|
echo "Failed running zeek with zeekygen config file $conf_file" >&2
|
||||||
echo "See stderr in $zeek_error_file"
|
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,14 @@
|
||||||
|
|
||||||
@load ./example.zeek
|
@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();
|
terminate();
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,7 +173,7 @@ export {
|
||||||
|
|
||||||
# This function isn't exported, so it won't appear anywhere in the generated
|
# This function isn't exported, so it won't appear anywhere in the generated
|
||||||
# documentation. So using ``##``-style comments is pointless here.
|
# 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-style comments only apply to entities at global-scope so
|
||||||
# Zeekygen doesn't associate the following comments with anything.
|
# Zeekygen doesn't associate the following comments with anything.
|
||||||
|
|
|
@ -240,6 +240,7 @@
|
||||||
:source-code: zeekygen/example.zeek 176 184
|
:source-code: zeekygen/example.zeek 176 184
|
||||||
|
|
||||||
:Type: :zeek:type:`function` (tag: :zeek:type:`string`) : :zeek:type:`string`
|
:Type: :zeek:type:`function` (tag: :zeek:type:`string`) : :zeek:type:`string`
|
||||||
|
:Attributes: :zeek:attr:`&is_used`
|
||||||
|
|
||||||
|
|
||||||
.. zeek:type:: ZeekygenExample::PrivateRecord
|
.. zeek:type:: ZeekygenExample::PrivateRecord
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue