Commit graph

69 commits

Author SHA1 Message Date
Vern Paxson
dc376953fa framework for --enable-ZAM-profiling configuration
profiles go to zprof.log rather than stdout
2024-03-19 10:59:49 -07:00
Vern Paxson
fadda05782 added "-O noinline" option to turn off ZAM inlining, to help with diagnosing optimization problems 2023-11-10 09:57:35 +01:00
Benjamin Bannier
f5a76c1aed Reformat Zeek in Spicy style
This largely copies over Spicy's `.clang-format` configuration file. The
one place where we deviate is header include order since Zeek depends on
headers being included in a certain order.
2023-10-30 09:40:55 +01:00
Arne Welzel
55655f5ea1 Options: Do not output full usage on --test error
...mostly because the usage output is very long and the actual useful
error message scrolls off the screen.
2023-06-15 13:56:34 +02:00
Arne Welzel
b2d934226f Introduce ZEEK_SEED_VALUES environment variable
For "individually different but deterministic" runs specifying Zeek's
seed as an environment variable eases setups as one can avoid creating
extra seed files for each of the individual processes.

It is an error to specify the new ZEEK_SEED_VALUES variable together
with the existing ZEEK_SEED_FILE and -G. ZEEK_SEED takes precedence over
deterministic mode (-D) like ZEEK_SEED_FILE does today already.
2023-05-12 19:50:37 +02:00
Tim Wojtulewicz
4b69baa522 Add call stacks to script profiler output 2023-04-19 08:45:17 -07:00
Arne Welzel
3284259561 Add zeek -V/--build-info
This adds a new utility called ci/collect-repo-info.py to produce a JSON
document that is then baked into the Zeek executable file. Further, when
creating a tarball via `make dist`, put a top-level repo-info.json file
in place that is picked when no .git directory exists.

Closes #1405
2023-02-13 12:23:29 +01:00
Vern Paxson
65a2900bb7 removed -O add-C++ option and updated documentation 2023-01-24 10:52:58 -08:00
Tim Wojtulewicz
a8fc63e182 Merge remote-tracking branch 'microsoft/master'
* microsoft/master: (71 commits)
  Clang formatting
  Mask ports before inserting them into the map
  Fix compiler warning from applied patch
  Remove statistics plugin in favor of stats bif
  Add EventHandler version of stats plugin
  Mark a few EventHandler methods const
  Changed implementation from std::map to std::unordered_map of Val.cc
  Removed const, Windows build is now working
  Added fixes suggested in PR
  Update src/packet_analysis/protocol/ip/IP.cc
  Apply suggestions from code review
  Clang format again but now with v13.0.1
  Rewrote usages of define(_MSC_VER) to ifdef _MSC_VER
  Clang format it all
  Fixed initial CR comments
  Add NEWS entry about Windows port
  Add a couple of extra unistd.h includes to fix a build failure
  Use std::chrono instead of gettimeofday
  Update libkqueue submodule [nomail]
  Don't call tokenize_string if the input string is empty
  ...
2022-11-11 15:23:21 -07:00
Tim Wojtulewicz
77c555a3a8 Fixing some issues from rebasing 2022-11-09 18:16:13 +02:00
Elad Solomon
79fbfd0af7 Fixed include order of unistd, repositioned it at the top 2022-11-09 18:15:34 +02:00
Elad Solomon
3a80b79497 Compile Zeek with MSVC
Allow Zeek to be embedded in another project
2022-11-09 18:15:30 +02:00
Vern Paxson
ee0a6f6835 Script optimization maintenance and updates:
maintenance fixes for variadic run-time checks, '_' placeholder identifier
  "-O allow-cond" permits compiling scripts to C++ when influenced by @if conditionals
  more robust standalone compile-to-C++ properties
  fix for nested "when" statements
  test suite updates
