Commit graph

10798 commits

Author SHA1 Message Date
Daniel Thayer
4a6a9fe9f2 Fix sorting of lines in Brofiler coverage.log
Lines with a range were being output with text "lines", and so were
being listed after all other lines belonging to the same Bro script
(e.g., "lines 123-125" was listed after "line 492").  Fixed by using
the text "line" instead of "lines".

Line numbers with fewer digits were being listed after line numbers
with more digits (e.g., "line 85" was listed after "line 237").
Fixed by sorting on a reformatted string (this string does not appear
in the output) where line numbers are right justified (padded on left
with spaces) so that sorting produces the expected results.
2012-01-30 17:35:19 -06:00
Robin Sommer
2df3738d1a Merge remote-tracking branch 'origin/topic/bernhard/log-threads' into topic/robin/log-threads 2012-01-30 13:22:17 -08:00
Robin Sommer
b6912f16aa Merge branch 'master' of ssh://git.bro-ids.org/bro into topic/robin/log-threads 2012-01-30 13:22:02 -08:00
Bernhard Amann
6cc29a7832 make logging with threads compile on mac os and fix a couple of string literal warnings. 2012-01-30 12:12:14 -08:00
Seth Hall
c03efbb570 Small updates for the bittorrent analyzer to support 64bit types in binpac.
- This branch removes the attempt at bittorrent resynchronization.
  I don't think that the bittorrent resynchronization would really
  work very well anyway.

- This need to be merged after the topic/seth/64bit-type branch in binpac.
2012-01-27 22:55:42 -05:00
Robin Sommer
e4e770d475 Threaded logging framework.
This is based on Gilbert's code but I ended up refactoring it quite a
bit. That's why I didn't do a direct merge but started with a new
branch and copied things over to adapt. It looks quite a bit different
now as I tried to generalize things a bit more to also support the
Input Framework.

