perf top: Add -w option for setting column width
authorNamhyung Kim <namhyung@kernel.org>
Thu, 31 Jul 2014 05:47:39 +0000 (14:47 +0900)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 12 Aug 2014 15:03:06 +0000 (12:03 -0300)
Add -w/--column-widths option like perf report does so that users are
able to see symbols even with some very long C++ library/functions.

It can be a list separated by comma for each column.

  $ perf top -w 0,20,30

The value of 0 means there's no limit.

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-6-git-send-email-namhyung@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/Documentation/perf-report.txt
tools/perf/Documentation/perf-top.txt
tools/perf/builtin-top.c

index d2b59af62bc0ad6ddff918f2aee04a67fbf5541f..d561e0214f52fbcb1ba1562d4bac1d602af31f10 100644 (file)
@@ -147,7 +147,7 @@ OPTIONS
 -w::
 --column-widths=<width[,width...]>::
        Force each column width to the provided list, for large terminal
-       readability.
+       readability.  0 means no limit (default behavior).
 
 -t::
 --field-separator=::
index 180ae02137a519acf1b3d779a92eb651db6b4aff..28fdee3948806896ad38876d4d1c071f7453a60b 100644 (file)
@@ -193,6 +193,12 @@ Default is to monitor all CPUS.
        sum of shown entries will be always 100%. "absolute" means it retains
        the original value before and after the filter is applied.
 
+-w::
+--column-widths=<width[,width...]>::
+       Force each column width to the provided list, for large terminal
+       readability.  0 means no limit (default behavior).
+
+
 INTERACTIVE PROMPTING KEYS
 --------------------------
 
index 377971dc89a3b26ffcd25b9eb3e8c0c01338ea24..bde216b2071c77b8eb24bd161f1f0b1188c48900 100644 (file)
@@ -1131,6 +1131,9 @@ int cmd_top(int argc, const char **argv, const char *prefix __maybe_unused)
                     "Don't show entries under that percent", parse_percent_limit),
        OPT_CALLBACK(0, "percentage", NULL, "relative|absolute",
                     "How to display percentage of filtered entries", parse_filter_percentage),
+       OPT_STRING('w', "column-widths", &symbol_conf.col_width_list_str,
+                  "width[,width...]",
+                  "don't try to adjust column width, use these fixed values"),
        OPT_END()
        };
        const char * const top_usage[] = {