From: David Ahern <dsahern@gmail.com>
To: Namhyung Kim <namhyung@kernel.org>
Cc: acme@ghostprotocols.net, linux-kernel@vger.kernel.org,
Ingo Molnar <mingo@kernel.org>,
Frederic Weisbecker <fweisbec@gmail.com>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung.kim@lge.com>,
Stephane Eranian <eranian@google.com>,
"David (me)" <dsahern@gmail.com>
Subject: Re: [PATCH 2/3] perf stat: Don't require a workload when using system wide or CPU options
Date: Mon, 30 Sep 2013 07:40:12 -0600 [thread overview]
Message-ID: <52497F3C.9070908@gmail.com> (raw)
In-Reply-To: <87li2eofvd.fsf@sejong.aot.lge.com>
[-- Attachment #1: Type: text/plain, Size: 468 bytes --]
On 9/30/13 2:47 AM, Namhyung Kim wrote:
>> @@ -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))
>
> You can use perf_target__none() for this.
Indeed. Updated patch attached.
David
[-- Attachment #2: 0002-perf-stat-Don-t-require-a-workload-when-using-system.patch --]
[-- Type: text/plain, Size: 1385 bytes --]
>From a7018902283b3cfc5cae8a1876e2c14f3c7c9c7e Mon Sep 17 00:00:00 2001
From: David Ahern <dsahern@gmail.com>
Date: Mon, 30 Sep 2013 07:37:37 -0600
Subject: [PATCH] perf stat: Don't require a workload when using system wide or CPU options -v2
perf-stat can do system wide counters or one or more cpus. For
these options do not require a workload to be specified.
v2: use perf_target__none per Namhyung's comment
Signed-off-by: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Stephane Eranian <eranian@google.com>
---
tools/perf/builtin-stat.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/tools/perf/builtin-stat.c b/tools/perf/builtin-stat.c
index 6cc0aa2..db55b91 100644
--- a/tools/perf/builtin-stat.c
+++ b/tools/perf/builtin-stat.c
@@ -1517,8 +1517,9 @@ 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__none(&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
next prev parent reply other threads:[~2013-09-30 13:40 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-28 20:27 [PATCH 0/3] perf stat cleanups David Ahern
2013-09-28 20:27 ` [PATCH 1/3] perf stat: Fix misleading message when specifying cpu list or system wide David Ahern
2013-10-15 5:29 ` [tip:perf/core] " tip-bot for David Ahern
2013-09-28 20:27 ` [PATCH 2/3] perf stat: Don't require a workload when using system wide or CPU options David Ahern
2013-09-30 8:47 ` Namhyung Kim
2013-09-30 13:40 ` David Ahern [this message]
2013-10-08 12:39 ` Arnaldo Carvalho de Melo
2013-10-08 12:51 ` Ingo Molnar
2013-10-08 13:27 ` Arnaldo Carvalho de Melo
2013-10-08 19:24 ` Ingo Molnar
2013-10-08 13:25 ` David Ahern
2013-10-08 13:33 ` Arnaldo Carvalho de Melo
2013-10-08 13:42 ` David Ahern
2013-10-15 5:30 ` [tip:perf/core] perf stat: Don' t " tip-bot for David Ahern
2013-09-28 20:28 ` [PATCH 3/3] perf stat: Add units to nanosec-based counters David Ahern
2013-10-15 5:30 ` [tip:perf/core] " tip-bot for David Ahern
2013-10-08 1:44 ` [PATCH 0/3] perf stat cleanups David Ahern
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52497F3C.9070908@gmail.com \
--to=dsahern@gmail.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=namhyung@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).