From: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
To: linux-kernel@vger.kernel.org
Cc: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>,
Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
Peter Zijlstra <peterz@infradead.org>,
Paul Mackerras <paulus@samba.org>, Ingo Molnar <mingo@elte.hu>,
Arnaldo Carvalho de Melo <acme@ghostprotocols.net>,
linux-kernel@vger.kernel.org
Subject: [PATCH -tip 1/7] perf: add OPT_CALLBACK_DEFAULT_NOOPT
Date: Fri, 03 Dec 2010 12:58:53 +0900 [thread overview]
Message-ID: <20101203035853.7827.17502.stgit@localhost6.localdomain6> (raw)
In-Reply-To: <20101203035832.7827.16528.stgit@localhost6.localdomain6>
Add new macro OPT_CALLBACK_DEFAULT_NOOPT for parse_options.
It enables to pass the default value (opt->defval) to the callback function
processing options require no argument.
Signed-off-by: Akihiro Nagai <akihiro.nagai.hw@hitachi.com>
Cc: Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
Cc: linux-kernel@vger.kernel.org
---
tools/perf/util/parse-options.h | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/tools/perf/util/parse-options.h b/tools/perf/util/parse-options.h
index c7d72dc..abc31a1 100644
--- a/tools/perf/util/parse-options.h
+++ b/tools/perf/util/parse-options.h
@@ -119,6 +119,10 @@ struct option {
{ .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 }
+#define OPT_CALLBACK_DEFAULT_NOOPT(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 | PARSE_OPT_NOARG}
/* parse_options() will filter out the processed options and leave the
* non-option argments in argv[].
next prev parent reply other threads:[~2010-12-03 4:00 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-03 3:58 [PATCH -tip 0/7] perf: Introduce bts sub commands Akihiro Nagai
2010-12-03 3:58 ` Akihiro Nagai [this message]
2010-12-06 2:23 ` [PATCH -tip 1/7] perf: add OPT_CALLBACK_DEFAULT_NOOPT Masami Hiramatsu
2010-12-07 6:56 ` [tip:perf/core] perf options: " tip-bot for Akihiro Nagai
2010-12-03 3:59 ` [PATCH -tip 2/7] perf: Introduce perf sub command 'bts record' Akihiro Nagai
2010-12-06 2:26 ` Masami Hiramatsu
2010-12-03 3:59 ` [PATCH -tip 3/7] perf bts: Introduce new sub command 'perf bts trace' Akihiro Nagai
2010-12-06 3:10 ` Masami Hiramatsu
2010-12-03 3:59 ` [PATCH -tip 4/7] perf bts trace: print pid and command Akihiro Nagai
2010-12-06 3:16 ` Masami Hiramatsu
2010-12-03 3:59 ` [PATCH -tip 5/7] perf bts trace: print file path of the executed elf Akihiro Nagai
2010-12-06 3:17 ` Masami Hiramatsu
2010-12-03 4:00 ` [PATCH -tip 6/7] perf bts trace: print function+offset Akihiro Nagai
2010-12-03 13:00 ` Peter Zijlstra
2010-12-06 10:08 ` Akihiro Nagai
2010-12-06 2:42 ` Frederic Weisbecker
2010-12-06 10:28 ` Akihiro Nagai
2010-12-06 3:20 ` Masami Hiramatsu
2010-12-03 4:00 ` [PATCH -tip 7/7] perf bts trace: add print all option Akihiro Nagai
2010-12-06 3:20 ` Masami Hiramatsu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20101203035853.7827.17502.stgit@localhost6.localdomain6 \
--to=akihiro.nagai.hw@hitachi.com \
--cc=acme@ghostprotocols.net \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=mingo@elte.hu \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.