linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: tip-bot for Jiri Olsa <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: mingo@kernel.org, jolsa@kernel.org, namhyung@kernel.org,
	hpa@zytor.com, dsahern@gmail.com, acme@redhat.com,
	a.p.zijlstra@chello.nl, linux-kernel@vger.kernel.org,
	tglx@linutronix.de
Subject: [tip:perf/core] perf hists: Enlarge pid sort entry size
Date: Sun, 26 Jun 2016 03:52:36 -0700	[thread overview]
Message-ID: <tip-89c7cb2cad5e5e3675df3ba1c12fe2f64dc691d6@git.kernel.org> (raw)
In-Reply-To: <1466459899-1166-9-git-send-email-jolsa@kernel.org>

Commit-ID:  89c7cb2cad5e5e3675df3ba1c12fe2f64dc691d6
Gitweb:     http://git.kernel.org/tip/89c7cb2cad5e5e3675df3ba1c12fe2f64dc691d6
Author:     Jiri Olsa <jolsa@kernel.org>
AuthorDate: Mon, 20 Jun 2016 23:58:19 +0200
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 22 Jun 2016 09:56:35 -0300

perf hists: Enlarge pid sort entry size

The pid sort entry currently aligns pids with 5 digits, which is not
enough for current 4 million pids limit.

This leads to unaligned ':' header-data output when we display 7 digits
pid:

  # Children      Self  Symbol                    Pid:Command
  # ........  ........  ......................  .....................
  #
       0.12%     0.12%  [.] 0x0000000000147e0f  2052894:krava
  ...

Adding 2 more digit to properly align the pid limit:

  # Children      Self  Symbol                      Pid:Command
  # ........  ........  ......................  .......................
  #
       0.12%     0.12%  [.] 0x0000000000147e0f  2052894:krava

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lkml.kernel.org/r/1466459899-1166-9-git-send-email-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/hist.c | 2 +-
 tools/perf/util/sort.c | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index d2647b1..d9826cc 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -79,7 +79,7 @@ void hists__calc_col_len(struct hists *hists, struct hist_entry *h)
 
 	len = thread__comm_len(h->thread);
 	if (hists__new_col_len(hists, HISTC_COMM, len))
-		hists__set_col_len(hists, HISTC_THREAD, len + 6);
+		hists__set_col_len(hists, HISTC_THREAD, len + 8);
 
 	if (h->ms.map) {
 		len = dso__name_len(h->ms.map->dso);
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 896d34eb..a764139 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -79,8 +79,8 @@ static int hist_entry__thread_snprintf(struct hist_entry *he, char *bf,
 {
 	const char *comm = thread__comm_str(he->thread);
 
-	width = max(7U, width) - 6;
-	return repsep_snprintf(bf, size, "%5d:%-*.*s", he->thread->tid,
+	width = max(7U, width) - 8;
+	return repsep_snprintf(bf, size, "%7d:%-*.*s", he->thread->tid,
 			       width, width, comm ?: "");
 }
 
@@ -95,7 +95,7 @@ static int hist_entry__thread_filter(struct hist_entry *he, int type, const void
 }
 
 struct sort_entry sort_thread = {
-	.se_header	= "  Pid:Command",
+	.se_header	= "    Pid:Command",
 	.se_cmp		= sort__thread_cmp,
 	.se_snprintf	= hist_entry__thread_snprintf,
 	.se_filter	= hist_entry__thread_filter,

      reply	other threads:[~2016-06-26 10:52 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-20 21:58 [PATCH 0/8] perf tools: Various fixes Jiri Olsa
2016-06-20 21:58 ` [PATCH 1/8] perf tools: Rename __hists__add_entry to hists__add_entry Jiri Olsa
2016-06-20 21:58 ` [PATCH 2/8] perf tools: Move hist_browser into header file Jiri Olsa
2016-06-26 10:49   ` [tip:perf/core] perf hists browser: " tip-bot for Jiri Olsa
2016-06-20 21:58 ` [PATCH 3/8] perf tools: Make hist_browser__(new|delete|run) public Jiri Olsa
2016-06-26 10:50   ` [tip:perf/core] perf hists browser: Make (new|delete|run) public tip-bot for Jiri Olsa
2016-06-20 21:58 ` [PATCH 4/8] perf tools: Introduce struct hist_browser title callback Jiri Olsa
2016-06-26 10:50   ` [tip:perf/core] perf hists browser: " tip-bot for Jiri Olsa
2016-06-20 21:58 ` [PATCH 5/8] perf tools: Move horizontal scroll init into hist_browser__new Jiri Olsa
2016-06-26 10:51   ` [tip:perf/core] perf hists browser: Move horizontal scroll init to new() tip-bot for Jiri Olsa
2016-06-20 21:58 ` [PATCH 6/8] perf tools: Introduce perf_evsel_browser_new function Jiri Olsa
2016-06-26 10:51   ` [tip:perf/core] perf hists browser: Introduce perf_evsel_browser constructor tip-bot for Jiri Olsa
2016-06-20 21:58 ` [PATCH 7/8] perf tools: Introduce hist_browser__init Jiri Olsa
2016-06-26 10:52   ` [tip:perf/core] perf hists browser: Introduce init() tip-bot for Jiri Olsa
2016-06-20 21:58 ` [PATCH 8/8] perf tools: Enlarge pid sort entry size Jiri Olsa
2016-06-26 10:52   ` tip-bot for Jiri Olsa [this message]

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-89c7cb2cad5e5e3675df3ba1c12fe2f64dc691d6@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@redhat.com \
    --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;
as well as URLs for NNTP newsgroup(s).