From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@infradead.org>
Cc: Ingo Molnar <mingo@kernel.org>,
linux-kernel@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>,
David Ahern <dsahern@gmail.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
Jiri Olsa <jolsa@redhat.com>, Mike Galbraith <efault@gmx.de>,
Paul Mackerras <paulus@samba.org>,
Peter Zijlstra <peterz@infradead.org>,
Stephane Eranian <eranian@google.com>
Subject: Re: [PATCH 15/18] perf sched: Use perf_tool as ancestor
Date: Wed, 12 Sep 2012 10:04:43 +0900 [thread overview]
Message-ID: <87wr009hlg.fsf@sejong.aot.lge.com> (raw)
In-Reply-To: <1347407590-30960-16-git-send-email-acme@infradead.org> (Arnaldo Carvalho de Melo's message of "Tue, 11 Sep 2012 20:53:07 -0300")
On Tue, 11 Sep 2012 20:53:07 -0300, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> So that we can remove all the globals.
>
> Before:
>
> text data bss dec hex filename
> 1586833 110368 1438600 3135801 2fd939 /tmp/oldperf
>
> After:
>
> text data bss dec hex filename
> 1629329 93568 848328 2571225 273bd9 /root/bin/perf
>
Just a nitpick below.
[snip]
> -static void print_bad_events(void)
> +static void print_bad_events(struct perf_sched *sched)
> {
> - if (nr_unordered_timestamps && nr_timestamps) {
> + if (sched->nr_unordered_timestamps && sched->nr_timestamps) {
> printf(" INFO: %.3f%% unordered timestamps (%ld out of %ld)\n",
> - (double)nr_unordered_timestamps/(double)nr_timestamps*100.0,
> - nr_unordered_timestamps, nr_timestamps);
> + (double)sched->nr_unordered_timestamps/(double)sched->nr_timestamps*100.0,
Isn't it sufficient to use this?
100.0 * sched->nr_unordered_timestamps / sched->nr_timestamps;
Ditto for belows.
Thanks,
Namhyung
> + sched->nr_unordered_timestamps, sched->nr_timestamps);
> }
> - if (nr_lost_events && nr_events) {
> + if (sched->nr_lost_events && sched->nr_events) {
> printf(" INFO: %.3f%% lost events (%ld out of %ld, in %ld chunks)\n",
> - (double)nr_lost_events/(double)nr_events*100.0,
> - nr_lost_events, nr_events, nr_lost_chunks);
> + (double)sched->nr_lost_events/(double)sched->nr_events * 100.0,
> + sched->nr_lost_events, sched->nr_events, sched->nr_lost_chunks);
> }
> - if (nr_state_machine_bugs && nr_timestamps) {
> + if (sched->nr_state_machine_bugs && sched->nr_timestamps) {
> printf(" INFO: %.3f%% state machine bugs (%ld out of %ld)",
> - (double)nr_state_machine_bugs/(double)nr_timestamps*100.0,
> - nr_state_machine_bugs, nr_timestamps);
> - if (nr_lost_events)
> + (double)sched->nr_state_machine_bugs/(double)sched->nr_timestamps*100.0,
> + sched->nr_state_machine_bugs, sched->nr_timestamps);
> + if (sched->nr_lost_events)
> printf(" (due to lost events?)");
> printf("\n");
> }
> - if (nr_context_switch_bugs && nr_timestamps) {
> + if (sched->nr_context_switch_bugs && sched->nr_timestamps) {
> printf(" INFO: %.3f%% context switch bugs (%ld out of %ld)",
> - (double)nr_context_switch_bugs/(double)nr_timestamps*100.0,
> - nr_context_switch_bugs, nr_timestamps);
> - if (nr_lost_events)
> + (double)sched->nr_context_switch_bugs/(double)sched->nr_timestamps*100.0,
> + sched->nr_context_switch_bugs, sched->nr_timestamps);
> + if (sched->nr_lost_events)
> printf(" (due to lost events?)");
> printf("\n");
> }
> }
next prev parent reply other threads:[~2012-09-12 1:11 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-11 23:52 [GIT PULL 00/20] perf/core improvements and fixes Arnaldo Carvalho de Melo
2012-09-11 23:52 ` [PATCH 01/18] perf test: Remove die() calls Arnaldo Carvalho de Melo
2012-09-12 0:24 ` Namhyung Kim
2012-09-12 1:03 ` Arnaldo Carvalho de Melo
2012-09-12 1:17 ` Namhyung Kim
2012-09-11 23:52 ` [PATCH 02/18] perf sched: " Arnaldo Carvalho de Melo
2012-09-12 0:37 ` Namhyung Kim
2012-09-11 23:52 ` [PATCH 03/18] perf kmem: " Arnaldo Carvalho de Melo
2012-09-11 23:52 ` [PATCH 04/18] perf tools: include wrapper for magic.h Arnaldo Carvalho de Melo
2012-09-11 23:52 ` [PATCH 05/18] perf tools: Add missing perf_regs.h file to MANIFEST Arnaldo Carvalho de Melo
2012-09-11 23:52 ` [PATCH 06/18] perf tools: Update types definitions for Android Arnaldo Carvalho de Melo
2012-09-11 23:52 ` [PATCH 07/18] perf tools: include __WORDSIZE definition Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 08/18] perf tools: fix ALIGN redefinition in system headers Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 09/18] perf tools: Do backtrace post unwind only if we regs and stack were captured Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 10/18] perf tools: Add memdup function Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 11/18] perf symbols: Make dsos__find function globally available Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 12/18] perf tools: Back [vdso] DSO with real data Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 13/18] perf tools: Use __maybe_used for unused variables Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 14/18] perf sched: Remove unused thread parameter Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 15/18] perf sched: Use perf_tool as ancestor Arnaldo Carvalho de Melo
2012-09-12 1:04 ` Namhyung Kim [this message]
2012-09-11 23:53 ` [PATCH 16/18] perf evsel: Introduce perf_evsel__{str,int}val methods Arnaldo Carvalho de Melo
2012-09-12 1:40 ` Namhyung Kim
2012-09-12 13:47 ` Arnaldo Carvalho de Melo
2012-09-12 2:21 ` Namhyung Kim
2012-09-12 13:48 ` Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 17/18] perf sched: Use perf_evsel__{int,str}val Arnaldo Carvalho de Melo
2012-09-11 23:53 ` [PATCH 18/18] perf sched: Don't read all tracepoint variables in advance Arnaldo Carvalho de Melo
2012-09-13 15:15 ` [GIT PULL 00/20] perf/core improvements and fixes Ingo Molnar
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=87wr009hlg.fsf@sejong.aot.lge.com \
--to=namhyung@kernel.org \
--cc=acme@infradead.org \
--cc=acme@redhat.com \
--cc=dsahern@gmail.com \
--cc=efault@gmx.de \
--cc=eranian@google.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulus@samba.org \
--cc=peterz@infradead.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
Powered by JetHome