Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1292292 > unrolled thread

[PATCH v4 3/9] perf: Document the fact that parse_options*() may exit

Started byJosh Poimboeuf <jpoimboe@redhat.com>
First post2015-12-15 16:50 +0100
Last post2015-12-18 10:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH v4 3/9] perf: Document the fact that parse_options*() may exit Josh Poimboeuf <jpoimboe@redhat.com> - 2015-12-15 16:50 +0100
    [tip:perf/core] perf tools: Document the fact that parse_options*  () may exit tip-bot for Josh Poimboeuf <tipbot@zytor.com> - 2015-12-18 10:00 +0100

#1292292 — [PATCH v4 3/9] perf: Document the fact that parse_options*() may exit

FromJosh Poimboeuf <jpoimboe@redhat.com>
Date2015-12-15 16:50 +0100
Subject[PATCH v4 3/9] perf: Document the fact that parse_options*() may exit
Message-ID<qG01s-68o-27@gated-at.bofh.it>
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>
---
 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,
-- 
2.4.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1294533 — [tip:perf/core] perf tools: Document the fact that parse_options* () may exit

Fromtip-bot for Josh Poimboeuf <tipbot@zytor.com>
Date2015-12-18 10:00 +0100
Subject[tip:perf/core] perf tools: Document the fact that parse_options* () may exit
Message-ID<qGZ3k-3mL-21@gated-at.bofh.it>
In reply to#1292292
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,
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web