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;
48 term_types |= 1 << term->type;
55 struct perf_event_attr *attr = &evsel->core.attr;
60 if (!leader->sample_read)
70 * Disable sampling for all group members except those with explicit
72 * event in the group is the one that 'leads' the sampling.
76 attr->freq = 0;
77 attr->sample_freq = 0;
78 attr->sample_period = 0;
81 attr->write_backward = 0;
91 attr->sample_type = read_sampler->core.attr.sample_type |
92 leader->core.attr.sample_type;
100 bool sample_id = opts->sample_id;
102 if (perf_cpu_map__cpu(evlist->core.user_requested_cpus, 0).cpu < 0)
103 opts->no_inherit = true;
109 if (evsel->tracking && use_comm_exec)
110 evsel->core.attr.comm_exec = 1;
113 /* Configure leader sampling here now that the sample type is known */
117 if (opts->full_auxtrace || opts->sample_identifier) {
125 } else if (evlist->core.nr_entries > 1) {
129 if (evsel->core.attr.sample_type == first->core.attr.sample_type)
152 bool user_freq = opts->user_freq != UINT_MAX;
153 bool user_interval = opts->user_interval != ULLONG_MAX;
158 return -1;
162 opts->default_interval = opts->user_interval;
164 opts->freq = opts->user_freq;
169 if (opts->default_interval)
170 opts->freq = 0;
171 else if (opts->freq) {
172 opts->default_interval = opts->freq;
175 return -1;
182 * User specified frequency is over current maximum.
184 if (user_freq && (max_rate < opts->freq)) {
185 if (opts->strict_freq) {
187 " Please use -F freq option with a lower value or consider\n"
190 return -1;
195 " Use --strict-freq to disable this throttling, refusing to record.\n",
196 max_rate, opts->freq, max_rate);
198 opts->freq = max_rate;
203 * Default frequency is over current maximum.
205 if (max_rate < opts->freq) {
209 opts->freq, max_rate);
210 opts->freq = max_rate;
228 pid_t pid = -1;
240 if (!evlist || perf_cpu_map__is_any_cpu_or_is_empty(evlist->core.user_requested_cpus)) {
248 cpu = perf_cpu_map__cpu(evlist->core.user_requested_cpus, 0);
252 fd = sys_perf_event_open(&evsel->core.attr, pid, cpu.cpu, -1,
255 if (pid == -1 && errno == EACCES) {
274 struct record_opts *opts = opt->value;
277 return -EINVAL;
282 return -1;
289 opts->user_freq = freq;