From: tip-bot for Namhyung Kim <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: acme@redhat.com, linux-kernel@vger.kernel.org, paulus@samba.org,
hpa@zytor.com, mingo@kernel.org, andi@firstfloor.org,
a.p.zijlstra@chello.nl, namhyung.kim@lge.com,
namhyung@kernel.org, jolsa@redhat.com, dsahern@gmail.com,
tglx@linutronix.de
Subject: [tip:perf/core] perf ui/stdio: Fix invalid output on event group report
Date: Tue, 18 Mar 2014 01:29:40 -0700 [thread overview]
Message-ID: <tip-9b0d2fb86d4737b2cda39bc9c9a8e368cec38960@git.kernel.org> (raw)
In-Reply-To: <1393809254-4480-2-git-send-email-namhyung@kernel.org>
Commit-ID: 9b0d2fb86d4737b2cda39bc9c9a8e368cec38960
Gitweb: http://git.kernel.org/tip/9b0d2fb86d4737b2cda39bc9c9a8e368cec38960
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Mon, 3 Mar 2014 10:14:02 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Fri, 14 Mar 2014 18:08:37 -0300
perf ui/stdio: Fix invalid output on event group report
When some of group member has 0 overhead, it printed previous percentage
instead of 0.00%. It's because passing integer 0 as a percent rather
than double 0.0 so the remaining bits came from garbage. The TUI and
GTK don't have this problem since they pass 0.0.
Before:
# Samples: 845 of event 'anon group { cycles, cache-references, cache-misses }'
# Event count (approx.): 174775051
#
# Overhead Samples
# ........................ ....................................
#
20.32% 8.58% 73.51% 45 30 138
6.87% 6.87% 6.87% 21 0 0
5.29% 0.31% 0.31% 10 1 0
1.89% 1.89% 1.89% 6 0 0
1.76% 1.76% 1.76% 2 0 0
After:
# Overhead Samples
# ........................ ....................................
#
20.32% 8.58% 73.51% 45 30 138
6.87% 0.00% 0.00% 21 0 0
5.29% 0.31% 0.00% 10 1 0
1.89% 0.00% 0.00% 6 0 0
1.76% 0.00% 0.00% 2 0 0
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1393809254-4480-2-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/ui/hist.c | 20 ++++++++++++++++----
1 file changed, 16 insertions(+), 4 deletions(-)
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 78f4c92..6094562 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -52,8 +52,15 @@ static int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he,
* zero-fill group members in the middle which
* have no sample
*/
- ret += print_fn(hpp->buf + ret, hpp->size - ret,
- fmt, 0);
+ if (fmt_percent) {
+ ret += print_fn(hpp->buf + ret,
+ hpp->size - ret,
+ fmt, 0.0);
+ } else {
+ ret += print_fn(hpp->buf + ret,
+ hpp->size - ret,
+ fmt, 0ULL);
+ }
}
if (fmt_percent)
@@ -72,8 +79,13 @@ static int __hpp__fmt(struct perf_hpp *hpp, struct hist_entry *he,
/*
* zero-fill group members at last which have no sample
*/
- ret += print_fn(hpp->buf + ret, hpp->size - ret,
- fmt, 0);
+ if (fmt_percent) {
+ ret += print_fn(hpp->buf + ret, hpp->size - ret,
+ fmt, 0.0);
+ } else {
+ ret += print_fn(hpp->buf + ret, hpp->size - ret,
+ fmt, 0ULL);
+ }
}
}
return ret;
next prev parent reply other threads:[~2014-03-18 8:30 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-03-03 1:14 [PATCHSET 00/13] perf tools: Update on filtered entries' percentage output (v6) Namhyung Kim
2014-03-03 1:14 ` [PATCH 01/13] perf ui/stdio: Fix invalid output on event group report Namhyung Kim
2014-03-18 8:29 ` tip-bot for Namhyung Kim [this message]
2014-03-03 1:14 ` [PATCH 02/13] perf ui/gtk: Reuse generic __hpp__fmt() code Namhyung Kim
2014-03-03 13:13 ` Pekka Enberg
2014-03-18 8:29 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-03-03 1:14 ` [PATCH 03/13] perf ui/hists: Pass struct hpp to print functions Namhyung Kim
2014-03-18 8:30 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-03-03 1:14 ` [PATCH 04/13] perf ui/tui: Reuse generic __hpp__fmt() code Namhyung Kim
2014-03-18 8:30 ` [tip:perf/core] " tip-bot for Namhyung Kim
2014-03-03 1:14 ` [PATCH 05/13] perf tools: Pass evsel to hpp->header/width functions explicitly Namhyung Kim
2014-03-03 1:14 ` [PATCH 06/13] perf tools: Count periods of filtered entries separately Namhyung Kim
2014-03-03 1:14 ` [PATCH 07/13] perf hists: Add support for showing relative percentage Namhyung Kim
2014-03-07 14:37 ` Arnaldo Carvalho de Melo
2014-03-07 14:39 ` PVT " Arnaldo Carvalho de Melo
2014-03-03 1:14 ` [PATCH 08/13] perf report: Add --percentage option Namhyung Kim
2014-03-03 1:14 ` [PATCH 09/13] perf top: " Namhyung Kim
2014-03-03 1:14 ` [PATCH 10/13] perf diff: " Namhyung Kim
2014-03-03 1:14 ` [PATCH 11/13] perf tools: Add hist.percentage config option Namhyung Kim
2014-03-03 1:14 ` [PATCH 12/13] perf ui/tui: Add 'F' hotkey to toggle percentage output Namhyung Kim
2014-03-03 1:14 ` [PATCH 13/13] perf tools: Show absolute percentage by default Namhyung Kim
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=tip-9b0d2fb86d4737b2cda39bc9c9a8e368cec38960@git.kernel.org \
--to=tipbot@zytor.com \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@redhat.com \
--cc=andi@firstfloor.org \
--cc=dsahern@gmail.com \
--cc=hpa@zytor.com \
--cc=jolsa@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung.kim@lge.com \
--cc=namhyung@kernel.org \
--cc=paulus@samba.org \
--cc=tglx@linutronix.de \
/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