[PATCH v7 8/8] Add stacktrace filter action

2017-08-11 Thread Nikolay Marchuk
* defs.h (QUAL_STACKTRACE): Add new qual flag. (stacktrace): Add macro for checking QUAL_STACKTRACE. (stack_trace_enabled): Change description. * filter_action.c (action_types): Declare and add new filter action type. (update_default_flags): Update stack_trace_enabled. * strace.c

[PATCH v7 2/8] Introduce new filtering architecture

2017-08-11 Thread Nikolay Marchuk
This change introduces new filtering architecture primitives: filter, filter_action and bool_expression. Filtering is now done after decoding of syscall and tcp->qual_flg stores filtering results. * basic_actions.c: New file. * basic_filters.c (number_isset): Return bool. (add_number_to_set):

[PATCH v7 5/8] Implement new filtering language parsing

2017-08-11 Thread Nikolay Marchuk
* basic_filters.c (parse_set, parse_syscall_set): Use set inversion only in qualify mode. * filter.h (parse_filter_action, parse_qualify_action, parse_filter_expression): Add new declarations. * filter_action.c (parse_filter_action): Add new parsing function. (filtering_parse_finish): Use

[PATCH v7 7/8] tests: check fd filter

2017-08-11 Thread Nikolay Marchuk
* tests/filtering_fd-syntax.test: New file. * tests/filtering_fd.c: Likewise. * tests/filtering_fd.test: Likewise. * tests/options-syntax.test: Remove fd filtering checks. * tests/.gitignore: Add filtering_fd. * tests/Makefile.am (check_PROGRAMS): Add filtering_fd. (MISC_TESTS): Add

[PATCH v7 4/8] Optimize default filtering

2017-08-11 Thread Nikolay Marchuk
* filter_action.c (default_flags): Add default flags variable. (add_action): Update default flags. (filter_syscall): Add default_flags to qual_flg. (filtering_parse_finish): Init trace action for pathtracing. * strace.c (init): Remove default filters. --- filter_action.c | 10 ++ strace.c

[PATCH v7 6/8] Add path filter

2017-08-11 Thread Nikolay Marchuk
* basic_filters.c: Add path filter functions. * filter.c (filter_types): Add path filter entries. * pathtrace.c (storepath): Duplicate path. --- basic_filters.c | 30 ++ filter.c| 2 ++ pathtrace.c | 2 +- 3 files changed, 33 insertions(+), 1 deletion(-)

[PATCH v7 1/8] tests: improve syscall syntax testing

2017-08-11 Thread Nikolay Marchuk
* tests/filtering_syscall-syntax.test: New file. * tests/syntax.sh: New file. * tests/options-syntax.test: Move syscall syntax testing to filtering_syscall-syntax.test. Move check_* functions to syntax.sh. * tests/Makefile.am (MISC_TESTS): Add filtering_syscall-syntax.test. (EXTRA_DIST): Add

[PATCH v7 3/8] Improve fd filtering

2017-08-11 Thread Nikolay Marchuk
* pathtrace.c (match_fd_common, pathtrace_match_set): Move fd matching to separate function. * filter.h (match_fd_common): Add new declaration. * basic_filters.c (run_fd_filter): Use match_fd_common for fd filter. --- basic_filters.c | 27 ++-- filter.h| 2 + pathtrace.c | 197

[PATCH v7 0/8] New filtering architecture

2017-08-11 Thread Nikolay Marchuk
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,

Re: [PATCH 02/26] netlink: add a basic rtnetlink parser of addr messages

2017-08-11 Thread Dmitry V. Levin
On Thu, Aug 10, 2017 at 09:04:52AM +0800, JingPiao Chen wrote: > * rtnl_addr.c: New file. > * Makefile.am (strace_SOURCES): Add it. > * configure.ac (AC_CHECK_HEADERS): Add linux/if_addr.h. > * netlink_route.h (decode_ifaddrmsg): New prototype. > * netlink_route.c (route_decoders): Add

Re: [PATCH 08/26] netlink: add a basic rtnetlink parser of neigh messages

2017-08-11 Thread Dmitry V. Levin
On Thu, Aug 10, 2017 at 09:07:06AM +0800, JingPiao Chen wrote: > * rtnl_neigh.c: New file. > * Makefile.am (strace_SOURCES): Add it. > * netlink_route.h (decode_ndmsg, decode_rtm_getneigh): New prototypes. > * configure.ac (AC_CHECK_HEADERS): Add linux/neighbour.h. > * netlink_route.c

Re: [PATCH 09/26] tests: check decoding of rtnetlink neigh messages

2017-08-11 Thread Dmitry V. Levin
On Thu, Aug 10, 2017 at 09:07:07AM +0800, JingPiao Chen wrote: > * tests/netlink_route.c (test_rtnl_neigh): New function. > (main): Use it. > > Co-authored-by: Fabien Siron > --- > tests/netlink_route.c | 21 + > 1 file changed, 21 insertions(+) > >

Re: [PATCH 00/26] Implemented basic protocol specific decoding of NETLINK_ROUTE

2017-08-11 Thread Dmitry V. Levin
On Thu, Aug 10, 2017 at 09:03:22AM +0800, JingPiao Chen wrote: > Note: > > rule: > Before v2.6.18-284-g14c0b97, rule carry struct rtmsg, > now carry struct fib_rule_hdr. > > $ man 7 rtnetlink # or read the old kernel > RTM_NEWRULE, RTM_DELRULE, RTM_GETRULE > Add, delete or retrieve a

Re: [PATCH 04/26] netlink: add a basic rtnetlink parser of route messages

2017-08-11 Thread Dmitry V. Levin
On Thu, Aug 10, 2017 at 09:04:54AM +0800, JingPiao Chen wrote: > * netlink_route.c: New file. > * Makefile.am (strace_SOURCES): Add it > * netlink_route.h (decode_rtmsg): New prototype. > * netlink_route.c (route_decoders): Add RTM_DELROUTE, > RTM_GETROUTE, and RTM_NEWROUTE. > *