public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	Jiri Olsa <jolsa@redhat.com>, Namhyung Kim <namhyung@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	Arnaldo Carvalho de Melo <acme@redhat.com>
Subject: [PATCH 04/10] perf tools: Document the fact that parse_options*() may exit
Date: Wed, 16 Dec 2015 21:47:57 -0300	[thread overview]
Message-ID: <1450313283-25348-5-git-send-email-acme@kernel.org> (raw)
In-Reply-To: <1450313283-25348-1-git-send-email-acme@kernel.org>

From: Josh Poimboeuf <jpoimboe@redhat.com>

Generally, calling exit() from a library is bad practice.  Eventually
these functions might be redesigned so that they don't exit.  For now,
just document the fact that they do.

Signed-off-by: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/97b1af06cc3b18dd0f49e655d6d659eaa64ecde5.1450193761.git.jpoimboe@redhat.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/util/parse-options.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/tools/perf/util/parse-options.h b/tools/perf/util/parse-options.h
index 1231960d6148..d1544069c7c0 100644
--- a/tools/perf/util/parse-options.h
+++ b/tools/perf/util/parse-options.h
@@ -152,6 +152,9 @@ struct option {
 /* parse_options() will filter out the processed options and leave the
  * non-option argments in argv[].
  * Returns the number of arguments left in argv[].
+ *
+ * NOTE: parse_options() and parse_options_subcommand() may call exit() in the
+ * case of an error (or for 'special' options like --list-cmds or --list-opts).
  */
 extern int parse_options(int argc, const char **argv,
                          const struct option *options,
-- 
2.1.0


  parent reply	other threads:[~2015-12-17  0:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-17  0:47 [GIT PULL 00/10] perf/core improvements Arnaldo Carvalho de Melo
2015-12-17  0:47 ` [PATCH 01/10] perf record: Add record.build-id config option Arnaldo Carvalho de Melo
2015-12-17  0:47 ` [PATCH 02/10] tools build: Fix feature Makefile issues with 'O=' Arnaldo Carvalho de Melo
2015-12-17  0:47 ` [PATCH 03/10] perf tools: Move strlcpy() from perf to tools/lib/string.c Arnaldo Carvalho de Melo
2015-12-17  0:47 ` Arnaldo Carvalho de Melo [this message]
2015-12-17  0:47 ` [PATCH 05/10] perf tools: Provide subcmd configuration at runtime Arnaldo Carvalho de Melo
2015-12-17  0:47 ` [PATCH 06/10] perf tools: Remove subcmd dependencies on strbuf Arnaldo Carvalho de Melo
2015-12-17  0:48 ` [PATCH 07/10] perf tools: Remove 'perf' from subcmd function and variable names Arnaldo Carvalho de Melo
2015-12-17  0:48 ` [PATCH 08/10] perf tools: Finalize subcmd independence Arnaldo Carvalho de Melo
2015-12-17  0:48 ` [PATCH 09/10] perf subcmd: Create subcmd library Arnaldo Carvalho de Melo
2015-12-17  0:48 ` [PATCH 10/10] tools subcmd: Rename subcmd header include guards Arnaldo Carvalho de Melo
2015-12-17 17:37 ` [GIT PULL 00/10] perf/core improvements Arnaldo Carvalho de Melo
2015-12-18  8:39   ` Ingo Molnar

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=1450313283-25348-5-git-send-email-acme@kernel.org \
    --to=acme@kernel.org \
    --cc=acme@redhat.com \
    --cc=jolsa@redhat.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox