From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@redhat.com>,
Namhyung Kim <namhyung@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 15/21] perf probe: Accept multiple filter options
Date: Mon, 4 May 2015 18:36:24 -0300 [thread overview]
Message-ID: <1430775390-22523-16-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1430775390-22523-1-git-send-email-acme@kernel.org>
From: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Accept multiple filter options. Each filters are combined by logical-or.
E.g. --filter abc* --filter *def is same as --filter abc*|*def
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/20150424094748.23967.63355.stgit@localhost.localdomain
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-probe.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/tools/perf/builtin-probe.c b/tools/perf/builtin-probe.c
index 92dcce0..be17075 100644
--- a/tools/perf/builtin-probe.c
+++ b/tools/perf/builtin-probe.c
@@ -262,21 +262,25 @@ static int opt_set_filter(const struct option *opt __maybe_unused,
const char *str, int unset __maybe_unused)
{
const char *err;
+ int ret = 0;
if (str) {
pr_debug2("Set filter: %s\n", str);
- if (params.filter)
- strfilter__delete(params.filter);
- params.filter = strfilter__new(str, &err);
if (!params.filter) {
+ params.filter = strfilter__new(str, &err);
+ if (!params.filter)
+ ret = err ? -EINVAL : -ENOMEM;
+ } else
+ ret = strfilter__or(params.filter, str, &err);
+
+ if (ret == -EINVAL) {
pr_err("Filter parse error at %td.\n", err - str + 1);
pr_err("Source: \"%s\"\n", str);
pr_err(" %*c\n", (int)(err - str + 1), '^');
- return -EINVAL;
}
}
- return 0;
+ return ret;
}
static int init_params(void)
--
2.1.0
next prev parent reply other threads:[~2015-05-04 21:38 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-04 21:36 [GIT PULL 00/21] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 01/21] perf probe ppc: Fix symbol fixup issues due to ELF type Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 02/21] perf probe ppc: Use the right prefix when ignoring SyS symbols on ppc Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 03/21] perf probe ppc: Enable matching against dot symbols automatically Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 04/21] perf probe ppc64le: Fix ppc64 ABIv2 symbol decoding Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 05/21] perf probe ppc64le: Prefer symbol table lookup over DWARF Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 06/21] perf probe ppc64le: Fixup function entry if using kallsyms lookup Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 07/21] perf evlist: Amend mmap ref counting for the AUX area mmap Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 08/21] perf script: Always allow fields 'addr' and 'cpu' for auxtrace Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 09/21] perf report: Add Instruction Tracing support Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 10/21] perf symbols: Warn on build id mismatch Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 11/21] perf tools: Fix bison-related build failure on CentOS 6 Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 12/21] perf probe: Improve detection of file/function name in the probe pattern Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 13/21] perf tools: Improve strfilter to append additional rules Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 14/21] perf tools: Add strfilter__string to recover rules string Arnaldo Carvalho de Melo
2015-05-04 21:36 ` Arnaldo Carvalho de Melo [this message]
2015-05-04 21:36 ` [PATCH 16/21] perf probe: Accept filter argument for --list Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 17/21] perf kmem: Implement stat --page --caller Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 18/21] perf kmem: Support sort keys on page analysis Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 19/21] perf kmem: Add --live option for current allocation stat Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 20/21] perf kmem: Print gfp flags in human readable string Arnaldo Carvalho de Melo
2015-05-04 21:36 ` [PATCH 21/21] perf kmem: Add kmem.default config option Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1430775390-22523-16-git-send-email-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=dsahern@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).