diff options
Diffstat (limited to 'tools/perf/util/parse-options.h')
-rw-r--r-- | tools/perf/util/parse-options.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tools/perf/util/parse-options.h b/tools/perf/util/parse-options.h index 5838e2d8bbc1..c7d72dce54b2 100644 --- a/tools/perf/util/parse-options.h +++ b/tools/perf/util/parse-options.h | |||
@@ -13,7 +13,7 @@ enum parse_opt_type { | |||
13 | OPTION_BIT, | 13 | OPTION_BIT, |
14 | OPTION_BOOLEAN, | 14 | OPTION_BOOLEAN, |
15 | OPTION_INCR, | 15 | OPTION_INCR, |
16 | OPTION_SET_INT, | 16 | OPTION_SET_UINT, |
17 | OPTION_SET_PTR, | 17 | OPTION_SET_PTR, |
18 | /* options with arguments (usually) */ | 18 | /* options with arguments (usually) */ |
19 | OPTION_STRING, | 19 | OPTION_STRING, |
@@ -79,7 +79,7 @@ typedef int parse_opt_cb(const struct option *, const char *arg, int unset); | |||
79 | * | 79 | * |
80 | * `defval`:: | 80 | * `defval`:: |
81 | * default value to fill (*->value) with for PARSE_OPT_OPTARG. | 81 | * default value to fill (*->value) with for PARSE_OPT_OPTARG. |
82 | * OPTION_{BIT,SET_INT,SET_PTR} store the {mask,integer,pointer} to put in | 82 | * OPTION_{BIT,SET_UINT,SET_PTR} store the {mask,integer,pointer} to put in |
83 | * the value when met. | 83 | * the value when met. |
84 | * CALLBACKS can use it like they want. | 84 | * CALLBACKS can use it like they want. |
85 | */ | 85 | */ |
@@ -101,16 +101,16 @@ struct option { | |||
101 | #define OPT_END() { .type = OPTION_END } | 101 | #define OPT_END() { .type = OPTION_END } |
102 | #define OPT_ARGUMENT(l, h) { .type = OPTION_ARGUMENT, .long_name = (l), .help = (h) } | 102 | #define OPT_ARGUMENT(l, h) { .type = OPTION_ARGUMENT, .long_name = (l), .help = (h) } |
103 | #define OPT_GROUP(h) { .type = OPTION_GROUP, .help = (h) } | 103 | #define OPT_GROUP(h) { .type = OPTION_GROUP, .help = (h) } |
104 | #define OPT_BIT(s, l, v, h, b) { .type = OPTION_BIT, .short_name = (s), .long_name = (l), .value = (v), .help = (h), .defval = (b) } | 104 | #define OPT_BIT(s, l, v, h, b) { .type = OPTION_BIT, .short_name = (s), .long_name = (l), .value = check_vtype(v, int *), .help = (h), .defval = (b) } |
105 | #define OPT_BOOLEAN(s, l, v, h) { .type = OPTION_BOOLEAN, .short_name = (s), .long_name = (l), .value = check_vtype(v, bool *), .help = (h) } | 105 | #define OPT_BOOLEAN(s, l, v, h) { .type = OPTION_BOOLEAN, .short_name = (s), .long_name = (l), .value = check_vtype(v, bool *), .help = (h) } |
106 | #define OPT_INCR(s, l, v, h) { .type = OPTION_INCR, .short_name = (s), .long_name = (l), .value = (v), .help = (h) } | 106 | #define OPT_INCR(s, l, v, h) { .type = OPTION_INCR, .short_name = (s), .long_name = (l), .value = check_vtype(v, int *), .help = (h) } |
107 | #define OPT_SET_INT(s, l, v, h, i) { .type = OPTION_SET_INT, .short_name = (s), .long_name = (l), .value = (v), .help = (h), .defval = (i) } | 107 | #define OPT_SET_UINT(s, l, v, h, i) { .type = OPTION_SET_UINT, .short_name = (s), .long_name = (l), .value = check_vtype(v, unsigned int *), .help = (h), .defval = (i) } |
108 | #define OPT_SET_PTR(s, l, v, h, p) { .type = OPTION_SET_PTR, .short_name = (s), .long_name = (l), .value = (v), .help = (h), .defval = (p) } | 108 | #define OPT_SET_PTR(s, l, v, h, p) { .type = OPTION_SET_PTR, .short_name = (s), .long_name = (l), .value = (v), .help = (h), .defval = (p) } |
109 | #define OPT_INTEGER(s, l, v, h) { .type = OPTION_INTEGER, .short_name = (s), .long_name = (l), .value = check_vtype(v, int *), .help = (h) } | 109 | #define OPT_INTEGER(s, l, v, h) { .type = OPTION_INTEGER, .short_name = (s), .long_name = (l), .value = check_vtype(v, int *), .help = (h) } |
110 | #define OPT_UINTEGER(s, l, v, h) { .type = OPTION_UINTEGER, .short_name = (s), .long_name = (l), .value = check_vtype(v, unsigned int *), .help = (h) } | 110 | #define OPT_UINTEGER(s, l, v, h) { .type = OPTION_UINTEGER, .short_name = (s), .long_name = (l), .value = check_vtype(v, unsigned int *), .help = (h) } |
111 | #define OPT_LONG(s, l, v, h) { .type = OPTION_LONG, .short_name = (s), .long_name = (l), .value = (v), .help = (h) } | 111 | #define OPT_LONG(s, l, v, h) { .type = OPTION_LONG, .short_name = (s), .long_name = (l), .value = check_vtype(v, long *), .help = (h) } |
112 | #define OPT_U64(s, l, v, h) { .type = OPTION_U64, .short_name = (s), .long_name = (l), .value = (v), .help = (h) } | 112 | #define OPT_U64(s, l, v, h) { .type = OPTION_U64, .short_name = (s), .long_name = (l), .value = check_vtype(v, u64 *), .help = (h) } |
113 | #define OPT_STRING(s, l, v, a, h) { .type = OPTION_STRING, .short_name = (s), .long_name = (l), .value = (v), (a), .help = (h) } | 113 | #define OPT_STRING(s, l, v, a, h) { .type = OPTION_STRING, .short_name = (s), .long_name = (l), .value = check_vtype(v, const char **), (a), .help = (h) } |
114 | #define OPT_DATE(s, l, v, h) \ | 114 | #define OPT_DATE(s, l, v, h) \ |
115 | { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = "time", .help = (h), .callback = parse_opt_approxidate_cb } | 115 | { .type = OPTION_CALLBACK, .short_name = (s), .long_name = (l), .value = (v), .argh = "time", .help = (h), .callback = parse_opt_approxidate_cb } |
116 | #define OPT_CALLBACK(s, l, v, a, h, f) \ | 116 | #define OPT_CALLBACK(s, l, v, a, h, f) \ |