linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Namhyung Kim <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: jolsa@kernel.org, namhyung@kernel.org, acme@redhat.com,
	tglx@linutronix.de, hpa@zytor.com, mingo@kernel.org,
	andi@firstfloor.org, linux-kernel@vger.kernel.org,
	a.p.zijlstra@chello.nl, milian.wolff@kdab.com
Subject: [tip:perf/core] perf hists browser: Fix event group display
Date: Tue, 20 Sep 2016 14:37:15 -0700	[thread overview]
Message-ID: <tip-d9ea48bc4e7cc297ca1073fa3f90ed80d964b7b4@git.kernel.org> (raw)
In-Reply-To: <20160912061958.16656-2-namhyung@kernel.org>

Commit-ID:  d9ea48bc4e7cc297ca1073fa3f90ed80d964b7b4
Gitweb:     http://git.kernel.org/tip/d9ea48bc4e7cc297ca1073fa3f90ed80d964b7b4
Author:     Namhyung Kim <namhyung@kernel.org>
AuthorDate: Mon, 12 Sep 2016 15:19:52 +0900
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 12 Sep 2016 11:10:26 -0300

perf hists browser: Fix event group display

Milian reported that the event group on TUI shows duplicated overhead.
This was due to a bug on calculating hpp->buf position.  The
hpp_advance() was called from __hpp__slsmg_color_printf() on TUI but
it's already called from the hpp__call_print_fn macro in __hpp__fmt().
The end result is that the print function returns number of bytes it
printed but the buffer advanced twice of the length.

This is generally not a problem since it doesn't need to access the
buffer again.  But with event group, overhead needs to be printed
multiple times and hist_entry__snprintf_alignment() tries to fill the
space with buffer after it printed.  So it (brokenly) showed the last
overhead again.

The bug was there from the beginning, but I think it's only revealed
when the alignment function was added.

Reported-by: Milian Wolff <milian.wolff@kdab.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Fixes: 89fee7094323 ("perf hists: Do column alignment on the format iterator")
Link: http://lkml.kernel.org/r/20160912061958.16656-2-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/browsers/hists.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index f0611c9..35e44b1 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -1097,7 +1097,6 @@ static int __hpp__slsmg_color_printf(struct perf_hpp *hpp, const char *fmt, ...)
 	ret = scnprintf(hpp->buf, hpp->size, fmt, len, percent);
 	ui_browser__printf(arg->b, "%s", hpp->buf);
 
-	advance_hpp(hpp, ret);
 	return ret;
 }
 

  parent reply	other threads:[~2016-09-20 21:37 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-09-12  6:19 [PATCHSET 0/7] perf tools: Support hierarchy report with event group (v1) Namhyung Kim
2016-09-12  6:19 ` [PATCH 1/7] perf hists browser: Fix event group display Namhyung Kim
2016-09-12 14:23   ` Arnaldo Carvalho de Melo
2016-09-20 21:37   ` tip-bot for Namhyung Kim [this message]
2016-09-12  6:19 ` [PATCH 2/7] perf hist: Introduce hists__match_hierarchy() Namhyung Kim
2016-09-12 14:25   ` Arnaldo Carvalho de Melo
2016-09-12 23:59     ` Namhyung Kim
2016-09-12  6:19 ` [PATCH 3/7] perf hist: Introduce hists__link_hierarchy() Namhyung Kim
2016-09-12  6:19 ` [PATCH 4/7] perf hist: Initialize hierachy tree explicitly Namhyung Kim
2016-09-12 14:22   ` Arnaldo Carvalho de Melo
2016-09-13  0:09     ` Namhyung Kim
2016-09-12  6:19 ` [PATCH 5/7] perf ui/stdio: Reset output width for hierarchy Namhyung Kim
2016-09-12 14:27   ` Arnaldo Carvalho de Melo
2016-09-13  1:00     ` Namhyung Kim
2016-09-12  6:19 ` [PATCH 6/7] perf ui/tui: " Namhyung Kim
2016-09-12 14:27   ` Arnaldo Carvalho de Melo
2016-09-13  1:01     ` Namhyung Kim
2016-09-12  6:19 ` [PATCH 7/7] perf report: Enable group view with hierarchy Namhyung Kim
2016-09-12 14:28   ` Arnaldo Carvalho de Melo
2016-09-13  1:06     ` 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-d9ea48bc4e7cc297ca1073fa3f90ed80d964b7b4@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --cc=andi@firstfloor.org \
    --cc=hpa@zytor.com \
    --cc=jolsa@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=milian.wolff@kdab.com \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.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;
as well as URLs for NNTP newsgroup(s).