3 #include "util/debug.h"
4 #include <subcmd/parse-options.h>
5 #include "util/parse-regs-options.h"
8 parse_regs(const struct option
*opt
, const char *str
, int unset
)
10 uint64_t *mode
= (uint64_t *)opt
->value
;
11 const struct sample_reg
*r
;
12 char *s
, *os
= NULL
, *p
;
24 /* str may be NULL in case no arg is passed to -I */
26 /* because str is read-only */
36 if (!strcmp(s
, "?")) {
37 fprintf(stderr
, "available registers: ");
38 for (r
= sample_reg_masks
; r
->name
; r
++) {
39 fprintf(stderr
, "%s ", r
->name
);
42 /* just printing available regs */
45 for (r
= sample_reg_masks
; r
->name
; r
++) {
46 if (!strcasecmp(s
, r
->name
))
50 ui__warning("unknown register %s,"
51 " check man page\n", s
);
65 /* default to all possible regs */
67 *mode
= PERF_REGS_MASK
;