From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752334AbbIRUmc (ORCPT ); Fri, 18 Sep 2015 16:42:32 -0400 Received: from mail-pa0-f47.google.com ([209.85.220.47]:35965 "EHLO mail-pa0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751310AbbIRUma (ORCPT ); Fri, 18 Sep 2015 16:42:30 -0400 From: Mathieu Poirier To: a.p.zijlstra@chello.nl, mingo@redhat.com, acme@kernel.org Cc: linux-kernel@vger.kernel.org, alexander.shishkin@linux.intel.com, mathieu.poirier@linaro.org Subject: [PATCH] perf record: adding dummy event before mapping Date: Fri, 18 Sep 2015 14:42:04 -0600 Message-Id: <1442608924-28139-1-git-send-email-mathieu.poirier@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The parameters of function 'perf_evsel__open()' in 'record_open()' have been changed to use the evsel's cpus and threads rather than the evlist since: commit d988d5ee6478 ("perf evlist: Open event on evsel cpus and threads") This works fine for as long as all the events have been added to the evlist before function 'perf_evlist__create_maps()' is called since the latter will take care of pushing the cpus and threads of the evlist to each of the evsel in the list. As function 'auxtrace_record__options()' adds a "dummy:u" event to the evlist it is important that it runs before 'perf_evlist__create_maps()'. Signed-off-by: Mathieu Poirier --- tools/perf/builtin-record.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 142eeb341b29..630a7a8e3970 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -1183,14 +1183,14 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused) goto out_symbol_exit; } - err = -ENOMEM; - if (perf_evlist__create_maps(rec->evlist, &rec->opts.target) < 0) - usage_with_options(record_usage, record_options); - err = auxtrace_record__options(rec->itr, rec->evlist, &rec->opts); if (err) goto out_symbol_exit; + err = -ENOMEM; + if (perf_evlist__create_maps(rec->evlist, &rec->opts.target) < 0) + usage_with_options(record_usage, record_options); + if (record_opts__config(&rec->opts)) { err = -EINVAL; goto out_symbol_exit; -- 1.9.1