From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753536AbbCIJSk (ORCPT ); Mon, 9 Mar 2015 05:18:40 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35528 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752954AbbCIJSj (ORCPT ); Mon, 9 Mar 2015 05:18:39 -0400 Date: Mon, 9 Mar 2015 10:18:33 +0100 From: Jiri Olsa To: Taeung Cc: linux-kernel@vger.kernel.org, namhyung@kernel.org, Arnaldo Carvalho de Melo Subject: Re: [PATCH] perf config : Adding a command 'config' with a option '--list' and a document for it. Message-ID: <20150309091833.GE27885@krava.brq.redhat.com> References: <1425731405-12664-1-git-send-email-treeze.taeung@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1425731405-12664-1-git-send-email-treeze.taeung@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Mar 07, 2015 at 09:30:05PM +0900, Taeung wrote: > 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. > --- > 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 > > + │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’. please use some king of spell check, it'd catch things like above 's/ttop/top/' > + > + 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 [ [ -- ]] > + 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' > + > +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./ > + > +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. > + > + 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 > 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 > + > +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", ¶ms.list_action, "list up current configurations"), > + OPT_END() setting and getting options would be nice I guess thanks, jirka