public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arjan van de Ven <arjan@infradead.org>
To: linux-kernel@vger.kernel.org
Cc: Arjan van de Ven <arjan@infradead.org>,
	mingo@elte.hu, fweisbec@gmail.com, peterz@infradead.org
Subject: [PATCH 3/8] perf: Allow perf utilities to have "callback" options without arguments
Date: Sat, 12 Sep 2009 13:04:40 +0200	[thread overview]
Message-ID: <20090912130440.548666c1@infradead.org> (raw)
In-Reply-To: <20090912130306.5d0086ea@infradead.org>


>From b37c714203e12c2104b2fae41c6f4ea4fa589528 Mon Sep 17 00:00:00 2001
From: Arjan van de Ven <arjan@linux.intel.com>
Date: Sat, 12 Sep 2009 07:52:54 +0200
Subject: [PATCH] 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>
---
 tools/perf/util/parse-options.h |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/tools/perf/util/parse-options.h b/tools/perf/util/parse-options.h
index 8aa3464..2ee248f 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 }
 
-- 
1.6.0.6



-- 
Arjan van de Ven 	Intel Open Source Technology Centre
For development, discussion and tips for power savings, 
visit http://www.lesswatts.org

  parent reply	other threads:[~2009-09-12 11:04 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20090912130306.5d0086ea@infradead.org>
2009-09-12 11:03 ` [PATCH 1/8] perf: Add a timestamp to fork events Arjan van de Ven
2009-09-19  9:51   ` [tip:perfcounters/core] " tip-bot for Arjan van de Ven
2009-09-12 11:04 ` [PATCH 2/8] perf: Store trace event name/id pairs in perf.data Arjan van de Ven
2009-09-19  9:31   ` Ingo Molnar
2009-09-19  9:51   ` [tip:perfcounters/core] " tip-bot for Arjan van de Ven
2009-09-12 11:04 ` Arjan van de Ven [this message]
2009-09-19  9:52   ` [tip:perfcounters/core] perf: Allow perf utilities to have "callback" options without arguments tip-bot for Arjan van de Ven
2009-09-12 11:05 ` [PATCH 4/8] perf: Add a sample_event type to the event_union Arjan van de Ven
2009-09-19  9:52   ` [tip:perfcounters/core] " tip-bot for Arjan van de Ven
2009-09-12 11:05 ` [PATCH 5/8] trace: Convert the power tracer into an event tracer Arjan van de Ven
2009-09-15  3:43   ` Li Zefan
2009-09-15  4:16     ` Arjan van de Ven
2009-09-19  9:52   ` [tip:perfcounters/core] tracing, perf: " tip-bot for Arjan van de Ven
2009-09-12 11:06 ` [PATCH 6/8] perf: Add a SVG helper library file Arjan van de Ven
2009-09-19  9:52   ` [tip:perfcounters/core] " tip-bot for Arjan van de Ven
2009-09-12 11:06 ` [PATCH 7/8] perf: Add a perf record --timechart option Arjan van de Ven
2009-09-14  8:06   ` Peter Zijlstra
2009-09-14 20:33     ` Arjan van de Ven
2009-09-19  9:44       ` Ingo Molnar
2009-09-19 11:03         ` [PATCH] perf: Add "perf timechart record" Arjan van de Ven
2009-09-12 11:07 ` [PATCH 8/8] perf: Add the timechart tool Arjan van de Ven
2009-09-19  9:48   ` Ingo Molnar
2009-09-19  9:51     ` Ingo Molnar
2009-09-19  9:53   ` [tip:perfcounters/core] " tip-bot for Arjan van de Ven

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=20090912130440.548666c1@infradead.org \
    --to=arjan@infradead.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox