Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1216468
| From | Arnaldo Carvalho de Melo <acme@kernel.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 3/6] perf evlist: Open event on evsel cpus and threads |
| Date | 2015-08-31 23:40 +0200 |
| Message-ID | <q3EY3-36r-33@gated-at.bofh.it> (permalink) |
| References | <q3EY2-36r-5@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
From: Kan Liang <kan.liang@intel.com>
An evsel may have different cpus and threads than the evlist it is in.
Use it's own cpus and threads, when opening the evsel in 'perf record'.
Signed-off-by: Kan Liang <kan.liang@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Link: http://lkml.kernel.org/r/1440138194-17001-1-git-send-email-kan.liang@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-record.c | 2 +-
tools/perf/util/evlist.c | 4 ++++
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c
index a660022f2c92..1d14f382f614 100644
--- a/tools/perf/builtin-record.c
+++ b/tools/perf/builtin-record.c
@@ -279,7 +279,7 @@ static int record__open(struct record *rec)
evlist__for_each(evlist, pos) {
try_again:
- if (perf_evsel__open(pos, evlist->cpus, evlist->threads) < 0) {
+ if (perf_evsel__open(pos, pos->cpus, pos->threads) < 0) {
if (perf_evsel__fallback(pos, errno, msg, sizeof(msg))) {
if (verbose)
ui__warning("%s\n", msg);
diff --git a/tools/perf/util/evlist.c b/tools/perf/util/evlist.c
index 8d00039d6a20..d51a5200c8af 100644
--- a/tools/perf/util/evlist.c
+++ b/tools/perf/util/evlist.c
@@ -1181,6 +1181,10 @@ int perf_evlist__apply_filters(struct perf_evlist *evlist, struct perf_evsel **e
if (evsel->filter == NULL)
continue;
+ /*
+ * filters only work for tracepoint event, which doesn't have cpu limit.
+ * So evlist and evsel should always be same.
+ */
err = perf_evsel__apply_filter(evsel, ncpus, nthreads, evsel->filter);
if (err) {
*err_evsel = evsel;
--
2.1.0
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[GIT PULL 0/6] perf/core improvements and fixes Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-31 23:40 +0200 [PATCH 4/6] perf script: Enable printing of interrupted machine state Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-31 23:40 +0200 [PATCH 3/6] perf evlist: Open event on evsel cpus and threads Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-31 23:40 +0200 [PATCH 5/6] perf/x86: Add list of register names Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-31 23:40 +0200 [PATCH 2/6] bpf tools: New API to get name from a BPF object Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-31 23:40 +0200 [PATCH 6/6] perf record: Add ability to name registers to record Arnaldo Carvalho de Melo <acme@kernel.org> - 2015-08-31 23:50 +0200 Re: [GIT PULL 0/6] perf/core improvements and fixes Ingo Molnar <mingo@kernel.org> - 2015-09-01 10:30 +0200
csiph-web