From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751424AbdBUIP7 (ORCPT ); Tue, 21 Feb 2017 03:15:59 -0500 Received: from terminus.zytor.com ([65.50.211.136]:56272 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750951AbdBUIPt (ORCPT ); Tue, 21 Feb 2017 03:15:49 -0500 Date: Tue, 21 Feb 2017 00:15:19 -0800 From: tip-bot for Jiri Olsa Message-ID: Cc: jolsa@redhat.com, bp@alien8.de, namhyung@kernel.org, jolsa@kernel.org, dsahern@gmail.com, acme@redhat.com, linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de, a.p.zijlstra@chello.nl Reply-To: mingo@kernel.org, a.p.zijlstra@chello.nl, tglx@linutronix.de, hpa@zytor.com, acme@redhat.com, linux-kernel@vger.kernel.org, dsahern@gmail.com, jolsa@kernel.org, namhyung@kernel.org, bp@alien8.de, jolsa@redhat.com In-Reply-To: <20170217170018.GA15389@krava> References: <20170217170018.GA15389@krava> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/urgent] perf record: Add -a as default target Git-Commit-ID: 483635a9d0802d5ffbe402ceac5b93ddb2acb138 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: 483635a9d0802d5ffbe402ceac5b93ddb2acb138 Gitweb: http://git.kernel.org/tip/483635a9d0802d5ffbe402ceac5b93ddb2acb138 Author: Jiri Olsa AuthorDate: Fri, 17 Feb 2017 18:00:18 +0100 Committer: Arnaldo Carvalho de Melo CommitDate: Fri, 17 Feb 2017 17:32:38 -0300 perf record: Add -a as default target Running 'perf record' with no target (-a, -p, -t, etc) will now collect system wide data. Commiter notes: Testing it: [root@jouet ~]# perf record ^C[ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 1.351 MB perf.data (366 samples) ] # is equivalent to: # perf record -a ^C[ perf record: Woken up 1 times to write data ] [ perf record: Captured and wrote 1.411 MB perf.data (978 samples) ] # Signed-off-by: Jiri Olsa Tested-by: Arnaldo Carvalho de Melo Cc: Borislav Petkov Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20170217170018.GA15389@krava Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/Documentation/perf-record.txt | 2 +- tools/perf/builtin-record.c | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/tools/perf/Documentation/perf-record.txt b/tools/perf/Documentation/perf-record.txt index 27256bc..b16003e 100644 --- a/tools/perf/Documentation/perf-record.txt +++ b/tools/perf/Documentation/perf-record.txt @@ -157,7 +157,7 @@ OPTIONS -a:: --all-cpus:: - System-wide collection from all CPUs. + System-wide collection from all CPUs (default if no target is specified). -p:: --pid=:: diff --git a/tools/perf/builtin-record.c b/tools/perf/builtin-record.c index 6cd6776..b87bbef 100644 --- a/tools/perf/builtin-record.c +++ b/tools/perf/builtin-record.c @@ -1677,8 +1677,10 @@ int cmd_record(int argc, const char **argv, const char *prefix __maybe_unused) argc = parse_options(argc, argv, record_options, record_usage, PARSE_OPT_STOP_AT_NON_OPTION); + + /* Make system wide (-a) the default target. */ if (!argc && target__none(&rec->opts.target)) - usage_with_options(record_usage, record_options); + rec->opts.target.system_wide = true; if (nr_cgroups && !rec->opts.target.system_wide) { usage_with_options_msg(record_usage, record_options,