From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755858AbcAIQXo (ORCPT ); Sat, 9 Jan 2016 11:23:44 -0500 Received: from terminus.zytor.com ([198.137.202.10]:41609 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755796AbcAIQXm (ORCPT ); Sat, 9 Jan 2016 11:23:42 -0500 Date: Sat, 9 Jan 2016 08:23:05 -0800 From: tip-bot for Namhyung Kim Message-ID: Cc: mingo@kernel.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, tglx@linutronix.de, hpa@zytor.com, namhyung@kernel.org, acme@redhat.com, rostedt@goodmis.org, peterz@infradead.org, jolsa@kernel.org, andi@firstfloor.org, dsahern@gmail.com, wangnan0@huawei.com Reply-To: dsahern@gmail.com, wangnan0@huawei.com, peterz@infradead.org, jolsa@kernel.org, andi@firstfloor.org, namhyung@kernel.org, acme@redhat.com, rostedt@goodmis.org, mingo@kernel.org, linux-kernel@vger.kernel.org, fweisbec@gmail.com, hpa@zytor.com, tglx@linutronix.de In-Reply-To: <1450804030-29193-5-git-send-email-namhyung@kernel.org> References: <1450804030-29193-5-git-send-email-namhyung@kernel.org> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf top: Create the evlist sooner Git-Commit-ID: 54f8f40384ab940e15585afde5c278c8e7726214 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 54f8f40384ab940e15585afde5c278c8e7726214 Gitweb: http://git.kernel.org/tip/54f8f40384ab940e15585afde5c278c8e7726214 Author: Namhyung Kim AuthorDate: Wed, 23 Dec 2015 02:07:01 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Wed, 6 Jan 2016 20:11:11 -0300 perf top: Create the evlist sooner This is a preparation to support dynamic sort keys for tracepoint events. Dynamic sort keys can be created for specific fields in trace events so it needs the event information, so we need to pass the evlist to the sort routines, create it sooner so that the next patch can do that. Signed-off-by: Namhyung Kim Acked-by: Jiri Olsa Cc: Andi Kleen Cc: David Ahern Cc: Frederic Weisbecker Cc: Peter Zijlstra Cc: Steven Rostedt Cc: Wang Nan Link: http://lkml.kernel.org/r/1450804030-29193-5-git-send-email-namhyung@kernel.org [ Split from the patch passing the evlist to the sort routines ] Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/builtin-top.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tools/perf/builtin-top.c b/tools/perf/builtin-top.c index 9ebd67a..4e913d8 100644 --- a/tools/perf/builtin-top.c +++ b/tools/perf/builtin-top.c @@ -1231,6 +1231,12 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) if (argc) usage_with_options(top_usage, options); + if (!top.evlist->nr_entries && + perf_evlist__add_default(top.evlist) < 0) { + pr_err("Not enough memory for event selector list\n"); + goto out_delete_evlist; + } + sort__mode = SORT_MODE__TOP; /* display thread wants entries to be collapsed in a different tree */ sort__need_collapse = 1; @@ -1277,12 +1283,6 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused) goto out_delete_evlist; } - if (!top.evlist->nr_entries && - perf_evlist__add_default(top.evlist) < 0) { - ui__error("Not enough memory for event selector list\n"); - goto out_delete_evlist; - } - symbol_conf.nr_events = top.evlist->nr_entries; if (top.delay_secs < 1)