Commit graph

38 commits

Author SHA1 Message Date
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
Tim Wojtulewicz
96d9115360 GH-1079: Use full paths starting with zeek/ when including files 2020-11-12 12:15:26 -07:00
Seth Hall
97f7bf784b Fixed an option processing bug 2020-10-08 16:11:25 -04:00
Seth Hall
2bdc56dfcd Make it possible to pass command line options through to scripts.
The feature is documented with the zeek_script_args variable in
init-bare.zeek.
2020-10-08 15:46:28 -04:00
Tim Wojtulewicz
fe0c22c789 Base: Clean up explicit uses of namespaces in places where they're not necessary.
This commit covers all of the common and base classes.
2020-08-24 12:07:00 -07:00
Tim Wojtulewicz
6a3f98c835 Move zeek-setup code into namespaces 2020-08-20 16:11:46 -07:00
Tim Wojtulewicz
ddf48d7529 Move a few of the zeek::util methods and variables to zeek::util::detail 2020-08-20 16:11:44 -07:00
Tim Wojtulewicz
8d2d867a65 Move everything in util.h to zeek::util namespace.
This commit includes renaming a number of methods prefixed with bro_ to be prefixed with zeek_.
2020-08-20 16:00:33 -07:00
Tim Wojtulewicz
45b5c6e619 Move logging code to zeek namespaces 2020-08-20 15:55:17 -07:00
Tim Wojtulewicz
7cedd94ee7 Move DNS_Mgr to zeek::detail namespace 2020-07-31 16:22:41 -04:00
Johanna Amann
01fa5611ef Merge remote-tracking branch 'origin/topic/timw/clang-tidy'
* origin/topic/timw/clang-tidy:
  Don't specify 0u for initial value of loops changed to size_t
  Use .empty() instead of checking size against zero
  Use properly-sized loop variables or convert to ranged-for (bugprone-too-small-loop-variable)

Merge changes one type over to ptrdiff_t
2020-07-30 17:54:38 +00:00
Tim Wojtulewicz
a2c3919492 Don't specify 0u for initial value of loops changed to size_t 2020-07-30 09:57:42 -07:00
Tim Wojtulewicz
1248411a2f Use properly-sized loop variables or convert to ranged-for (bugprone-too-small-loop-variable) 2020-07-28 12:36:40 -07:00
Jon Siwek
8f1b34b915 Add basic structure for fuzzing targets
General changes:

* Add -D/--deterministic command line option as
  convenience/alternative to -G/--load-seeds (i.e. no file needed, it just
  uses zero-initialized random seeds).  It also changes Broker data
  stores over to using deterministic timing rather than real time.

* Add option to make Reporter abort on runtime scripting errors
2020-04-23 12:51:25 -07:00
Tim Wojtulewicz
0a47588d0b The remaining nulls 2020-04-07 16:08:34 -07:00
Max Kellermann
0db61f3094 include cleanup
The Zeek code base has very inconsistent #includes.  Many sources
included a few headers, and those headers included other headers, and
in the end, nearly everything is included everywhere, so missing
#includes were never noticed.  Another side effect was a lot of header
bloat which slows down the build.

First step to fix it: in each source file, its own header should be
included first to verify that each header's includes are correct, and
none is missing.

After adding the missing #includes, I replaced lots of #includes
inside headers with class forward declarations.  In most headers,
object pointers are never referenced, so declaring the function
prototypes with forward-declared classes is just fine.

This patch speeds up the build by 19%, because each compilation unit
gets smaller.  Here are the "time" numbers for a fresh build (with a
warm page cache but without ccache):

Before this patch:

 3144.94user 161.63system 3:02.87elapsed 1808%CPU (0avgtext+0avgdata 2168608maxresident)k
 760inputs+12008400outputs (1511major+57747204minor)pagefaults 0swaps

After this patch:

 2565.17user 141.83system 2:25.46elapsed 1860%CPU (0avgtext+0avgdata 1489076maxresident)k
 72576inputs+9130920outputs (1667major+49400430minor)pagefaults 0swaps
2020-02-04 20:51:02 +01:00
Jon Siwek
2f36113743 Change packet source fields of Options to std::optional 2020-01-31 15:41:23 -08:00
Tim Wojtulewicz
f16f0360ff Only allow a single trace file (-r) or interface (-i) option on the command-line 2020-01-31 09:34:54 -07:00
Jon Siwek
53363a9bd3 Move command-line arg parsing functions to Options.{h,cc} 2020-01-27 13:50:44 -08:00
Jon Siwek
718879735e Address supervisor code re-factoring feedback from Robin 2020-01-21 22:26:17 -08:00