Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1570623

[PATCH v2 4/4] perf tools: Increase index if perf_evsel__new_idx() succeeded

From Taeung Song <treeze.taeung@gmail.com>
Newsgroups linux.kernel
Subject [PATCH v2 4/4] perf tools: Increase index if perf_evsel__new_idx() succeeded
Date 2017-01-31 12:40 +0100
Message-ID <t5EX0-8E-15@gated-at.bofh.it> (permalink)
References <t5EX0-8E-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Taeung Song <treeze.taeung@gmail.com>
---
 tools/perf/util/parse-events.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index 87a3e5a..ac47c12 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -311,10 +311,11 @@ __add_event(struct list_head *list, int *idx,
 
 	event_attr_init(attr);
 
-	evsel = perf_evsel__new_idx(attr, (*idx)++);
+	evsel = perf_evsel__new_idx(attr, *idx);
 	if (!evsel)
 		return NULL;
 
+	(*idx)++;
 	evsel->cpus     = cpu_map__get(cpus);
 	evsel->own_cpus = cpu_map__get(cpus);
 
-- 
2.7.4

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH v2 4/4] perf tools: Increase index if perf_evsel__new_idx() succeeded Taeung Song <treeze.taeung@gmail.com> - 2017-01-31 12:40 +0100
  Re: [PATCH v2 4/4] perf tools: Increase index if  perf_evsel__new_idx() succeeded Arnaldo Carvalho de Melo <acme@kernel.org> - 2017-01-31 14:30 +0100
    Re: [PATCH v2 4/4] perf tools: Increase index if  perf_evsel__new_idx() succeeded Taeung Song <treeze.taeung@gmail.com> - 2017-02-01 09:10 +0100

csiph-web