linux/tools/perf
Frederic Weisbecker 5a4b181721 perf_counter tools: Add new OPT_CALLBACK_DEFAULT option
There is no predefined macro to create an option that can have
a custom value or a default one if none is given.

This patch provides a new helper OPT_CALLBACK_DEFAULT() which
defines such kind of option.

For example, considering an option -c, we want to get the
default value in the following cases:

    perf command -c -d
    perf command -d -c

And the foo value when it's given:

    perf command -c foo -d
    perf command -d -c foo

That's also why PARSE_OPT_LASTARG_DEFAULT is extended here to
support default values whatever the position of the option, not
only in the end.

Should it now be renamed to PARSE_OPT_ARG_DEFAULT ?

Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Anton Blanchard <anton@samba.org>
Cc: Arnaldo Carvalho de Melo <acme@redhat.com>
Cc: git@vger.kernel.org
LKML-Reference: <1246550301-8954-2-git-send-email-fweisbec@gmail.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2009-07-02 20:47:14 +02:00
..
Documentation perf report: Add --symbols parameter 2009-07-01 00:07:10 +02:00
util perf_counter tools: Add new OPT_CALLBACK_DEFAULT option 2009-07-02 20:47:14 +02:00
.gitignore perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
CREDITS perf_counter tools: Add CREDITS file for Git contributors 2009-06-24 19:54:29 +02:00
Makefile perf_counter tools: Add infrastructure to support loading of kernel module symbols 2009-07-02 08:42:20 +02:00
builtin-annotate.c perf_counter tools: Enable kernel module symbol loading in tools 2009-07-02 08:42:21 +02:00
builtin-help.c perf_counter tools: Add more warnings and fix/annotate them 2009-07-01 12:49:48 +02:00
builtin-list.c perf_counter tools: Add more warnings and fix/annotate them 2009-07-01 12:49:48 +02:00
builtin-record.c perf_counter tools: Add more warnings and fix/annotate them 2009-07-01 12:49:48 +02:00
builtin-report.c perf_counter tools: Enable kernel module symbol loading in tools 2009-07-02 08:42:21 +02:00
builtin-stat.c perf stat: Handle pipe read failures in perf stat 2009-07-01 22:37:24 +02:00
builtin-top.c perf_counter tools: Enable kernel module symbol loading in tools 2009-07-02 08:42:21 +02:00
builtin.h perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
command-list.txt perf_counter tools: Move from Documentation/perf_counter/ to tools/perf/ 2009-06-06 20:33:43 +02:00
design.txt perf_counter: Start documenting HAVE_PERF_COUNTERS requirements 2009-06-12 19:37:30 +02:00
perf.c perf_counter tools: Add more warnings and fix/annotate them 2009-07-01 12:49:48 +02:00
perf.h perf_counter tools: Add more warnings and fix/annotate them 2009-07-01 12:49:48 +02:00