2022-11-08 11:56:32 -08:00
Tim Wojtulewicz
05ba11c72a Reorder includes in Options.cc 2022-10-21 10:08:34 -07:00
Christian Kreibich
b0001613f5 Alignment tweak in help output 2022-08-17 12:35:43 -07:00
Tim Wojtulewicz
5ca0bb79c8 Fixes from review, post-rebase 2022-05-26 18:39:01 -07:00
Vern Paxson
9f05fe5bfa code formatting and more btest updates 2022-05-26 18:15:48 -07:00
Vern Paxson
d9479c0502 --no-usage-warnings flag to suppress analysis 2022-05-26 17:39:15 -07:00
Vern Paxson
07f5e9cbe7 hooks for new --profile-scripts option 2022-05-03 11:12:29 -07:00
Vern Paxson
ecd273c3ca --event-trace / -E option to generate event trace 2022-03-23 10:03:13 -07:00
Vern Paxson
16e9af137f fixes for ZAM profiling, which didn't get fully integrated originally 2022-02-03 08:59:39 -08:00
Vern Paxson
5e71e757fe correct usage info for -u flag; -uu no longer supported 2021-12-14 11:37:51 -08:00
Vern Paxson
9069e744f9 replace --optimize-only with --optimize-funcs and --optimize-files 2021-12-10 12:45:27 -08:00
Vern Paxson
8c59626eb9 reintroduction of "-O add-C++" option 2021-12-10 10:19:23 -08:00
Christian Kreibich
5c44dfbb9e Flip unit tests to being enabled by default
This flips --enable-cpp-tests to --disable-cpp-tests, enabling unit testing by
default. The help output has a minor corresponding tweak as well.
2021-12-06 12:17:22 -08:00
Tim Wojtulewicz
e0b4659488 Merge remote-tracking branch 'origin/topic/vern/CPP-speedup'
* origin/topic/vern/CPP-speedup:
  use iterator-based idiom for check-if-present-then-access
  const-ify member function
  switch looping over vectors to use iterators
  remove unused local variables
  efficiency fix - return a reference rather than a copy of a map
  fix for case-sensitive file systems
  geez sometimes it's signed sometimes it's not
  documentation updates
  remove -O add-C++ and -O update-C++ options
  extensive rewrite of generation & execution of run-time initialization
  factoring out CPPEscape to be a standalone function
  removing unused SubNetType class
2021-11-23 19:44:57 -07:00
Tim Wojtulewicz
d0f8c50417 Fix whitespace in help output 2021-11-12 09:30:26 -07:00
Tim Wojtulewicz
92b84a00f9 Add command-line option to write unprocessed packets to a file
This commit also changes the PcapDumper to automatically flush after
every called to Dump(). This is because pcap_dump has an internal buffer
of some sort that only writes to the file after a set amount of bytes.
When using the new option on a low-traffic network, it might be a while
before you see any packets written since it has to overcome that buffer
limit first.
2021-11-12 09:30:26 -07:00
Benjamin Bannier
72cbc7cd13 Move 3rdparty source files to 3rdparty/
This patch moves in-tree 3rdparty source files to `3rdparty/`. With that
we can remove special treatment of these files for `run-clang-format`.
2021-11-09 07:20:18 +01:00
Vern Paxson
bb618bae30 remove -O add-C++ and -O update-C++ options 2021-11-07 17:02:18 -08:00
Tim Wojtulewicz
9cb54f5d44 clang-format: Force zeek-config.h to be earlier in the config ordering 2021-09-25 11:52:55 -07:00
Tim Wojtulewicz
b2f171ec69 Reformat the world 2021-09-16 15:35:39 -07:00
Vern Paxson
ddac6e5f67 reworking of command-line options related to script optimization 2021-09-08 10:23:38 -07:00
Benjamin Bannier
ebe285f591 Allow -B flag in non-Debug builds, but ignore it.
The `-B` flag allows to enable debug streams in Debug builds. We
previously didn't support passing the flag for other builds. With that
whether an invocation of `zeek` executed or not depended on the way zeek
was built.

