Lines Matching +full:s +full:- +full:mode
1 // SPDX-License-Identifier: GPL-2.0
4 #include <subcmd/parse-options.h>
5 #include "util/parse-branch-options.h"
10 { .name = n, .mode = (m) }
16 int mode; member
43 int parse_branch_str(const char *str, __u64 *mode) in parse_branch_str() argument
51 char *p, *s; in parse_branch_str() local
56 *mode = PERF_SAMPLE_BRANCH_ANY; in parse_branch_str()
60 /* because str is read-only */ in parse_branch_str()
61 s = os = strdup(str); in parse_branch_str()
62 if (!s) in parse_branch_str()
63 return -1; in parse_branch_str()
66 p = strchr(s, ','); in parse_branch_str()
70 for (br = branch_modes; br->name; br++) { in parse_branch_str()
71 if (!strcasecmp(s, br->name)) in parse_branch_str()
74 if (!br->name) { in parse_branch_str()
75 ret = -1; in parse_branch_str()
76 pr_warning("unknown branch filter %s," in parse_branch_str()
77 " check man page\n", s); in parse_branch_str()
81 *mode |= br->mode; in parse_branch_str()
86 s = p + 1; in parse_branch_str()
90 if ((*mode & ~ONLY_PLM) == 0) { in parse_branch_str()
91 *mode = PERF_SAMPLE_BRANCH_ANY; in parse_branch_str()
101 __u64 *mode = (__u64 *)opt->value; in parse_branch_stack() local
107 * cannot set it twice, -b + --branch-filter for instance in parse_branch_stack()
109 if (*mode) { in parse_branch_stack()
110 pr_err("Error: Can't use --branch-any (-b) with --branch-filter (-j).\n"); in parse_branch_stack()
111 return -1; in parse_branch_stack()
114 return parse_branch_str(str, mode); in parse_branch_stack()