Lines Matching +full:over +full:- +full:sampling
1 // SPDX-License-Identifier: GPL-2.0
6 #include "parse-events.h"
11 #include <subcmd/parse-options.h>
16 #include "../perf-sys.h"
19 #include "mem-events.h"
22 * evsel__config_leader_sampling() uses special rules for leader sampling.
44 struct list_head *config_terms = &evsel->config_terms; in evsel__config_term_mask()
48 term_types |= 1 << term->type; in evsel__config_term_mask()
55 struct perf_event_attr *attr = &evsel->core.attr; in evsel__config_leader_sampling()
60 if (!leader->sample_read) in evsel__config_leader_sampling()
70 * Disable sampling for all group members except those with explicit in evsel__config_leader_sampling()
72 * event in the group is the one that 'leads' the sampling. in evsel__config_leader_sampling()
76 attr->freq = 0; in evsel__config_leader_sampling()
77 attr->sample_freq = 0; in evsel__config_leader_sampling()
78 attr->sample_period = 0; in evsel__config_leader_sampling()
81 attr->write_backward = 0; in evsel__config_leader_sampling()
91 attr->sample_type = read_sampler->core.attr.sample_type | in evsel__config_leader_sampling()
92 leader->core.attr.sample_type; in evsel__config_leader_sampling()
100 bool sample_id = opts->sample_id; in evlist__config()
102 if (perf_cpu_map__cpu(evlist->core.user_requested_cpus, 0).cpu < 0) in evlist__config()
103 opts->no_inherit = true; in evlist__config()
109 if (evsel->tracking && use_comm_exec) in evlist__config()
110 evsel->core.attr.comm_exec = 1; in evlist__config()
113 /* Configure leader sampling here now that the sample type is known */ in evlist__config()
117 if (opts->full_auxtrace || opts->sample_identifier) { in evlist__config()
125 } else if (evlist->core.nr_entries > 1) { in evlist__config()
129 if (evsel->core.attr.sample_type == first->core.attr.sample_type) in evlist__config()
152 bool user_freq = opts->user_freq != UINT_MAX; in record_opts__config_freq()
153 bool user_interval = opts->user_interval != ULLONG_MAX; in record_opts__config_freq()
158 return -1; in record_opts__config_freq()
162 opts->default_interval = opts->user_interval; in record_opts__config_freq()
164 opts->freq = opts->user_freq; in record_opts__config_freq()
169 if (opts->default_interval) in record_opts__config_freq()
170 opts->freq = 0; in record_opts__config_freq()
171 else if (opts->freq) { in record_opts__config_freq()
172 opts->default_interval = opts->freq; in record_opts__config_freq()
175 return -1; in record_opts__config_freq()
182 * User specified frequency is over current maximum. in record_opts__config_freq()
184 if (user_freq && (max_rate < opts->freq)) { in record_opts__config_freq()
185 if (opts->strict_freq) { in record_opts__config_freq()
187 " Please use -F freq option with a lower value or consider\n" in record_opts__config_freq()
190 return -1; in record_opts__config_freq()
195 " Use --strict-freq to disable this throttling, refusing to record.\n", in record_opts__config_freq()
196 max_rate, opts->freq, max_rate); in record_opts__config_freq()
198 opts->freq = max_rate; in record_opts__config_freq()
203 * Default frequency is over current maximum. in record_opts__config_freq()
205 if (max_rate < opts->freq) { in record_opts__config_freq()
209 opts->freq, max_rate); in record_opts__config_freq()
210 opts->freq = max_rate; in record_opts__config_freq()
228 pid_t pid = -1; in evlist__can_select_event()
240 if (!evlist || perf_cpu_map__empty(evlist->core.user_requested_cpus)) { in evlist__can_select_event()
248 cpu = perf_cpu_map__cpu(evlist->core.user_requested_cpus, 0); in evlist__can_select_event()
252 fd = sys_perf_event_open(&evsel->core.attr, pid, cpu.cpu, -1, in evlist__can_select_event()
255 if (pid == -1 && errno == EACCES) { in evlist__can_select_event()
274 struct record_opts *opts = opt->value; in record__parse_freq()
277 return -EINVAL; in record__parse_freq()
282 return -1; in record__parse_freq()
289 opts->user_freq = freq; in record__parse_freq()