With this patch we accept and parse the flag when passed in the
invocation, but ignore any requests for actual debug streams in
non-Debug builds (no streams are available). If `-B help` is passed we
emit a message and abort.
2021-08-27 13:52:50 +02:00
Christian Kreibich
712a28a813 Remove remaining vestigial IDMEF support code 2021-06-28 15:18:16 -07:00
Tim Wojtulewicz
67b45bc502 Merge remote-tracking branch 'origin/topic/vern/ZAM-prep'
* origin/topic/vern/ZAM-prep: (45 commits)
  whoops overlooked the need to canonicalize filenames
  another set of tweaks per review comments
  addressed a number of code review comments
  baseline updates for merge
  support "any" coercions for "-O gen-C++"
  better descriptions for named record constructors
  test suite baseline updates for "-a opt" optimize-AST alternative
  test suite baseline updates for "-a xform" alternative / AST transformation
  error propagation fix for AST reduction
  updates to "-a inline" test suite alternative baseline
  updates for the main test suite baseline
  updates to test suite tests for compatibility with upcoming ZAM functionality
  "-O compile-all" option to specify compilation of inlined functions
  compile inlined functions if they're also used indirectly
  provide ZAM-generated code with low-level access to record fields
  fix for cloning records with fields of type "any"
  direct access for ZAM to VectorVal internal vector
  ZVal constructors, accessors & methods in support of ZAM
  switch ZVal representation of types from Type objects to TypeVal's
  revised error-reporting interface for ZVal's, to accommodate ZAM inner loop
  ...
2021-06-28 11:03:13 -07:00
Christian Kreibich
a2e5251796 Minor tweaks to single-character command line option handling
- Use of "-B" now triggers usage output and errors out when Zeek
  wasn't built with debugging support.

- Always keep the perftools options (-m, -M) in the optparse string,
  for consistency with other flags dependent on configuration. We
  still fall through to usage and erroring out as before.

- Minor indentation fix.
2021-06-24 16:02:45 -07:00
Vern Paxson
b5b58b0a3a "-O compile-all" option to specify compilation of inlined functions 2021-06-01 09:24:17 -07:00
Vern Paxson
2b0f1c9d6e remove -O force-C++, and also some inadvertently replicated code 2021-05-05 19:11:17 -07:00
Vern Paxson
24e92fa54a hooks for activating the compiler & associated BiF 2021-05-05 16:55:04 -07:00
Vern Paxson
d38cc04e83 enable setting "-O optimize-AST" option 2021-02-27 10:59:27 -08:00
Vern Paxson
12c9b5ede5 flag/environment variable for dumping use-defs 2021-02-05 22:26:24 -08:00
Jon Siwek
cfe29c2488 Merge branch 'master' into topic/vern/reaching-defs 2021-02-01 17:27:37 -08:00
Jon Siwek
dacdf5424b Merge remote-tracking branch 'origin/topic/jsiwek/deprecate-zeekenv'
* origin/topic/jsiwek/deprecate-zeekenv:
  Deprecate zeekenv() and use getenv() directly
2021-02-01 12:13:47 -08:00
Jon Siwek
8a8a983c49 Add missing zeek/ to header includes
Related to https://github.com/zeek/zeek/pull/1377
2021-01-29 19:16:29 -08:00
Jon Siwek
b8c563dbdd Deprecate zeekenv() and use getenv() directly 2021-01-29 16:55:44 -08:00
Vern Paxson
732633ebb4 option handling for new -u/-uu flag for reporting usage issues 2021-01-23 10:25:06 -08:00
Jon Siwek
81fa7f7e3d Switch AnalyOpt::only_func to optional<string>
Nothing of consequence; may help express meaning and memory management.
2021-01-13 13:19:46 -08:00
Vern Paxson
77e9610086 options relating to script transformation: activation, dumping, selecting only a single function (for debugging) 2021-01-10 13:29:05 -08:00
Vern Paxson
c42586af2c inlining of Zeek script functions 2020-11-19 16:16:59 -08:00