aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util/strfilter.h
diff options
context:
space:
mode:
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>2015-04-24 18:47:44 +0900
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-05-04 12:43:53 -0300
commit4e60a2caefd1920867a84b978abc1eac118de596 (patch)
tree9109b759706537d90a8e9f14192f3d1fc8af1540 /tools/perf/util/strfilter.h
parentperf probe: Improve detection of file/function name in the probe pattern (diff)
downloadlinux-dev-4e60a2caefd1920867a84b978abc1eac118de596.tar.xz
linux-dev-4e60a2caefd1920867a84b978abc1eac118de596.zip
perf tools: Improve strfilter to append additional rules
Add strfilter__or/and to append additional rules to existing strfilter. Signed-off-by: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20150424094744.23967.97614.stgit@localhost.localdomain Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/strfilter.h')
-rw-r--r--tools/perf/util/strfilter.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/tools/perf/util/strfilter.h b/tools/perf/util/strfilter.h
index fe611f3c9e39..d007cdc2c68b 100644
--- a/tools/perf/util/strfilter.h
+++ b/tools/perf/util/strfilter.h
@@ -29,6 +29,32 @@ struct strfilter {
struct strfilter *strfilter__new(const char *rules, const char **err);
/**
+ * strfilter__or - Append an additional rule by logical-or
+ * @filter: Original string filter
+ * @rules: Filter rule to be appended at left of the root of
+ * @filter by using logical-or.
+ * @err: Pointer which points an error detected on @rules
+ *
+ * Parse @rules and join it to the @filter by using logical-or.
+ * Return 0 if success, or return the error code.
+ */
+int strfilter__or(struct strfilter *filter,
+ const char *rules, const char **err);
+
+/**
+ * strfilter__add - Append an additional rule by logical-and
+ * @filter: Original string filter
+ * @rules: Filter rule to be appended at left of the root of
+ * @filter by using logical-and.
+ * @err: Pointer which points an error detected on @rules
+ *
+ * Parse @rules and join it to the @filter by using logical-and.
+ * Return 0 if success, or return the error code.
+ */
+int strfilter__and(struct strfilter *filter,
+ const char *rules, const char **err);
+
+/**
* strfilter__compare - compare given string and a string filter
* @filter: String filter
* @str: target string