From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934357AbdBQRAZ (ORCPT ); Fri, 17 Feb 2017 12:00:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:51290 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933900AbdBQRAY (ORCPT ); Fri, 17 Feb 2017 12:00:24 -0500 Date: Fri, 17 Feb 2017 18:00:18 +0100 From: Jiri Olsa To: Arnaldo Carvalho de Melo Cc: Jiri Olsa , David Ahern , Namhyung Kim , Peter Zijlstra , lkml , Ingo Molnar Subject: Re: [PATCH 5/5] perf record: Add -a as a default target Message-ID: <20170217170018.GA15389@krava> References: <1487340058-10496-1-git-send-email-jolsa@kernel.org> <1487340058-10496-6-git-send-email-jolsa@kernel.org> <20170217142814.GE4109@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170217142814.GE4109@kernel.org> User-Agent: Mutt/1.7.1 (2016-10-04) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Fri, 17 Feb 2017 17:00:24 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 17, 2017 at 11:28:14AM -0300, Arnaldo Carvalho de Melo wrote: > Em Fri, Feb 17, 2017 at 03:00:58PM +0100, Jiri Olsa escreveu: > > Adding system wide (-a) option as a default target > > if non is specified. > > > > # perf record > > Warning: No target specified, setting system-wide collection (-a). > > Ditto, this warning will get annoying after a while... ok, posting the change with no warning jirka --- Adding system wide (-a) option as a default target if non is specified. Running 'perf record' will now collect system wide data. Signed-off-by: Jiri Olsa Cc: David Ahern Cc: Namhyung Kim Cc: Peter Zijlstra Link: http://lkml.kernel.org/n/tip-tq11of2qlz8kxpxzva05d54l@git.kernel.org --- 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 27256bc68eda..b16003ec14a7 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 6cd6776052e7..b87bbef73394 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, -- 2.7.4