From: Philippe Proulx Date: Fri, 17 Feb 2017 09:14:40 +0000 (-0500) Subject: Filtering: add support for star-only globbing patterns X-Git-Tag: v2.10.0-rc1~16 X-Git-Url: http://git.lttng.org./?a=commitdiff_plain;h=3151a51df2b93554f3e4559a2e7ec08541e8674d;hp=3151a51df2b93554f3e4559a2e7ec08541e8674d;p=lttng-ust.git Filtering: add support for star-only globbing patterns This patch adds the support for "full" star-only globbing patterns to be used in filter literal strings. A star-only globbing pattern is a globbing pattern with the star (`*`) being the only special character. This means `?` and character sets (`[abc-k]`) are not supported here. We cannot support them without a strategy to differentiate the globbing pattern because `?` and `[` are not special characters in filter literal strings right now. The eventual strategy to support them would probably look like this: filename =* "?sys*.[ch]" The filter bytecode generator in LTTng-tools's session daemon creates the new FILTER_OP_LOAD_STAR_GLOB_STRING operation when the interpreter should load a star globbing pattern literal string. Even if both "plain", or legacy strings and star globbing pattern strings are literal strings, they do not represent the same thing, that is, the == and != operators act differently. The validation process checks that: 1. There's no binary operator between two FILTER_OP_LOAD_STAR_GLOB_STRING operations. It is illegal to compare two star globbing patterns, as this is not trivial to implement, and completely useless as far as I know. 2. Only the == and != binary operators are allowed between a star globbing pattern and a string. For the special case of star globbing patterns with a star at the end only, the current behaviour is not changed to preserve a maximum of backward compatibility. This is also why the UST ABI version is changed from 7.1 to 7.2, not to 8.0. == or != operations between REG_STRING and REG_STAR_GLOB_STRING registers is specialized to FILTER_OP_EQ_STAR_GLOB_STRING and FILTER_OP_NE_STAR_GLOB_STRING. Which side is the actual globbing pattern (the one with the REG_STAR_GLOB_STRING type) is checked at execution time. The strutils_star_glob_match() function is used to perform the match operation. See the implementation for more details. Signed-off-by: Philippe Proulx Signed-off-by: Mathieu Desnoyers ---