From: Namhyung Kim <namhyung@kernel.org>
To: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: Jiri Olsa <jolsa@redhat.com>,
linux-kernel@vger.kernel.org,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Ingo Molnar <mingo@elte.hu>, Paul Mackerras <paulus@samba.org>,
Corey Ashford <cjashfor@linux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@gmail.com>,
David Ahern <dsahern@gmail.com>
Subject: Re: [PATCH 05/12] perf diff: Refactor stdio ui data columns output
Date: Sat, 08 Sep 2012 23:37:31 +0900 [thread overview]
Message-ID: <871uica8d0.fsf@kernel.org> (raw)
In-Reply-To: <20120908125059.GG20401@ghostprotocols.net> (Arnaldo Carvalho de Melo's message of "Sat, 8 Sep 2012 05:50:59 -0700")
Hi Jiri,
On Sat, 8 Sep 2012 05:50:59 -0700, Arnaldo Carvalho de Melo wrote:
> Em Sat, Sep 08, 2012 at 02:35:14PM +0200, Jiri Olsa escreveu:
>> On Fri, Sep 07, 2012 at 11:55:02AM +0900, Namhyung Kim wrote:
>> > Hi, Jiri
>> >
>> > On Thu, 6 Sep 2012 17:46:59 +0200, Jiri Olsa wrote:
>> > > Currently for any of the data columns (like Overhead/Period..) in
>> > > stdio ui, there's separate code to print header/dots/value scattered
>> > > along the display code path.
>> > >
>> > > Adding hists_stdio_column struct to centralize all info needed
>> > > to print column header/dots/value.
>> > >
>> > > This change eases up addition for new columns, which is now mostly
>> > > matter only of adding new hists_stdio_column struct.
>> >
>> > As you may know, I submitted a similar patchset few days ago for the
>> > same reason and it handles TUI/GTK cases as well. I'm waiting for
>> > reviews.
>>
>> ok, I'll rebase this to acme/tmp.perf/hpp
>
> well, you can, but that one is buggy and you will not be able to test
> 'perf diff' at all...
I posted the fix right before, and you will also need patch below for
fixing broken "baseline" output.
>From 8f2d9010979e244c6565f3a9134e7bfa61936e38 Mon Sep 17 00:00:00 2001
From: Namhyung Kim <namhyung@kernel.org>
Date: Sat, 8 Sep 2012 23:28:59 +0900
Subject: [PATCH] perf hist: Fix perf diff baseline output
When perf diff is running, the overhead field should print old hist
entry's period as a baseline.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
---
tools/perf/ui/hist.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 16dc486d02be..326f4e9e6911 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -21,6 +21,18 @@ static int hpp__width_overhead(struct perf_hpp *hpp __used)
static int hpp__color_overhead(struct perf_hpp *hpp, struct hist_entry *he)
{
double percent = 100.0 * he->period / hpp->total_period;
+
+ if (hpp->ptr) {
+ struct hists *old_hists = hpp->ptr;
+ u64 total_period = old_hists->stats.total_period;
+ u64 base_period = he->pair ? he->pair->period : 0;
+
+ if (total_period)
+ percent = 100.0 * base_period / total_period;
+ else
+ percent = 0.0;
+ }
+
return percent_color_snprintf(hpp->buf, hpp->size, " %5.2f%%", percent);
}
@@ -29,6 +41,17 @@ static int hpp__entry_overhead(struct perf_hpp *hpp, struct hist_entry *he)
double percent = 100.0 * he->period / hpp->total_period;
const char *fmt = symbol_conf.field_sep ? "%.2f" : " %5.2f%%";
+ if (hpp->ptr) {
+ struct hists *old_hists = hpp->ptr;
+ u64 total_period = old_hists->stats.total_period;
+ u64 base_period = he->pair ? he->pair->period : 0;
+
+ if (total_period)
+ percent = 100.0 * base_period / total_period;
+ else
+ percent = 0.0;
+ }
+
return scnprintf(hpp->buf, hpp->size, fmt, percent);
}
--
1.7.9.2
next prev parent reply other threads:[~2012-09-08 14:37 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-06 15:46 [RFC 00/12] perf diff: Factor diff command Jiri Olsa
2012-09-06 15:46 ` [PATCH 01/12] perf diff: Make diff command work with evsel hists Jiri Olsa
2012-09-08 11:41 ` [tip:perf/core] " tip-bot for Jiri Olsa
2012-09-06 15:46 ` [PATCH 02/12] perf tools: Replace sort's standalone field_sep with symbol_conf.field_sep Jiri Olsa
2012-09-08 11:42 ` [tip:perf/core] perf tools: Replace sort' s " tip-bot for Jiri Olsa
2012-09-06 15:46 ` [PATCH 03/12] perf hists: Add struct hists pointer to struct hist_entry Jiri Olsa
2012-09-06 15:46 ` [PATCH 04/12] perf diff: Refactor diff displacement possition info Jiri Olsa
2012-09-08 0:56 ` Arnaldo Carvalho de Melo
2012-09-06 15:46 ` [PATCH 05/12] perf diff: Refactor stdio ui data columns output Jiri Olsa
2012-09-07 2:55 ` Namhyung Kim
2012-09-07 9:20 ` Jiri Olsa
2012-09-08 12:35 ` Jiri Olsa
2012-09-08 12:50 ` Arnaldo Carvalho de Melo
2012-09-08 14:37 ` Namhyung Kim [this message]
2012-09-08 15:10 ` Arnaldo Carvalho de Melo
2012-09-08 15:12 ` Arnaldo Carvalho de Melo
2012-09-08 15:21 ` Arnaldo Carvalho de Melo
2012-09-06 15:47 ` [PATCH 06/12] perf diff: Add -b option for perf diff to display paired entries only Jiri Olsa
2012-09-06 15:47 ` [PATCH 07/12] perf diff: Add ratio computation way to compare hist entries Jiri Olsa
2012-09-07 5:45 ` Namhyung Kim
2012-09-07 9:26 ` Jiri Olsa
2012-09-07 15:33 ` Arnaldo Carvalho de Melo
2012-09-07 15:41 ` Namhyung Kim
2012-09-06 15:47 ` [PATCH 08/12] perf diff: Add option to sort entries based on diff computation Jiri Olsa
2012-09-06 15:47 ` [PATCH 09/12] perf diff: Add weighted diff computation way to compare hist entries Jiri Olsa
2012-09-07 5:58 ` Namhyung Kim
2012-09-07 9:28 ` Jiri Olsa
2012-09-07 13:33 ` Namhyung Kim
2012-09-07 15:26 ` Peter Zijlstra
2012-09-07 15:31 ` Arnaldo Carvalho de Melo
2012-09-07 16:08 ` Peter Zijlstra
2012-09-06 15:47 ` [PATCH 10/12] perf diff: Add -p option to display period values for " Jiri Olsa
2012-09-06 15:47 ` [PATCH 11/12] perf diff: Add -F option to display formula for computation Jiri Olsa
2012-09-07 6:02 ` Namhyung Kim
2012-09-07 9:30 ` Jiri Olsa
2012-09-06 15:47 ` [PATCH 12/12] perf diff: Add -F option for ratio computation Jiri Olsa
2012-09-06 17:31 ` [RFC 00/12] perf diff: Factor diff command Jiri Olsa
2012-09-06 18:41 ` Peter Zijlstra
2012-09-06 21:25 ` Paul E. McKenney
2012-09-07 7:05 ` Peter Zijlstra
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=871uica8d0.fsf@kernel.org \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@ghostprotocols.net \
--cc=cjashfor@linux.vnet.ibm.com \
--cc=dsahern@gmail.com \
--cc=fweisbec@gmail.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@elte.hu \
--cc=paulus@samba.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).