The larger changes code are:

    - Moved all logging code into subdirectory src/logging/. Code
      here is in namespace "logging".

    - Moved all threading code into subdirectory src/threading/. Code
      here is in namespace "threading".

    - Introduced a central thread manager that tracks threads and is
      in charge of termination and (eventually) statistics.

    - Refactored logging independent threading code into base classes
      BasicThread and MsgThread. The former encapsulates all the
      pthread code with simple start/stop methods and provides a
      single Run() method to override.

      The latter is derived from BasicThread and adds bi-directional
      message passing between main and child threads. The hope is that
      the Input Framework can reuse this part quite directly.

    - A log writer is now split into a general WriterFrontend
      (LogEmissary in Gilbert's code) and a type-specific
      WriterBackend. Specific writers are implemented by deriving from
      the latter. (The plugin interface is almost unchanged compared
      to the 2.0 version.).

      Frontend and backend communicate via MsgThread's message
      passing.

    - MsgThread (and thus WriterBackend) has a Heartbeat() method that
      a thread can override to execute code on a regular basis. It's
      triggered roughly once a second by the main thread.

    - Integration into "the rest of Bro". Threads can send messages to
      the reporter and do debugging output; they are hooked into the
      I/O loop for sending messages back; and there's a new debugging
      stream "threading" that logs, well, threading activity.

This all seems to work for the most part, but it's not done yet.

TODO list:

    - Not all tests pass yet. In particular, diffs for the external
      tests seem to indicate some memory problem (no crashes, just an
      occasional weird character).

    - Only tested in --enable-debug mode.

    - Only tested on Linux.

    - Needs leak check.

    - Each log write is currently a single inter-thread message. Bring
      Gilbert's bulk writes back.

    - Code needs further cleanup.

    - Document the class API.

    - Document the internal structure of the logging framework.

    - Check for robustness: live traffic, aborting, signals, etc.

    - Add thread statistics to profile.log (most of the code is there).

    - Customize the OS-visible thread names on platforms that support it.
2012-01-27 17:16:14 -08:00
Robin Sommer
c607785cec Merge remote-tracking branch 'origin/topic/jsiwek/brofiler'
* origin/topic/jsiwek/brofiler:
  Fix mktemp portability issue affecting test coverage. (addresses #752)

Closes #752.
2012-01-27 10:43:43 -08:00
Jon Siwek
0065cf6148 Fix mktemp portability issue affecting test coverage. (addresses #752)
Also update Makefiles to behave better for brief targets and in absence
of external test repos.
2012-01-27 11:01:50 -06:00
Robin Sommer
f6f9dd952f Fixed for Brofiler merge. 2012-01-26 20:55:24 -08:00
Robin Sommer
60ae6f01d1 Updating submodule(s).
[nomail]
2012-01-25 18:03:40 -08:00
Robin Sommer
6a3b41b84d Bugfix caught by test-suite. 2012-01-25 17:45:26 -08:00
Robin Sommer
d6767e1d83 Disalbing brofiling because of problem.
See #756.
2012-01-25 17:36:13 -08:00
Robin Sommer
6a6092daf8 Adding coverage to brief make target as well. 2012-01-25 17:35:25 -08:00
Robin Sommer
1aefccd96d Updating submodule(s).
[nomail]
2012-01-25 17:15:06 -08:00
Robin Sommer
848ae2355e Merge remote-tracking branch 'origin/topic/jsiwek/brofiler'
* origin/topic/jsiwek/brofiler:
  Fix superfluous/duplicate data getting in to testing coverage log.
  Add "# @no-test" tag to blacklist statements from test coverage analysis.
  Test coverage integration for external tests and complete suite.
  Integrate Bro script coverage profiling with the btest suite.
  Add simple profiling class to accumulate Stmt usage stats across runs.

Renaming environment variable BROFILER_FILE to BRO_PROFILER_FILE for
consistency. Yeah, I know, such a nice name! :)
2012-01-25 17:12:37 -08:00
Robin Sommer
b649ade9ba Merge remote-tracking branch 'origin/topic/bif_cleanup'
* origin/topic/bif_cleanup:
  Give mode2string a more generic name.
  Change some BiF return values from bool to any.
  Perform type checking on count-to-port conversion.
  Remove redundant connection_record() BiF.
  Remove redundant active_connection() BiF.
  Make exit() parameterizable.
  to_port() now parses a string instead of a count.

Closes #684.
2012-01-25 16:48:00 -08:00
Robin Sommer
7a8c9b1c69 Merge remote-tracking branch 'origin/topic/jsiwek/local-table-init'
* origin/topic/jsiwek/local-table-init:
  Allow local table variables to be initialized with {} list expressions.

Closes #739.
2012-01-25 13:47:42 -08:00
Robin Sommer
27ce62077f Merge remote-tracking branch 'origin/topic/jsiwek/complex-record-indices'
* origin/topic/jsiwek/complex-record-indices:
  Teach CompHash to allow indexing by records with vector/table/set fields.

Closes #464
2012-01-25 13:38:36 -08:00
Robin Sommer
2a06617e71 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Fixed a bug resulting in over-logging of detected webapps.
2012-01-25 13:25:48 -08:00
Robin Sommer
2c439fd0a2 Fixing typo 2012-01-23 22:00:56 -08:00
Robin Sommer
08683175c1 Interface draft for new IP address wrapper class. 2012-01-22 21:41:42 -08:00
Jon Siwek
1e4c3d8ea2 Teach CompHash to allow indexing by records with vector/table/set fields.
Addresses #464.
2012-01-20 16:54:48 -06:00
Bernhard Amann
eacdffff90 Merge remote-tracking branch 'origin/master' into topic/bernhard/software
Conflicts:
	scripts/base/frameworks/software/main.bro
	scripts/policy/protocols/ftp/software.bro
2012-01-20 12:51:58 -08:00
Bernhard Amann
f24c50b49a remove unnecessary stuff from function. 2012-01-20 12:42:23 -08:00
Bernhard Amann
ac1708f843 fix handling of predicates - now the second argument that is sent to the predicate really is a recordVal and not a ListVal. 2012-01-20 12:33:48 -08:00
Bernhard Amann
92050af947 Merge remote-tracking branch 'origin/master' into topic/bernhard/input 2012-01-20 12:03:54 -08:00
Seth Hall
5b04789ab8 Fixed a bug resulting in over-logging of detected webapps. 2012-01-20 11:22:15 -05:00
Robin Sommer
8eeb37129a Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  Make communication log baseline test more reliable.
  fixed some broken links
2012-01-18 20:09:54 -08:00
Matthias Vallentin
6c255d13ff Merge remote-tracking branch 'origin/master' into topic/bif_cleanup
Conflicts:
	src/bro.bif
2012-01-18 14:56:53 -08:00
Jon Siwek
0287f7adc2 Fix superfluous/duplicate data getting in to testing coverage log. 2012-01-18 11:45:53 -06:00
Jon Siwek
ec6560a6ed Make communication log baseline test more reliable. 2012-01-13 16:06:44 -06:00
Jon Siwek
713e3ac5d0 Add "# @no-test" tag to blacklist statements from test coverage analysis.
It can apply to either single statements:

    print "don't cover"; # @no-test

or a block of statements:

    if ( F )
        { # @no-test
        ...
        }
2012-01-13 14:52:58 -06:00
Bernhard Amann
eb53a3d1c8 make input framework compile with brov6 2012-01-12 11:51:12 -08:00
Bernhard Amann
d476e9f3f4 Merge remote-tracking branch 'origin/master' into topic/bernhard/input 2012-01-12 11:07:12 -08:00
Jon Siwek
b6c3567ba4 Test coverage integration for external tests and complete suite.
coverage.log files are output to each testing dir and reflect
the number of times statement locations of Bro scripts are executed.
2012-01-12 11:58:13 -06:00
Jon Siwek
aff631b5e0 Merge branch 'master' into topic/jsiwek/brofiler 2012-01-12 10:43:11 -06:00
Daniel Thayer
9c42f02082 fixed some broken links 2012-01-11 16:57:09 -06:00
Jon Siwek
9aefeec4ce Integrate Bro script coverage profiling with the btest suite. 2012-01-11 16:30:25 -06:00
Robin Sommer
5ae95bfc49 Merge remote-tracking branch 'origin/fastpath'
* origin/fastpath:
  corrected some minor typos
2012-01-11 13:52:38 -08:00
Robin Sommer
6a2af5cd63 Updating submodule(s).
[nomail]
2012-01-11 12:25:07 -08:00
Robin Sommer
b6ea4c6026 Fixing links. 2012-01-11 12:21:49 -08:00
Daniel Thayer
d9dccd9e65 corrected some minor typos 2012-01-11 13:02:12 -06:00
Jon Siwek
1181444f37 Merge branch 'master' into topic/jsiwek/brofiler
Conflicts:
	src/main.cc
2012-01-11 10:57:44 -06:00
Robin Sommer
eac4690f83 Updating submodule(s).
[nomail]
2012-01-10 19:38:55 -08:00
Robin Sommer
4dd898131e Slight reordering on main doc page. 2012-01-10 19:17:22 -08:00
Robin Sommer
71eaae8539 Fixing typos 2012-01-10 19:09:30 -08:00
Robin Sommer
8b06fdfc67 Updating CHANGES and VERSION. 2012-01-10 17:51:34 -08:00
Robin Sommer
a7a33ab146 Updating submodule. 2012-01-10 17:40:18 -08:00
Robin Sommer
981c0ebf40 Couple submodule notes for NEWS. 2012-01-10 17:37:49 -08:00
Robin Sommer
46de660909 Updating submodules. 2012-01-10 17:27:22 -08:00