public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: tip-bot for Josh Poimboeuf <tipbot@zytor.com>
To: linux-tip-commits@vger.kernel.org
Cc: peterz@infradead.org, tglx@linutronix.de, acme@redhat.com,
	linux-kernel@vger.kernel.org, mingo@kernel.org,
	namhyung@kernel.org, jolsa@redhat.com, hpa@zytor.com,
	jpoimboe@redhat.com
Subject: [tip:perf/core] perf tools: Document the fact that parse_options* () may exit
Date: Fri, 18 Dec 2015 00:52:40 -0800	[thread overview]
Message-ID: <tip-24a88bdd05d5de32f3a56a4dcc5070c97d4a514f@git.kernel.org> (raw)
In-Reply-To: <97b1af06cc3b18dd0f49e655d6d659eaa64ecde5.1450193761.git.jpoimboe@redhat.com>

Commit-ID:  24a88bdd05d5de32f3a56a4dcc5070c97d4a514f
Gitweb:     http://git.kernel.org/tip/24a88bdd05d5de32f3a56a4dcc5070c97d4a514f
Author:     Josh Poimboeuf <jpoimboe@redhat.com>
AuthorDate: Tue, 15 Dec 2015 09:39:34 -0600
Committer:  Arnaldo Carvalho de Melo <acme@redhat.com>
CommitDate: Wed, 16 Dec 2015 16:16:49 -0300

perf tools: Document the fact that parse_options*() may exit

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 1231960..d1544069 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,

  reply	other threads:[~2015-12-18  8:53 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-15 15:39 [PATCH v4 0/9] perf tools: Move perf subcommand framework to a library Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 1/9] tools build: Fix feature Makefile issues with 'O=' Josh Poimboeuf
2015-12-18  8:51   ` [tip:perf/core] tools build: Fix feature Makefile issues with 'O= ' tip-bot for Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 2/9] perf tools: Move strlcpy() from perf to tools/lib/string.c Josh Poimboeuf
2015-12-18  8:52   ` [tip:perf/core] perf tools: Move strlcpy() from perf to tools/lib /string.c tip-bot for Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 3/9] perf: Document the fact that parse_options*() may exit Josh Poimboeuf
2015-12-18  8:52   ` tip-bot for Josh Poimboeuf [this message]
2015-12-15 15:39 ` [PATCH v4 4/9] perf: Provide subcmd configuration at runtime Josh Poimboeuf
2015-12-18  8:53   ` [tip:perf/core] perf tools: " tip-bot for Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 5/9] perf: Remove subcmd dependencies on strbuf Josh Poimboeuf
2015-12-18  8:53   ` [tip:perf/core] perf tools: " tip-bot for Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 6/9] perf: Remove 'perf' from subcmd function and variable names Josh Poimboeuf
2015-12-18  8:53   ` [tip:perf/core] perf tools: " tip-bot for Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 7/9] perf: Finalize subcmd independence Josh Poimboeuf
2015-12-17  0:57   ` Arnaldo Carvalho de Melo
2015-12-17  1:09     ` Josh Poimboeuf
2015-12-17  1:27       ` Arnaldo Carvalho de Melo
2015-12-17  4:12         ` Josh Poimboeuf
2015-12-18  8:54   ` [tip:perf/core] perf tools: " tip-bot for Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 8/9] perf subcmd: Create subcmd library Josh Poimboeuf
2015-12-18  8:54   ` [tip:perf/core] " tip-bot for Josh Poimboeuf
2015-12-15 15:39 ` [PATCH v4 9/9] tools subcmd: Rename subcmd header include guards Josh Poimboeuf
2015-12-18  8:54   ` [tip:perf/core] " tip-bot for Josh Poimboeuf

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=tip-24a88bdd05d5de32f3a56a4dcc5070c97d4a514f@git.kernel.org \
    --to=tipbot@zytor.com \
    --cc=acme@redhat.com \
    --cc=hpa@zytor.com \
    --cc=jolsa@redhat.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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