diff options
author | Adrian Hunter <adrian.hunter@intel.com> | 2013-11-18 11:55:56 +0200 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2013-11-27 14:58:36 -0300 |
commit | 167faf32b07fc47637048fbcbdfcf4a89481686d (patch) | |
tree | 21c8954cbf3a7c9b29bd83709d22c24418bb6c6b /tools/perf/util/parse-options.c | |
parent | 4bc437964ef540462bd15af4a713da62961809aa (diff) | |
download | linux-167faf32b07fc47637048fbcbdfcf4a89481686d.tar.gz linux-167faf32b07fc47637048fbcbdfcf4a89481686d.tar.bz2 linux-167faf32b07fc47637048fbcbdfcf4a89481686d.zip |
perf tools: Add option macro OPT_BOOLEAN_SET
OPT_BOOLEAN_SET records whether a boolean option was set by the user.
That information can be used to change the default value for the option
after the options have been parsed.
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Mike Galbraith <efault@gmx.de>
Cc: Namhyung Kim <namhyung@gmail.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lkml.kernel.org/r/1384768557-23331-4-git-send-email-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/parse-options.c')
-rw-r--r-- | tools/perf/util/parse-options.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tools/perf/util/parse-options.c b/tools/perf/util/parse-options.c index b6b39ff14fbb..d22e3f8017dc 100644 --- a/tools/perf/util/parse-options.c +++ b/tools/perf/util/parse-options.c @@ -78,6 +78,8 @@ static int get_value(struct parse_opt_ctx_t *p, case OPTION_BOOLEAN: *(bool *)opt->value = unset ? false : true; + if (opt->set) + *(bool *)opt->set = true; return 0; case OPTION_INCR: |