From: tip-bot for Namhyung Kim <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: a.p.zijlstra@chello.nl, acme@redhat.com, jolsa@kernel.org,
tglx@linutronix.de, linux-kernel@vger.kernel.org,
dsahern@gmail.com, andi@firstfloor.org, namhyung@kernel.org,
mingo@kernel.org, hpa@zytor.com
Subject: [tip:perf/core] perf tools: Fix alignment on some sort keys
Date: Wed, 24 Feb 2016 21:38:06 -0800 [thread overview]
Message-ID: <tip-2960ed6f8d6794dcb39ba48c3e515e5be18ee9e1@git.kernel.org> (raw)
In-Reply-To: <1456101153-14519-1-git-send-email-namhyung@kernel.org>
Commit-ID: 2960ed6f8d6794dcb39ba48c3e515e5be18ee9e1
Gitweb: http://git.kernel.org/tip/2960ed6f8d6794dcb39ba48c3e515e5be18ee9e1
Author: Namhyung Kim <namhyung@kernel.org>
AuthorDate: Mon, 22 Feb 2016 09:32:33 +0900
Committer: Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Mon, 22 Feb 2016 12:05:55 -0300
perf tools: Fix alignment on some sort keys
The srcline, srcfile and trace sort keys can have long entries. With
commit 89fee7094323 ("perf hists: Do column alignment on the format
iterator"), it now aligns output with hist_entry__snprintf_alignment().
So each (possibly long) sort entries don't need to do it themselves.
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Acked-by: Jiri Olsa <jolsa@kernel.org>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1456101153-14519-1-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/util/sort.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 6f4605b..a7d73e5 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -314,7 +314,7 @@ static int hist_entry__srcline_snprintf(struct hist_entry *he, char *bf,
if (!he->srcline)
he->srcline = hist_entry__get_srcline(he);
- return repsep_snprintf(bf, size, "%-*.*s", width, width, he->srcline);
+ return repsep_snprintf(bf, size, "%-.*s", width, he->srcline);
}
struct sort_entry sort_srcline = {
@@ -366,7 +366,7 @@ static int hist_entry__srcfile_snprintf(struct hist_entry *he, char *bf,
if (!he->srcfile)
he->srcfile = hist_entry__get_srcfile(he);
- return repsep_snprintf(bf, size, "%-*.*s", width, width, he->srcfile);
+ return repsep_snprintf(bf, size, "%-.*s", width, he->srcfile);
}
struct sort_entry sort_srcfile = {
@@ -496,11 +496,11 @@ static int hist_entry__trace_snprintf(struct hist_entry *he, char *bf,
evsel = hists_to_evsel(he->hists);
if (evsel->attr.type != PERF_TYPE_TRACEPOINT)
- return scnprintf(bf, size, "%-*.*s", width, width, "N/A");
+ return scnprintf(bf, size, "%-.*s", width, "N/A");
if (he->trace_output == NULL)
he->trace_output = get_trace_output(he);
- return repsep_snprintf(bf, size, "%-*.*s", width, width, he->trace_output);
+ return repsep_snprintf(bf, size, "%-.*s", width, he->trace_output);
}
struct sort_entry sort_trace = {
next prev parent reply other threads:[~2016-02-25 6:31 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-02-21 14:22 [PATCH 1/5] perf tools: Fix assertion failure on dynamic entry Namhyung Kim
2016-02-21 14:22 ` [PATCH 2/5] perf tools: Fix segfault on dynamic entries Namhyung Kim
2016-02-21 17:37 ` Jiri Olsa
2016-02-25 5:37 ` [tip:perf/core] " tip-bot for Namhyung Kim
2016-02-21 14:22 ` [PATCH 3/5] perf tools: Update srcline/file if needed Namhyung Kim
2016-02-21 17:39 ` Jiri Olsa
2016-02-22 0:31 ` [PATCH v2 " Namhyung Kim
2016-02-22 6:49 ` Jiri Olsa
2016-02-25 5:37 ` [tip:perf/core] " tip-bot for Namhyung Kim
2016-02-21 14:22 ` [PATCH 4/5] perf tools: Fix alignment on some sort keys Namhyung Kim
2016-02-21 17:40 ` Jiri Olsa
2016-02-22 0:32 ` [PATCH v2 " Namhyung Kim
2016-02-25 5:38 ` tip-bot for Namhyung Kim [this message]
2016-02-21 14:22 ` [PATCH 5/5] perf tools: Fix column width setting on 'trace' sort key Namhyung Kim
2016-02-21 17:41 ` Jiri Olsa
2016-02-25 5:38 ` [tip:perf/core] " tip-bot for Namhyung Kim
2016-02-21 17:37 ` [PATCH 1/5] perf tools: Fix assertion failure on dynamic entry Jiri Olsa
2016-02-22 15:08 ` Arnaldo Carvalho de Melo
2016-02-25 5:38 ` [tip:perf/core] " tip-bot for 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-2960ed6f8d6794dcb39ba48c3e515e5be18ee9e1@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@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--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
Powered by JetHome