| // SPDX-License-Identifier: GPL-2.0 |
| #include <subcmd/parse-options.h> |
| #include "util/parse-regs-options.h" |
| parse_regs(const struct option *opt, const char *str, int unset) |
| uint64_t *mode = (uint64_t *)opt->value; |
| const struct sample_reg *r; |
| /* str may be NULL in case no arg is passed to -I */ |
| /* because str is read-only */ |
| fprintf(stderr, "available registers: "); |
| for (r = sample_reg_masks; r->name; r++) { |
| fprintf(stderr, "%s ", r->name); |
| /* just printing available regs */ |
| for (r = sample_reg_masks; r->name; r++) { |
| if (!strcasecmp(s, r->name)) |
| ui__warning("unknown register %s," |
| /* default to all possible regs */ |