From: Arjan van de Ven Date: Sat, 12 Sep 2009 05:52:54 +0000 (+0200) Subject: perf: Allow perf utilities to have "callback" options without arguments X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a79d7db9fdb0037925ffa31f6ff9b189ff75d235;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git perf: Allow perf utilities to have "callback" options without arguments timechart needs to add a "callback" type command line argument that does not take arguments. This patch adds the parse-options.h infrastructure to make this possible. Signed-off-by: Arjan van de Ven Acked-by: Peter Zijlstra Cc: Paul Mackerras Cc: Frederic Weisbecker LKML-Reference: <20090912130440.548666c1@infradead.org> Signed-off-by: Ingo Molnar --- diff --git a/tools/perf/util/parse-options.h b/tools/perf/util/parse-options.h index 8aa3464c7090..2ee248ff27e5 100644 --- a/tools/perf/util/parse-options.h +++ b/tools/perf/util/parse-options.h @@ -104,6 +104,8 @@ struct option { { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = "time", .help = (h), .callback = parse_opt_approxidate_cb } #define OPT_CALLBACK(s, l, v, a, h, f) \ { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), (a), .help = (h), .callback = (f) } +#define OPT_CALLBACK_NOOPT(s, l, v, a, h, f) \ + { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), (a), .help = (h), .callback = (f), .flags = PARSE_OPT_NOARG } #define OPT_CALLBACK_DEFAULT(s, l, v, a, h, f, d) \ { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), (a), .help = (h), .callback = (f), .defval = (intptr_t)d, .flags = PARSE_OPT_LASTARG_DEFAULT }