aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/ui/browsers
diff options
context:
space:
mode:
authorNamhyung Kim <namhyung@kernel.org>2014-07-31 01:47:38 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2014-08-12 11:03:06 -0400
commit5b5916696051b88e63f3726cc3db44bf9561bad9 (patch)
tree432d11af8cf78cf56bbda7f8ffa33085fc1101e1 /tools/perf/ui/browsers
parente0d66c74b09f5103eef441a98b68056c4dae4cac (diff)
perf report: Honor column width setting
Set column width and do not change it if user gives -w/--column-widths option. It'll truncate longer symbols than the width if exists. Signed-off-by: Namhyung Kim <namhyung@kernel.org> 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/1406785662-5534-5-git-send-email-namhyung@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/ui/browsers')
-rw-r--r--tools/perf/ui/browsers/hists.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index c1d8d3925fe1..e07d4e848d5c 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -678,12 +678,12 @@ static u64 __hpp_get_##_field(struct hist_entry *he) \
678} \ 678} \
679 \ 679 \
680static int \ 680static int \
681hist_browser__hpp_color_##_type(struct perf_hpp_fmt *fmt __maybe_unused,\ 681hist_browser__hpp_color_##_type(struct perf_hpp_fmt *fmt, \
682 struct perf_hpp *hpp, \ 682 struct perf_hpp *hpp, \
683 struct hist_entry *he) \ 683 struct hist_entry *he) \
684{ \ 684{ \
685 return __hpp__fmt(hpp, he, __hpp_get_##_field, " %*.2f%%", 6, \ 685 return hpp__fmt(fmt, hpp, he, __hpp_get_##_field, " %*.2f%%", \
686 __hpp__slsmg_color_printf, true); \ 686 __hpp__slsmg_color_printf, true); \
687} 687}
688 688
689#define __HPP_COLOR_ACC_PERCENT_FN(_type, _field) \ 689#define __HPP_COLOR_ACC_PERCENT_FN(_type, _field) \
@@ -693,19 +693,20 @@ static u64 __hpp_get_acc_##_field(struct hist_entry *he) \
693} \ 693} \
694 \ 694 \
695static int \ 695static int \
696hist_browser__hpp_color_##_type(struct perf_hpp_fmt *fmt __maybe_unused,\ 696hist_browser__hpp_color_##_type(struct perf_hpp_fmt *fmt, \
697 struct perf_hpp *hpp, \ 697 struct perf_hpp *hpp, \
698 struct hist_entry *he) \ 698 struct hist_entry *he) \
699{ \ 699{ \
700 if (!symbol_conf.cumulate_callchain) { \ 700 if (!symbol_conf.cumulate_callchain) { \
701 int len = fmt->user_len ?: fmt->len; \
701 int ret = scnprintf(hpp->buf, hpp->size, \ 702 int ret = scnprintf(hpp->buf, hpp->size, \
702 "%*s", 8, "N/A"); \ 703 "%*s", len, "N/A"); \
703 slsmg_printf("%s", hpp->buf); \ 704 slsmg_printf("%s", hpp->buf); \
704 \ 705 \
705 return ret; \ 706 return ret; \
706 } \ 707 } \
707 return __hpp__fmt(hpp, he, __hpp_get_acc_##_field, " %*.2f%%", \ 708 return hpp__fmt(fmt, hpp, he, __hpp_get_acc_##_field, \
708 6, __hpp__slsmg_color_printf, true); \ 709 " %*.2f%%", __hpp__slsmg_color_printf, true); \
709} 710}
710 711
711__HPP_COLOR_PERCENT_FN(overhead, period) 712__HPP_COLOR_PERCENT_FN(overhead, period)
@@ -1549,6 +1550,9 @@ static int perf_evsel__hists_browse(struct perf_evsel *evsel, int nr_events,
1549 1550
1550 memset(options, 0, sizeof(options)); 1551 memset(options, 0, sizeof(options));
1551 1552
1553 if (symbol_conf.col_width_list_str)
1554 perf_hpp__set_user_width(symbol_conf.col_width_list_str);
1555
1552 while (1) { 1556 while (1) {
1553 const struct thread *thread = NULL; 1557 const struct thread *thread = NULL;
1554 const struct dso *dso = NULL; 1558 const struct dso *dso = NULL;