[PATCH v10 00/16] New filtering architecture

Nikolay Marchuk marchuk.nikolay.a at gmail.com
Mon Aug 28 08:54:37 UTC 2017


These patches implement new filtering architecture. Currently supported actions:
trace, inject, fault, read, write, raw, abbrev, verbose. Currently supported
filters: syscall, fd, path.
Changes in filtering language:
* Delimiter of action arguments is now ';'.
* Supported logical operators: and, or, not. Also C-like forms of these
  operators are supported: &&, ||, !.
* Syscall filter accepts syscalls' set, class or regex with old set description
  syntax.

Changes since v1:
* qualify.c is now splitted in separate commit.

Changes since v2:
* Fixed segmentation fault in inject/fault parsing.
* basic_filters.c (run_fd_filter): Changed returns to true/false.

Changes since v3:
* Fixed invalid accounting of syscalls for inject/fault actions.
* Fixed order of filter actions with same priority.
* Refactored inject arguments parsing.
* Refactored fd filtering.
* Refactored tests for syscall set syntax.
* Improved diagnostics of filtering errors.
* Rewritten algorithms of parsing for new filtering language.

Changes since v4:
* Fixes in fd and path filtering.
* Added tests for fd filtering.
* Syscall tests refactoring is now in a separate commit.
* Style and readability fixes.

Known issues in v4:
* Fd filter returns valid results only if negative fds are not filtered.

Changes since v5:
* Refactored parsing.
* Fixes in fd and path filtering.
* Improved diagnostics.
* Added stacktrace action.
* Style fixes.

Changes since v6:
* Refactored fd and path filtering.
* Fixed memory leaks in parser.
* Fixed some corner cases of parsing.
* Disabled set inversions in new syntax.
* Improved tests.

Changes since v7:
* Improved test coverage.
* Added documentation.
* Implemented global path filtering as injected filter.

Changes since v8:
* Rebase onto master(use number_set interface).
* Reordered commits.
* Split "Introduce new filtering architecture".(But it's still too big)
* Removed unnecessary renames.

Known issues in v9:
* "Introduce new filtering architecture" fails qual_fault-syntax and
qual_inject-syntax. Fixed in next commit.

Changes since v9:
* Split "Introduce new filtering architecture" into minimal logical parts.
* Reordered commits.
* Moved DECL_* declarations to filter.h.

Known issues in v10:
* "Introduce new filtering architecture" fails qual_fault-syntax and
qual_inject-syntax. Fixed in next commit.

Nikolay Marchuk (16):
  Introduce new filtering architecture
  Implement inject and fault actions.
  tests: improve syscall set syntax testing
  Implement fd filter and read/write actions
  Implement path filter
  Improve fd filtering
  Optimize default filtering
  Implement new filtering language parsing
  Add stacktrace filter action
  tests: check error handling of syscall filter
  tests: check expression parsing
  tests: check new syntax of inject/fault actions
  tests: check fd filter
  tests: check path filter
  Add description of new filtering syntax
  Update NEWS

 Makefile.am                            |   5 +
 NEWS                                   |   3 +
 basic_actions.c                        | 130 +++++++++
 basic_filters.c                        | 160 +++++++++--
 defs.h                                 |  18 +-
 filter.c                               | 130 +++++++++
 filter.h                               |  86 +++++-
 filter_action.c                        | 240 +++++++++++++++++
 filter_expression.c                    | 469 +++++++++++++++++++++++++++++++++
 filter_parse.c                         | 252 ++++++++++++++++++
 filter_qualify.c                       | 258 ++++++++----------
 number_set.h                           |   2 -
 pathtrace.c                            | 197 ++++++++------
 strace.1.in                            | 272 ++++++++++++++++++-
 strace.c                               |  16 +-
 syscall.c                              |  26 +-
 tests/.gitignore                       |   2 +
 tests/Makefile.am                      |  11 +
 tests/filtering_action-syntax.test     |  95 +++++++
 tests/filtering_expression-empty.test  |  47 ++++
 tests/filtering_expression-syntax.test |  77 ++++++
 tests/filtering_fd-syntax.test         |  76 ++++++
 tests/filtering_fd.c                   | 204 ++++++++++++++
 tests/filtering_fd.test                |  17 ++
 tests/filtering_path.c                 | 285 ++++++++++++++++++++
 tests/filtering_path.test              |  18 ++
 tests/filtering_syscall-syntax.test    | 130 +++++++++
 tests/mmap.test                        |  18 +-
 tests/mmap_name.sh                     |  51 ++++
 tests/options-syntax.test              |  28 --
 tests/qual_fault-exit_group.test       |  11 +
 tests/qual_fault-syntax.test           | 107 +++-----
 tests/qual_fault.test                  |  49 +++-
 tests/qual_inject-error-signal.test    |   5 +
 tests/qual_inject-retval.test          |   5 +
 tests/qual_inject-signal.test          |   5 +
 tests/qual_inject-syntax.test          | 125 +++------
 tests/tampering-syntax.sh              |  64 +++++
 unwind.c                               |   6 +
 39 files changed, 3213 insertions(+), 487 deletions(-)
 create mode 100644 basic_actions.c
 create mode 100644 filter.c
 create mode 100644 filter_action.c
 create mode 100644 filter_expression.c
 create mode 100644 filter_parse.c
 create mode 100755 tests/filtering_action-syntax.test
 create mode 100755 tests/filtering_expression-empty.test
 create mode 100755 tests/filtering_expression-syntax.test
 create mode 100755 tests/filtering_fd-syntax.test
 create mode 100644 tests/filtering_fd.c
 create mode 100755 tests/filtering_fd.test
 create mode 100644 tests/filtering_path.c
 create mode 100755 tests/filtering_path.test
 create mode 100755 tests/filtering_syscall-syntax.test
 create mode 100644 tests/mmap_name.sh
 create mode 100644 tests/tampering-syntax.sh

-- 
2.11.0





More information about the Strace-devel mailing list