Merge remote-tracking branch 'origin/topic/vern/zam-EH-coalesce'

* origin/topic/vern/zam-EH-coalesce:
  BTest updates to accommodate event handler coalescence differences
  BTests for testing that event handler coalescence operates as expected
  coalescing of event handlers (ZAM optimization)

Minor fixups during merge as commented on the PR.
This commit is contained in:
Arne Welzel 2023-11-17 18:00:32 +01:00
commit b0a200a5dc
17 changed files with 395 additions and 69 deletions

View file

@ -1,19 +1 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
ftp field missing
[orig_h=141.142.220.118, orig_p=48649/tcp, resp_h=208.80.152.118, resp_p=80/tcp]
ftp field missing
[orig_h=141.142.220.118, orig_p=49997/tcp, resp_h=208.80.152.3, resp_p=80/tcp]
ftp field missing
[orig_h=141.142.220.118, orig_p=49996/tcp, resp_h=208.80.152.3, resp_p=80/tcp]
ftp field missing
[orig_h=141.142.220.118, orig_p=49998/tcp, resp_h=208.80.152.3, resp_p=80/tcp]
ftp field missing
[orig_h=141.142.220.118, orig_p=50000/tcp, resp_h=208.80.152.3, resp_p=80/tcp]
ftp field missing
[orig_h=141.142.220.118, orig_p=49999/tcp, resp_h=208.80.152.3, resp_p=80/tcp]
ftp field missing
[orig_h=141.142.220.118, orig_p=50001/tcp, resp_h=208.80.152.3, resp_p=80/tcp]
ftp field missing
[orig_h=141.142.220.118, orig_p=35642/tcp, resp_h=208.80.152.2, resp_p=80/tcp]
ftp field missing
[orig_h=141.142.220.235, orig_p=6705/tcp, resp_h=173.192.163.128, resp_p=80/tcp]

View file

@ -0,0 +1,51 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
packet counting, 1
packet observer, 1
packet logging, 1
packet counting, 2
packet observer, 2
packet logging, 2
packet counting, 3
packet observer, 3
packet logging, 3
packet counting, 4
packet observer, 4
packet logging, 4
packet counting, 5
packet observer, 5
packet logging, 5
packet counting, 6
Log::disable_stream()
packet observer, 6
packet logging, 6
packet counting, 7
packet counting, 8
packet counting, 9
packet counting, 10
packet counting, 11
packet counting, 12
packet counting, 13
packet counting, 14
packet counting, 15
packet counting, 16
packet counting, 17
packet counting, 18
packet counting, 19
packet counting, 20
packet counting, 21
packet counting, 22
packet counting, 23
packet counting, 24
packet counting, 25
Log::enable_stream()
packet observer, 25
packet logging, 25
packet counting, 26
packet observer, 26
packet logging, 26
packet counting, 27
packet observer, 27
packet logging, 27
packet counting, 28
packet observer, 28
packet logging, 28

View file

@ -0,0 +1,19 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
#separator \x09
#set_separator ,
#empty_field (empty)
#unset_field -
#path packet
#open XXXX-XX-XX-XX-XX-XX
#fields ts c ttl len
#types time count count count
XXXXXXXXXX.XXXXXX 1 64 66
XXXXXXXXXX.XXXXXX 2 59 117
XXXXXXXXXX.XXXXXX 3 64 80
XXXXXXXXXX.XXXXXX 4 59 127
XXXXXXXXXX.XXXXXX 5 64 66
XXXXXXXXXX.XXXXXX 25 64 64
XXXXXXXXXX.XXXXXX 26 59 159
XXXXXXXXXX.XXXXXX 27 64 64
XXXXXXXXXX.XXXXXX 28 59 226
#close XXXX-XX-XX-XX-XX-XX

View file

@ -0,0 +1,5 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
my_event
ZAM-code my_event
second instance, higher priority
first instance, lower priority

View file

@ -0,0 +1,5 @@
### BTest baseline data generated by btest-diff. Do not edit. Use "btest -U/-u" to update. Requires BTest >= 0.63.
my_event
ZAM-code my_event ZAM-code my_event
second instance, higher priority
first instance, lower priority

View file

@ -0,0 +1,23 @@
# @TEST-DOC: Ensure that event coalescence works properly.
#
# @TEST-EXEC: zeek -b -O ZAM %INPUT >output
# @TEST-EXEC: btest-diff output
event my_event() &priority=-10
{
print "first instance, lower priority";
}
event my_event() &priority=10
{
print "second instance, higher priority";
}
event zeek_init()
{
# This should print a single event handler body.
print my_event;
# Make sure execution of both handlers happens properly.
event my_event();
}

View file

@ -0,0 +1,23 @@
# @TEST-DOC: Ensure that event coalescence doesn't happen if inlining turned off.
#
# @TEST-EXEC: zeek -b -O ZAM -O no-inline %INPUT >output
# @TEST-EXEC: btest-diff output
event my_event() &priority=-10
{
print "first instance, lower priority";
}
event my_event() &priority=10
{
print "second instance, higher priority";
}
event zeek_init()
{
# This should print two event handler bodies.
print my_event;
# Make sure execution of both handlers happens properly.
event my_event();
}

View file

@ -1,4 +1,5 @@
# @TEST-REQUIRES: test "${ZEEK_USE_CPP}" != "1"
# @TEST-REQUIRES: test "${ZEEK_ZAM}" != "1"
# @TEST-EXEC: zeek -b -O inline %INPUT >output
# @TEST-EXEC: btest-diff output

View file

@ -1,5 +1,5 @@
# @TEST-EXEC: btest-bg-run zeek zeek -b ../dirtest.zeek
# @TEST-EXEC: $SCRIPTS/wait-for-file zeek/next1 10 || (btest-bg-wait -k 1 && false)
# @TEST-EXEC: $SCRIPTS/wait-for-file zeek/next1 20 || (btest-bg-wait -k 1 && false)
# @TEST-EXEC: rm testdir/bye
# @TEST-EXEC: touch testdir/newone
# @TEST-EXEC: $SCRIPTS/wait-for-file zeek/next2 10 || (btest-bg-wait -k 1 && false)