Skip to content

Commit a79d7db

Browse files
fenrus75Ingo Molnar
authored andcommitted
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 <arjan@linux.intel.com> Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Paul Mackerras <paulus@samba.org> Cc: Frederic Weisbecker <fweisbec@gmail.com> LKML-Reference: <20090912130440.548666c1@infradead.org> Signed-off-by: Ingo Molnar <mingo@elte.hu>
1 parent 8755a8f commit a79d7db

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

‎tools/perf/util/parse-options.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,8 @@ struct option {
104104
{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = "time", .help = (h), .callback = parse_opt_approxidate_cb }
105105
#define OPT_CALLBACK(s, l, v, a, h, f) \
106106
{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), (a), .help = (h), .callback = (f) }
107+
#define OPT_CALLBACK_NOOPT(s, l, v, a, h, f) \
108+
{ .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), (a), .help = (h), .callback = (f), .flags = PARSE_OPT_NOARG }
107109
#define OPT_CALLBACK_DEFAULT(s, l, v, a, h, f, d) \
108110
{ .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 }
109111

0 commit comments

Comments
 (0)