Skip to contentSkip to conversation

perf config : Adding a command 'config' with a option '--list' and a document for it.

PATCH In review Taeung 3 participants 3 messages Mar 7, 2015 – Mar 9, 2015 perf events

lore
Share & tools
lore

Taeung

author
#0 lore raw

PATCH 1/1 perf config : Adding a command 'config' with a option '--list' and a document for it.

The perf configuration file contain many variables which can make
the perf command's action more effective and more skilful.
But looking through state of configuration is difficult and
there's no knowing what kind of other variables except variables in perfconfig.example exist. So This patch adds a command 'config --list' and a document for it.

---
 tools/perf/Build                            |   1 +
 tools/perf/Documentation/perf-config.txt    | 350 ++++++++++++++++++++++++++++
 tools/perf/Documentation/perfconfig.example |  63 ++++-
 tools/perf/builtin-config.c                 |  56 +++++
 tools/perf/builtin.h                        |   1 +
 tools/perf/command-list.txt                 |   1 +
 tools/perf/perf.c                           |   1 +
 7 files changed, 462 insertions(+), 11 deletions(-)
 create mode 100644 tools/perf/Documentation/perf-config.txt
 create mode 100644 tools/perf/builtin-config.c
tools/perf/Build +1 -0
index b77370e..3c1f437 100644
@@ -1,5 +1,6 @@
 perf-y += builtin-bench.o
 perf-y += builtin-annotate.o
+perf-y += builtin-config.o
 perf-y += builtin-diff.o
 perf-y += builtin-evlist.o
 perf-y += builtin-help.o
tools/perf/Documentation/perf-config.txt new file +350 -0

350 lines not on this page · raw message

tools/perf/Documentation/perfconfig.example +52 -11

81 lines not on this page · raw message

tools/perf/builtin-config.c new file +56 -0

56 lines not on this page · raw message

tools/perf/builtin.h +1 -0
index 3688ad2..3f871b5 100644
@@ -17,6 +17,7 @@ extern int cmd_annotate(int argc, const char **argv, const char *prefix);
 extern int cmd_bench(int argc, const char **argv, const char *prefix);
 extern int cmd_buildid_cache(int argc, const char **argv, const char *prefix);
 extern int cmd_buildid_list(int argc, const char **argv, const char *prefix);
+extern int cmd_config(int argc, const char **argv, const char *prefix);
 extern int cmd_diff(int argc, const char **argv, const char *prefix);
 extern int cmd_evlist(int argc, const char **argv, const char *prefix);
 extern int cmd_help(int argc, const char **argv, const char *prefix);
tools/perf/command-list.txt +1 -0
index 00fcaf8..acc3ea7 100644
@@ -9,6 +9,7 @@ perf-buildid-cache		mainporcelain common
 perf-buildid-list		mainporcelain common
 perf-data			mainporcelain common
 perf-diff			mainporcelain common
+perf-config			mainporcelain common
 perf-evlist			mainporcelain common
 perf-inject			mainporcelain common
 perf-kmem			mainporcelain common
