From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755212Ab3I1U2O (ORCPT ); Sat, 28 Sep 2013 16:28:14 -0400 Received: from mail-pb0-f50.google.com ([209.85.160.50]:39869 "EHLO mail-pb0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754733Ab3I1U2J (ORCPT ); Sat, 28 Sep 2013 16:28:09 -0400 From: David Ahern To: acme@ghostprotocols.net, linux-kernel@vger.kernel.org Cc: David Ahern , Ingo Molnar , Frederic Weisbecker , Peter Zijlstra , Jiri Olsa , Namhyung Kim , Stephane Eranian Subject: [PATCH 2/3] perf stat: Don't require a workload when using system wide or CPU options Date: Sat, 28 Sep 2013 14:27:59 -0600 Message-Id: <1380400080-9211-3-git-send-email-dsahern@gmail.com> X-Mailer: git-send-email 1.7.10.1 In-Reply-To: <1380400080-9211-1-git-send-email-dsahern@gmail.com> References: <1380400080-9211-1-git-send-email-dsahern@gmail.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org perf-stat can do system wide counters or one or more cpus. For these options do not require a workload to be specified. Signed-off-by: David Ahern Cc: Ingo Molnar Cc: Frederic Weisbecker Cc: Peter Zijlstra Cc: Jiri Olsa Cc: Namhyung Kim Cc: Stephane Eranian --- tools/perf/builtin-stat.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c index 6cc0aa2..60239fe 100644 --- a/tools/perf/builtin-stat.c +++ b/tools/perf/builtin-stat.c @@ -1517,8 +1517,10 @@ int cmd_stat(int argc, const char **argv, const char *prefix __maybe_unused) } else if (big_num_opt == 0) /* User passed --no-big-num */ big_num = false; - if (!argc && !perf_target__has_task(&target)) + if (!argc && !perf_target__has_task(&target) && + !perf_target__has_cpu(&target)) usage_with_options(stat_usage, options); + if (run_count < 0) { usage_with_options(stat_usage, options); } else if (run_count == 0) { -- 1.7.10.1