tools/perf/perf.c +1 -0
index b857fcb..604fa4a 100644
@@ -37,6 +37,7 @@ struct cmd_struct {
 static struct cmd_struct commands[] = {
 	{ "buildid-cache", cmd_buildid_cache, 0 },
 	{ "buildid-list", cmd_buildid_list, 0 },
+	{ "config",	cmd_config,	0 },
 	{ "diff",	cmd_diff,	0 },
 	{ "evlist",	cmd_evlist,	0 },
 	{ "help",	cmd_help,	0 },
Signature · 1 line
1.9.1
maintainer
#1 lore raw

Hi Taeung,

(Please add Jiri to CC when sending a patch for perf tools..)

Thanks for doing this. I left some more description and suggestion from my understanding, I think other guys will provide more helpful and clear words on other parts.

Quoted 6 lines · Taeung

The perf configuration file contain many variables which can make
the perf command's action more effective and more skilful.
But looking through state of configuration is difficult and
there's no knowing what kind of other variables except variables in perfconfig.example exist. So This patch adds a command 'config --list' and a document for it.
---

[SNIP]

Quoted 31 lines
tools/perf/Documentation/perf-config.txt new file +31 -0
+Variables
+~~~~~~~~~
+
+colors.*::
+	Color variables can appoint colors of the output which is printed out 
+	from ‘report’, ‘top’,’annotate’ on tui.
+	Color variables is composed of foreground and background
+	and should have two values for them. If you want to set as colors 
+	of your terminal, you should use ‘default’ for color value.
+        The kind of color which can be used as below.
+	red, green, default, black, blue, white, magenta, lightgray
+	
+	colors.top::
+		‘top’ means a overhead percentage which has more than 5%.
+		And values of it’s variable specify colors of percentage.
+		Basic key values are foreground-color ’red’ and 
+		background-color ’default’.
+	colors.medium::
+		‘medium’ means a overhead percentage which has more than 0.5%. 
+		Default values are ’green’ and ’default’.
+	colors.normal::
+		‘normal’ means rest of overhead percentages 
+		except ‘top’, ‘medium’, ‘selected’.
+		Default values are ’lightgray’ and ’default’.
+	colors.selected::
+		This appoint colors for forcussed one of the output list 
+		from sub-commands (top,report,annotate).  
+		Default values are ’white’ and ’lightgray’.
+	colors.code:: 
+		Colors for a arrow and lines on jumping by assembly code 
+		such as ‘jns’,’jmp’,’jane’,etc. Default values are ‘blue’, ‘default’.

tools/perf/Documentation/perf-config.txt line 131

Quoted 10 lines
tools/perf/Documentation/perf-config.txt new file +10 -0
+	colors.addr::
+		This appoint colors for addresses from a sub-command ’annotate’.
+		Default values are ‘magenta’, ‘default’.
+	colors.root::
+		Colors for headers in the output of a sub-command ‘top’. 
+		Default values are ‘white’, ‘blue’.
+
+tui.*::
+	Using sub-commands which are ’top’ and ‘report’, ‘annotate’,
+	declare whether they work on TUI or not by ‘on’ or ‘off’.

How about this:

A boolean value that controls launching TUI browser for each subcommand. By default, TUI is enabled if perf detects a needed library during build and this config option can control it. Available subcommands are 'top', 'report' and 'annotate'.

tools/perf/Documentation/perf-config.txt line 134

Quoted 3 lines
tools/perf/Documentation/perf-config.txt new file +3 -0
+gtk.*::
+	Using sub-commands which are ’top’ and ‘report’, ‘annotate’,
+	declare whether they work on GTK or not by ‘on’ or ‘off’. 

Ditto:

A boolean value that controls launching GTK+2 GUI browser for each subcommand. By default, TUI is enabled if perf detects a needed library during build and this config option can control it. Available subcommands are 'top', 'report' and 'annotate'.

tools/perf/Documentation/perf-config.txt line 141

Quoted 7 lines
tools/perf/Documentation/perf-config.txt new file +7 -0
+
+buildid.*::
+	buildid.dir::
+		Each executable or shared library built with each program is assigned
+		a unique identification as build-id. The option means a path where
+		build-id informations can be saved.
+		The default of this option is /root/.debug

The default is $HOME/.debug

Quoted 90 lines
tools/perf/Documentation/perf-config.txt new file +90 -0
+
+annotate.*::
+	There’re options which work with a ’annotate’ sub-command.
+	This Options is in control of addresses, jump function, source code
+	in lines of assembly code from a specific program. 
+
+	annotate.hide_src_code::
+		If a program which is analyzed has source code of itself,
+		this option let ‘annotate’ print a list of assembly code with the source code.
+		For example, let’s see a part of a program. There’re four lines.
+		If this option is ‘false’, they can be printed 
+		without source code from a program as below.
+
+		│        push   %rbp
+		│        mov    %rsp,%rbp
+		│        sub    $0x10,%rsp
+		│        mov    (%rdi),%rdx
+		
+		But if this option is ‘true’, source code of the part 
+		can be also printed as below.
+ 
+		│      struct rb_node *rb_next(const struct rb_node *node)
+		│      {
+		│        push   %rbp
+		│        mov    %rsp,%rbp
+		│        sub    $0x10,%rsp
+		│              struct rb_node *parent;
+		│
+		│              if (RB_EMPTY_NODE(node))
+		│        mov    (%rdi),%rdx
+		│              return n;
+
+        annotate.use_offset::
+		Basing on a first address of a loaded function, offset can be used.
+		Instead of using original addresses of assembly code,
+		addresses subtracted from a base address can be printed.
+		Let’s illustrate a example. 
+		If a base address is 0XFFFFFFFF81624d50 as below,
+
+		ffffffff81624d50 <load0>
+
+		a address on assembly code has a specific absolute address as below
+
+		ffffffff816250b8:│  mov    0x8(%r14),%rdi
+
+		but if use_offset is ’true’, a address subtracted from a base address is printed.
+		The default is positive.
+
+		             368:│  mov    0x8(%r14),%rdi
+
+	annotate.jump_arrows::
+		There’re jump instruction among assembly code.
+		Depending on a boolean value of jump_arrows,
+		arrows can be printed or not which represent 
+		where do the instruction jump into as below.
+
+		│     ┌──jmp    1333
+		│     │  xchg   %ax,%ax
+		│1330:│  mov    %r15,%r10
+		│1333:└─→cmp    %r15,%r14
+
+		If jump_arrow is ‘false’, the arrows isn’t printed as below.
+
+		│      ↓ jmp    1333
+		│        xchg   %ax,%ax
+		│1330:   mov    %r15,%r10
+		│1333:   cmp    %r15,%r14
+
+        annotate.show_nr_jumps::
+		Let’s see a part of assembly code.
+ 
+		│1382:   movb   $0x1,-0x270(%rbp)
+
+		If use this, the number of branches branching to that address can be printed as below.
+
+		│1 1382:   movb   $0x1,-0x270(%rbp)
+
+help.*::
+	help.format:: = man
+		A format of manual page can be ‘man’, ‘info’, ‘web’ or ‘html’.
+		’man’ is default.
+	help.autocorrect:: = 0
+		Automatically correct and execute mistyped commands after
+		waiting for the given number of deciseconds (0.1 sec).
+		When this option is 0 if execute a mistyped sub-command instead of ‘top’,
+
+		perf: 'ttop' is not a perf-command. See 'perf --help’.
+
+		If this option is more than 1, the output can be such as.
+

tools/perf/Documentation/perf-config.txt line 241

Quoted 10 lines
tools/perf/Documentation/perf-config.txt new file +10 -0
+		WARNING: You called a perf program named 'ttop', which does not exist.
+		Continuing under the assumption that you meant 'with-kcore'
+		in 0.1 seconds automatically...
+		Usage: perf-with-kcore <perf sub-command> <perf.data directory> [<sub-command options> [ -- <workload>]]
+       		<perf sub-command> can be record, script, report or inject		
+		    or: perf-with-kcore fix_buildid_cache_permissions
+
+hist.*::
+	hist.percentage::
+		A value of 'percentage' can be 'relative' or 'absolute'

This option control a way to calcurate overhead of filtered entries - that means the value of this option is effective only if there's a filter (by comm, dso or symbol name). Suppose a following example:

	Overhead  Symbols
	........  .......
	  33.33%  foo
	  33.33%  bar
	  33.33%  baz

This is an original overhead and we'll filter out the first 'foo' entry. The value of 'relative' would increase the overhead of 'bar' and 'baz' to 50.00% for each, while 'absolute' would show their current overhead (33.33%).

tools/perf/Documentation/perf-config.txt line 254

Quoted 13 lines
tools/perf/Documentation/perf-config.txt new file +13 -0
+
+ui.*::
+	ui.show-headers::
+		There’re columns as header ‘Overhead’, ‘Children’, ‘Shared Object’, ‘Symbol’, ’self’.
+		If this option is negative, they is hided.
+
+call-graph.*::
+	When sub-commands ‘top’ and ‘report’ work with -g/—-children 
+	there’re options in control of call-graph.
+
+	call-graph.record-mode::
+		The record-mode can be ‘fp’ (frame pointer) and ‘dwarf’.
+		If using 'Dwarf style', it requires dump-size has a value.

The value of 'dwarf' is effective only if perf detect needed library (libunwind or a recent version of libdw). Also it doesn't *require* the dump-size option since it can use the default value of 8192 if missing.

tools/perf/Documentation/perf-config.txt line 257

Quoted 3 lines
tools/perf/Documentation/perf-config.txt new file +3 -0
+
+	call-graph.dump-size::
+		When using dwarf into record-mode this option should have a value.

The size of stack to dump in order to do post-unwinding. Default is 8192 (byte).

tools/perf/Documentation/perf-config.txt line 260

Quoted 3 lines
tools/perf/Documentation/perf-config.txt new file +3 -0
+
+	call-graph.print-type::
+		The print-types can be graph (graph absolute), flat, fractal (graph relative).

This option controls a way to show overhead for each callchain entry. Suppose a following example.

 Overhead  Symbols
 ........  .......
   40.00%  foo
           |
	   --- foo
	       |
	       |--50.00%-- bar
	       |           main
	       |
	        --50.00%-- baz
	                   main

This output is a default format which is 'fractal'. The 'foo' came from 'bar' and 'baz' exactly half and half so 'fractal' shows 50.00% for each (meaning that it assumes 100% total overhead of 'foo').

The 'graph' uses absolute overhead value of 'foo' as total so each of 'bar' and 'baz' callchain will have 20.00% of overhead.

I don't know what 'flat' should look like.. ;-P

tools/perf/Documentation/perf-config.txt line 264

Quoted 4 lines
tools/perf/Documentation/perf-config.txt new file +4 -0
+
+	call-graph.order::
+		This option means the criterion of call-graph.
+		A value of 'order' can be 'caller' or 'callee’.

This option controls print order of callchains. The default is 'callee' which means callee is printed at top and then followed by its caller and so on. The 'caller' prints it in reverse order.

tools/perf/Documentation/perf-config.txt line 268

Quoted 4 lines
tools/perf/Documentation/perf-config.txt new file +4 -0
+
+	call-graph.sort-key::
+			A value of 'sort-key' can be 'function' or 'address’.
+			The default is ‘function’.

The callchains are merged if they contain same information. The sort-key option determines a way to compare the callchains.

tools/perf/Documentation/perf-config.txt line 270

Quoted 2 lines
tools/perf/Documentation/perf-config.txt new file +2 -0
+
+	call-graph.threshold::

When there're many callchains it'd print tons of lines. So perf omits small callchains under a certain overhead (threshold) and this option control the threashold. Default is 0.5 (%).

tools/perf/Documentation/perf-config.txt line 271

Quoted 1 line
tools/perf/Documentation/perf-config.txt new file +1 -0
+	call-graph.print-limit::

This is another way to control the number of callchains printed for a single entry. Default is 0 which means no limitation.

tools/perf/Documentation/perf-config.txt line 276

Quoted 5 lines
tools/perf/Documentation/perf-config.txt new file +5 -0
+
+report.*::
+	report.percent-limit::
+		If percent-limit is 70, the output which has percentages of 
+		each overhead above 70% can be printed.

This one is mostly same as call-graph.threshold but works for histogram entries. Entries have overhead lower than this percentage will not be printed. Default is 0.

tools/perf/Documentation/perf-config.txt line 279

Quoted 3 lines
tools/perf/Documentation/perf-config.txt new file +3 -0
+	report.children::
+		The children means that functions called from another function.
+		If the option is positive, accumulate callchain of children and show total overhead.

s/positive/true/

Quoted 57 lines
tools/perf/Documentation/perf-config.txt new file +57 -0
+		For example, there’re three functions like below.
+
+		 void foo(void) {
+		   /* do something */
+		 }
+
+		 void bar(void) {
+		   /* do something */
+		   foo();
+		 }
+
+		 int main(void) {
+		   bar()
+		   return 0;
+		 }
+
+		Defaultly the output of sub-commands such as ’top’, ‘report’ and ‘annotate’
+		depend on a sort of overhead into each functions as below.
+	
+		Overhead  Symbol
+		........  .....................
+		  60.00%  foo
+		          |
+		          --- foo
+		              bar
+		              main
+		              __libc_start_main
+
+		  40.00%  bar
+		          |
+		          --- bar
+		              main
+		              __libc_start_main
+
+		But if this option is positive, the sort is changed into a sort of
+		overhead into each children group of each function  reciting all functions 
+		from a first parent function till a last child function like below.
+		And it requires -g/--call-graph option enabled
+
+		Children      Self  Symbol
+		........  ........  ....................
+		 100.00%     0.00%  __libc_start_main
+		          |
+		          --- __libc_start_main
+
+		 100.00%     0.00%  main
+		          |
+		          --- main
+		              __libc_start_main
+
+		 100.00%    40.00%  bar
+		          |
+		          --- bar
+		              main
+		              __libc_start_main
+
+		  60.00%    60.00%  foo

tools/perf/Documentation/perf-config.txt line 346

Quoted 10 lines
tools/perf/Documentation/perf-config.txt new file +10 -0
+		          |
+		          --- foo
+		              bar
+		              main
+		              __libc_start_main
+
+top.*::
+	top.children::
+		This option means same as report.children.
+		So it is positive, the output of ‘top’ is rearranged by each overhead into children group.

Ditto. s/positive/true/

Thanks,
Namhyung

Quoted 196 lines
tools/perf/Documentation/perf-config.txt new file +4 -0
+
+SEE ALSO
+--------
+linkperf:perf[1]
tools/perf/Documentation/perfconfig.example +52 -11
index 767ea24..86d0e0c 100644
@@ -1,29 +1,70 @@
 [colors]
-
-	# These were the old defaults
-	top = red, lightgray
-	medium = green, lightgray
-	normal = black, lightgray
-	selected = lightgray, magenta
-	code = blue, lightgray
-	addr = magenta, lightgray
+	# There are types of colors which are red,
+	# green, default, black, blue,
+	# white, magenta, lightgray
+	# The default is like below
+	top = red, default
+	medium = green, default
+	normal = lightgray, default
+	selected = white, lightgray
+	code = blue, default
+	addr = magenta, default
+	root = white, blue
 
 [tui]
-
 	# Defaults if linked with libslang
 	report = on
 	annotate = on
 	top = on
 
 [buildid]
-
 	# Default, disable using /dev/null
 	dir = /root/.debug
 
 [annotate]
-
 	# Defaults
 	hide_src_code = false
 	use_offset = true
 	jump_arrows = true
 	show_nr_jumps = false
+
+[gtk]
+	report = off
+	annotate = off
+	#top = off
+
+[pager]
+	# That a 'cmd' is true mean to use "pager or less"
+	cmd = true
+
+[help]
+	# Format can be man, info, web or html
+	format = man
+	autocorrect = 0
+
+[hist]
+	# a value of 'percentage' can be 'relative' or 'absolute'
+	percentage = absolute
+
+[ui]
+	show-headers= true
+
+[call-graph]
+	# fp (framepointer), dwarf
+	record-mode = fp
+
+	# graph (graph absolute), flat, fractal (graph relative)
+	print-type = fractal
+
+	# caller, callee
+	order = caller
+
+	# function, address
+	sort-key = function
+
+[report]
+	percent-limit = 1
+	children = false
+
+[top]
+	children = true
tools/perf/builtin-config.c new file +56 -0
new file mode 100644
index 0000000..cb4e72e
@@ -0,0 +1,56 @@
+/*
+ * builtin-config.c
+ *
+ * Copyright (C) 2015, Taeung Song <[email protected]>
+ *
+ */
+#include "builtin.h"
+
+#include "perf.h"
+
+#include "util/cache.h"
+#include "util/parse-options.h"
+#include "util/util.h"
+#include "util/debug.h"
+
+static struct {
+	bool list_action;
+} params;
+
+static int show_all_config(const char *key, const char *value,
+			   void *cb __maybe_unused)
+{
+	if (value)
+		printf("%s=%s\n", key, value);
+	else
+		printf("%s\n", key);
+
+	return 0;
+}
+
+int cmd_config(int argc, const char **argv, const char *prefix __maybe_unused)
+{
+	int ret = 0;
+	const char * const config_usage[] = {
+		"perf config --list",
+		NULL
+	};
+	const struct option options[] = {
+		OPT_BOOLEAN('l', "list", &params.list_action, "list up current configurations"),
+		OPT_END()
+	};
+
+	argc = parse_options(argc, argv, options, config_usage,
+			     PARSE_OPT_STOP_AT_NON_OPTION);
+	if (argc > 0) {
+		if (strcmp(argv[0], "-") == 0)
+			pr_warning("  Error: '-' is not supported.\n");
+
+		usage_with_options(config_usage, options);
+	}
+
+	if (params.list_action)
+		ret = perf_config(show_all_config, NULL);
+
+	return ret;
+}
tools/perf/builtin.h +1 -0
index 3688ad2..3f871b5 100644
@@ -17,6 +17,7 @@ extern int cmd_annotate(int argc, const char **argv, const char *prefix);
 extern int cmd_bench(int argc, const char **argv, const char *prefix);
 extern int cmd_buildid_cache(int argc, const char **argv, const char *prefix);
 extern int cmd_buildid_list(int argc, const char **argv, const char *prefix);
+extern int cmd_config(int argc, const char **argv, const char *prefix);
 extern int cmd_diff(int argc, const char **argv, const char *prefix);
 extern int cmd_evlist(int argc, const char **argv, const char *prefix);
 extern int cmd_help(int argc, const char **argv, const char *prefix);
tools/perf/command-list.txt +1 -0
index 00fcaf8..acc3ea7 100644
@@ -9,6 +9,7 @@ perf-buildid-cache		mainporcelain common
 perf-buildid-list		mainporcelain common
 perf-data			mainporcelain common
 perf-diff			mainporcelain common
+perf-config			mainporcelain common
 perf-evlist			mainporcelain common
 perf-inject			mainporcelain common
 perf-kmem			mainporcelain common
tools/perf/perf.c +1 -0
index b857fcb..604fa4a 100644
@@ -37,6 +37,7 @@ struct cmd_struct {
 static struct cmd_struct commands[] = {
 	{ "buildid-cache", cmd_buildid_cache, 0 },
 	{ "buildid-list", cmd_buildid_list, 0 },
+	{ "config",	cmd_config,	0 },
 	{ "diff",	cmd_diff,	0 },
 	{ "evlist",	cmd_evlist,	0 },
 	{ "help",	cmd_help,	0 },
Signature · 7 lines
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/
#2 lore raw
In reply to Taeung
Quoted 5 lines · Taeung

The perf configuration file contain many variables which can make
the perf command's action more effective and more skilful.
But looking through state of configuration is difficult and
there's no knowing what kind of other variables except variables in perfconfig.example exist. So This patch adds a command 'config --list' and a document for it.

this looks quite usefull, thanks for doing this!
some comments below..

missing Signed-off-by: tag

also please remove the trailing whitespace:

[jolsa@krava perf]$ git am /tmp/c/
Applying: perf config : Adding a command 'config' with a option '--list' and a document for it. /home/jolsa/kernel.org/linux-perf/.git/rebase-apply/patch:79: trailing whitespace.
# Color variables
/home/jolsa/kernel.org/linux-perf/.git/rebase-apply/patch:84: trailing whitespace.
code = blue, default
/home/jolsa/kernel.org/linux-perf/.git/rebase-apply/patch:124: trailing whitespace.
Color variables can appoint colors of the output which is printed out
/home/jolsa/kernel.org/linux-perf/.git/rebase-apply/patch:127: trailing whitespace.
and should have two values for them. If you want to set as colors
/home/jolsa/kernel.org/linux-perf/.git/rebase-apply/patch:131: trailing whitespace.

warning: squelched 22 whitespace errors
warning: 27 lines add whitespace errors.

Quoted 17 lines
---
 tools/perf/Build                            |   1 +
 tools/perf/Documentation/perf-config.txt    | 350 ++++++++++++++++++++++++++++
 tools/perf/Documentation/perfconfig.example |  63 ++++-
 tools/perf/builtin-config.c                 |  56 +++++
 tools/perf/builtin.h                        |   1 +
 tools/perf/command-list.txt                 |   1 +
 tools/perf/perf.c                           |   1 +
 7 files changed, 462 insertions(+), 11 deletions(-)
 create mode 100644 tools/perf/Documentation/perf-config.txt
 create mode 100644 tools/perf/builtin-config.c
tools/perf/Documentation/perf-config.txt new file +2 -0
+		│1 1382:   movb   $0x1,-0x270(%rbp)
+

tools/perf/Documentation/perf-config.txt line 228

Quoted 10 lines
tools/perf/Documentation/perf-config.txt new file +10 -0
+help.*::
+	help.format:: = man
+		A format of manual page can be ‘man’, ‘info’, ‘web’ or ‘html’.
+		’man’ is default.
+	help.autocorrect:: = 0
+		Automatically correct and execute mistyped commands after
+		waiting for the given number of deciseconds (0.1 sec).
+		When this option is 0 if execute a mistyped sub-command instead of ‘top’,
+
+		perf: 'ttop' is not a perf-command. See 'perf --help’.

please use some king of spell check, it'd catch things like above 's/ttop/top/'

Quoted 8 lines
tools/perf/Documentation/perf-config.txt new file +8 -0
+
+		If this option is more than 1, the output can be such as.
+
+		WARNING: You called a perf program named 'ttop', which does not exist.
+		Continuing under the assumption that you meant 'with-kcore'
+		in 0.1 seconds automatically...
+		Usage: perf-with-kcore <perf sub-command> <perf.data directory> [<sub-command options> [ -- <workload>]]
+       		<perf sub-command> can be record, script, report or inject		

tools/perf/Documentation/perf-config.txt line 246

Quoted 10 lines
tools/perf/Documentation/perf-config.txt new file +10 -0
+		    or: perf-with-kcore fix_buildid_cache_permissions
+
+hist.*::
+	hist.percentage::
+		A value of 'percentage' can be 'relative' or 'absolute'
+
+ui.*::
+	ui.show-headers::
+		There’re columns as header ‘Overhead’, ‘Children’, ‘Shared Object’, ‘Symbol’, ’self’.
+		If this option is negative, they is hided.

s/^^^/If this option is not set, they are hidden./

Quoted 4 lines
tools/perf/Documentation/perf-config.txt new file +4 -0
+
+call-graph.*::
+	When sub-commands ‘top’ and ‘report’ work with -g/—-children 
+	there’re options in control of call-graph.

tools/perf/Documentation/perf-config.txt line 260

Quoted 10 lines
tools/perf/Documentation/perf-config.txt new file +10 -0
+
+	call-graph.record-mode::
+		The record-mode can be ‘fp’ (frame pointer) and ‘dwarf’.
+		If using 'Dwarf style', it requires dump-size has a value.
+
+	call-graph.dump-size::
+		When using dwarf into record-mode this option should have a value.
+
+	call-graph.print-type::
+		The print-types can be graph (graph absolute), flat, fractal (graph relative).

SNIP

missing following variables:

man.viewer::

    ...

report.queue-size::
option to setup the maximum allocation size for session's ordered events queue, if not set there's no default limit

SNIP

tools/perf/Documentation/perfconfig.example line 38

Quoted 10 lines
tools/perf/Documentation/perfconfig.example +9 -0
 	show_nr_jumps = false
+
+[gtk]
+	report = off
+	annotate = off
+	#top = off
+
+[pager]
+	# That a 'cmd' is true mean to use "pager or less"
+	cmd = true

hum, should this work more like:

[pager]
report = false
diff = true

but I've never used it, so I'm not sure ;-)

SNIP

tools/perf/builtin-config.c line 40

Quoted 11 lines
tools/perf/builtin-config.c new file +11 -0
+
+int cmd_config(int argc, const char **argv, const char *prefix __maybe_unused)
+{
+	int ret = 0;
+	const char * const config_usage[] = {
+		"perf config --list",
+		NULL
+	};
+	const struct option options[] = {
+		OPT_BOOLEAN('l', "list", &params.list_action, "list up current configurations"),
+		OPT_END()

setting and getting options would be nice I guess

thanks,
jirka