Lines Matching refs:opts
154 struct record_opts opts;
215 return rec->opts.threads_spec;
519 struct record_opts *opts = (struct record_opts *)opt->value;
522 opts->nr_cblocks = 0;
525 opts->nr_cblocks = strtol(str, NULL, 0);
526 if (!opts->nr_cblocks)
527 opts->nr_cblocks = nr_cblocks_default;
557 return rec->opts.nr_cblocks > 0;
566 struct record_opts *opts = (struct record_opts *)opt->value;
579 opts->mmap_flush = parse_tag_value(str, tags);
580 if (opts->mmap_flush == (int)-1)
581 opts->mmap_flush = strtol(str, NULL, 0);
584 if (!opts->mmap_flush)
585 opts->mmap_flush = MMAP_FLUSH_DEFAULT;
587 flush_max = evlist__mmap_size(opts->mmap_pages);
589 if (opts->mmap_flush > flush_max)
590 opts->mmap_flush = flush_max;
600 struct record_opts *opts = opt->value;
603 opts->comp_level = 0;
606 opts->comp_level = strtol(str, NULL, 0);
607 if (!opts->comp_level)
608 opts->comp_level = comp_level_default;
618 return rec->opts.comp_level > 0;
778 rec->opts.auxtrace_snapshot_size);
841 if ((rec->opts.auxtrace_snapshot_opts || rec->opts.auxtrace_sample_opts)
853 err = auxtrace_parse_snapshot_options(rec->itr, &rec->opts,
854 rec->opts.auxtrace_snapshot_opts);
858 err = auxtrace_parse_sample_options(rec->itr, rec->evlist, &rec->opts,
859 rec->opts.auxtrace_sample_opts);
928 return off_cpu_prepare(rec->evlist, &rec->opts.target, &rec->opts);
952 struct record_opts *opts = &rec->opts;
962 if (opts->target.initial_delay || target__has_cpu(&opts->target) ||
969 if (!!opts->target.cpu_list && record__tracking_system_wide(rec))
980 if (opts->target.initial_delay && !evsel->immediate &&
981 !target__has_cpu(&opts->target))
1301 struct record_opts *opts = &rec->opts;
1302 bool auxtrace_overwrite = opts->auxtrace_snapshot_mode ||
1303 opts->auxtrace_sample_mode;
1306 if (opts->affinity != PERF_AFFINITY_SYS)
1309 if (evlist__mmap_ex(evlist, opts->mmap_pages,
1310 opts->auxtrace_mmap_pages,
1312 opts->nr_cblocks, opts->affinity,
1313 opts->mmap_flush, opts->comp_level) < 0) {
1320 opts->mmap_pages, opts->auxtrace_mmap_pages);
1332 if (evlist__initialize_ctlfd(evlist, opts->ctl_fd, opts->ctl_fd_ack))
1367 struct record_opts *opts = &rec->opts;
1373 if (evsel__fallback(pos, &opts->target, errno, msg, sizeof(msg))) {
1385 evsel__open_strerror(pos, &opts->target, errno, msg, sizeof(msg));
1404 if (evlist__apply_filters(evlist, &pos, &opts->target)) {
1519 if (rec->opts.affinity != PERF_AFFINITY_SYS &&
1632 if (map->auxtrace_mmap.base && !rec->opts.auxtrace_snapshot_mode &&
1633 !rec->opts.auxtrace_sample_mode &&
1756 if (!rec->opts.branch_stack)
1759 if (!rec->opts.full_auxtrace)
1762 if (!(rec->opts.use_clockid && rec->opts.clockid_res_ns))
1765 if (!rec->opts.use_clockid)
1812 bool needs_mmap = rec->opts.synth & PERF_SYNTH_MMAP;
1814 if (rec->opts.tail_synthesize != tail)
1825 rec->opts.sample_address);
1832 if (rec->opts.tail_synthesize != tail)
1855 if (target__none(&rec->opts.target))
1907 if (target__none(&rec->opts.target))
2029 struct record_opts *opts = &rec->opts;
2034 if (rec->opts.tail_synthesize != tail)
2058 if (rec->opts.full_auxtrace) {
2107 machine, opts);
2113 if (rec->opts.synth & PERF_SYNTH_CGROUP) {
2122 if (rec->opts.nr_threads_synthesize > 1) {
2128 if (rec->opts.synth & PERF_SYNTH_TASK) {
2129 bool needs_mmap = rec->opts.synth & PERF_SYNTH_MMAP;
2131 err = __machine__synthesize_threads(machine, tool, &opts->target,
2133 f, needs_mmap, opts->sample_address,
2134 rec->opts.nr_threads_synthesize);
2137 if (rec->opts.nr_threads_synthesize > 1) {
2155 struct record_opts *opts = &rec->opts;
2167 if (!opts->no_bpf_event) {
2183 if (evlist__start_sb_thread(rec->sb_evlist, &rec->opts.target)) {
2185 opts->no_bpf_event = true;
2198 if (!rec->opts.use_clockid)
2201 if (rec->opts.use_clockid && rec->opts.clockid_res_ns)
2202 session->header.env.clock.clockid_res_ns = rec->opts.clockid_res_ns;
2204 session->header.env.clock.clockid = rec->opts.clockid;
2211 if (clock_gettime(rec->opts.clockid, &ref_clockid)) {
2363 struct record_opts *opts = &rec->opts;
2377 if (rec->opts.record_cgroup) {
2384 if (rec->opts.auxtrace_snapshot_mode || rec->switch_output.enabled) {
2386 if (rec->opts.auxtrace_snapshot_mode)
2404 tool->namespace_events = rec->opts.record_namespaces;
2405 tool->cgroup_events = rec->opts.record_cgroup;
2417 if (rec->opts.full_auxtrace) {
2426 if (zstd_init(&session->zstd_data, rec->opts.comp_level) < 0) {
2446 session->header.env.comp_level = rec->opts.comp_level;
2448 if (rec->opts.kcore &&
2460 err = evlist__prepare_workload(rec->evlist, &opts->target, argv, data->is_pipe,
2476 rec->opts.sample_id = true;
2485 evlist__config(rec->evlist, opts, &callchain_param);
2497 if (rec->opts.kcore) {
2562 if (!target__none(&opts->target) && !opts->target.initial_delay)
2614 if (opts->target.initial_delay) {
2616 if (opts->target.initial_delay > 0) {
2617 usleep(opts->target.initial_delay * USEC_PER_MSEC);
2767 if (done && !disabled && !target__none(&opts->target)) {
2777 if (opts->auxtrace_snapshot_on_exit)
2798 if (target__none(&rec->opts.target))
2858 if (rec->samples && !rec->opts.full_auxtrace)
2885 if (!opts->no_bpf_event)
2973 rec->opts.nr_cblocks = strtol(value, NULL, 0);
2974 if (!rec->opts.nr_cblocks)
2975 rec->opts.nr_cblocks = nr_cblocks_default;
2992 return evlist__parse_event_enable_time(rec->evlist, &rec->opts, str, unset);
2997 struct record_opts *opts = (struct record_opts *)opt->value;
3003 opts->affinity = PERF_AFFINITY_NODE;
3005 opts->affinity = PERF_AFFINITY_CPU;
3054 struct record_opts *opts = opt->value;
3057 opts->threads_spec = THREAD_SPEC__CPU;
3061 opts->threads_user_spec = strdup(str);
3062 if (!opts->threads_user_spec)
3064 opts->threads_spec = THREAD_SPEC__USER;
3068 opts->threads_spec = s;
3074 if (opts->threads_spec == THREAD_SPEC__USER)
3075 pr_debug("threads_spec: %s\n", opts->threads_user_spec);
3077 pr_debug("threads_spec: %s\n", thread_spec_tags[opts->threads_spec]);
3113 struct record_opts *opts = opt->value;
3133 opts->mmap_pages = mmap_pages;
3145 opts->auxtrace_mmap_pages = mmap_pages;
3152 void __weak arch__add_leaf_frame_record_opts(struct record_opts *opts __maybe_unused)
3160 struct record_opts *opts = opt->value;
3162 return evlist__parse_control(str, &opts->ctl_fd, &opts->ctl_fd_ack, &opts->ctl_fd_close);
3167 u64 wakeup_size = evlist__mmap_size(rec->opts.mmap_pages);
3250 if (s->size && !rec->opts.no_buffering)
3303 struct record_opts *opts = opt->value;
3309 opts->synth = parse_synth_opt(p);
3312 if (opts->synth < 0) {
3330 .opts = {
3377 OPT_STRING('p', "pid", &record.opts.target.pid, "pid",
3379 OPT_STRING('t', "tid", &record.opts.target.tid, "tid",
3383 OPT_BOOLEAN(0, "no-buffering", &record.opts.no_buffering,
3385 OPT_BOOLEAN('R', "raw-samples", &record.opts.raw_samples,
3387 OPT_BOOLEAN('a', "all-cpus", &record.opts.target.system_wide,
3389 OPT_STRING('C', "cpu", &record.opts.target.cpu_list, "cpu",
3391 OPT_U64('c', "count", &record.opts.user_interval, "event period to sample"),
3394 OPT_BOOLEAN_SET('i', "no-inherit", &record.opts.no_inherit,
3395 &record.opts.no_inherit_set,
3397 OPT_BOOLEAN(0, "tail-synthesize", &record.opts.tail_synthesize,
3399 OPT_BOOLEAN(0, "overwrite", &record.opts.overwrite, "use overwrite mode"),
3400 OPT_BOOLEAN(0, "no-bpf-event", &record.opts.no_bpf_event, "do not record bpf events"),
3401 OPT_BOOLEAN(0, "strict-freq", &record.opts.strict_freq,
3403 OPT_CALLBACK('F', "freq", &record.opts, "freq or 'max'",
3406 OPT_CALLBACK('m', "mmap-pages", &record.opts, "pages[,pages]",
3409 OPT_CALLBACK(0, "mmap-flush", &record.opts, "number",
3415 OPT_CALLBACK(0, "call-graph", &record.opts,
3421 OPT_BOOLEAN('s', "stat", &record.opts.inherit_stat,
3423 OPT_BOOLEAN('d', "data", &record.opts.sample_address, "Record the sample addresses"),
3424 OPT_BOOLEAN(0, "phys-data", &record.opts.sample_phys_addr,
3426 OPT_BOOLEAN(0, "data-page-size", &record.opts.sample_data_page_size,
3428 OPT_BOOLEAN(0, "code-page-size", &record.opts.sample_code_page_size,
3430 OPT_BOOLEAN(0, "sample-cpu", &record.opts.sample_cpu, "Record the sample cpu"),
3431 OPT_BOOLEAN(0, "sample-identifier", &record.opts.sample_identifier,
3433 OPT_BOOLEAN_SET('T', "timestamp", &record.opts.sample_time,
3434 &record.opts.sample_time_set,
3436 OPT_BOOLEAN_SET('P', "period", &record.opts.period, &record.opts.period_set,
3438 OPT_BOOLEAN('n', "no-samples", &record.opts.no_samples,
3453 OPT_BOOLEAN(0, "kcore", &record.opts.kcore, "copy /proc/kcore"),
3454 OPT_STRING('u', "uid", &record.opts.target.uid_str, "user",
3457 OPT_CALLBACK_NOOPT('b', "branch-any", &record.opts.branch_stack,
3461 OPT_CALLBACK('j', "branch-filter", &record.opts.branch_stack,
3464 OPT_BOOLEAN('W', "weight", &record.opts.sample_weight,
3466 OPT_BOOLEAN(0, "transaction", &record.opts.sample_transaction,
3468 OPT_BOOLEAN(0, "per-thread", &record.opts.target.per_thread,
3470 OPT_CALLBACK_OPTARG('I', "intr-regs", &record.opts.sample_intr_regs, NULL, "any register",
3473 OPT_CALLBACK_OPTARG(0, "user-regs", &record.opts.sample_user_regs, NULL, "any register",
3476 OPT_BOOLEAN(0, "running-time", &record.opts.running_time,
3478 OPT_CALLBACK('k', "clockid", &record.opts,
3481 OPT_STRING_OPTARG('S', "snapshot", &record.opts.auxtrace_snapshot_opts,
3482 "opts", "AUX area tracing Snapshot Mode", ""),
3483 OPT_STRING_OPTARG(0, "aux-sample", &record.opts.auxtrace_sample_opts,
3484 "opts", "sample AUX area", ""),
3487 OPT_BOOLEAN(0, "namespaces", &record.opts.record_namespaces,
3489 OPT_BOOLEAN(0, "all-cgroups", &record.opts.record_cgroup,
3491 OPT_BOOLEAN_SET(0, "switch-events", &record.opts.record_switch_events,
3492 &record.opts.record_switch_events_set,
3494 OPT_BOOLEAN_FLAG(0, "all-kernel", &record.opts.all_kernel,
3497 OPT_BOOLEAN_FLAG(0, "all-user", &record.opts.all_user,
3500 OPT_BOOLEAN(0, "kernel-callchains", &record.opts.kernel_callchains,
3502 OPT_BOOLEAN(0, "user-callchains", &record.opts.user_callchains,
3527 OPT_CALLBACK_OPTARG(0, "aio", &record.opts,
3531 OPT_CALLBACK(0, "affinity", &record.opts, "node|cpu",
3535 OPT_CALLBACK_OPTARG('z', "compression-level", &record.opts, &comp_level_default, "n",
3542 &record.opts.nr_threads_synthesize,
3549 OPT_CALLBACK(0, "control", &record.opts, "fd:ctl-fd[,ack-fd] or fifo:ctl-fifo[,ack-fifo]",
3555 OPT_CALLBACK(0, "synth", &record.opts, "no|all|task|mmap|cgroup",
3561 OPT_CALLBACK_OPTARG(0, "threads", &record.opts, NULL, "spec",
3858 for (t = 0, user_spec = (char *)rec->opts.threads_user_spec; ; t++, user_spec = NULL) {
3950 switch (rec->opts.threads_spec) {
3989 rec->opts.affinity = PERF_AFFINITY_SYS;
4011 if (!argc && target__none(&rec->opts.target))
4012 rec->opts.target.system_wide = true;
4014 if (nr_cgroups && !rec->opts.target.system_wide) {
4030 rec->opts.build_id = true;
4035 if (rec->opts.record_cgroup && !perf_can_record_cgroup()) {
4041 if (rec->opts.kcore)
4042 rec->opts.text_poke = true;
4044 if (rec->opts.kcore || record__threads_enabled(rec))
4048 if (rec->opts.affinity != PERF_AFFINITY_SYS) {
4058 if (rec->opts.comp_level != 0) {
4063 if (rec->opts.record_switch_events &&
4156 if (record.opts.overwrite)
4157 record.opts.tail_synthesize = true;
4165 if (rec->opts.target.tid && !rec->opts.no_inherit_set)
4166 rec->opts.no_inherit = true;
4168 err = target__validate(&rec->opts.target);
4170 target__strerror(&rec->opts.target, err, errbuf, BUFSIZ);
4174 err = target__parse_uid(&rec->opts.target);
4178 target__strerror(&rec->opts.target, err, errbuf, BUFSIZ);
4186 rec->opts.ignore_missing_thread = rec->opts.target.uid != UINT_MAX || rec->opts.target.pid;
4188 evlist__warn_user_requested_cpus(rec->evlist, rec->opts.target.cpu_list);
4191 arch__add_leaf_frame_record_opts(&rec->opts);
4194 if (evlist__create_maps(rec->evlist, &rec->opts.target) < 0) {
4195 if (rec->opts.target.pid != NULL) {
4204 err = auxtrace_record__options(rec->itr, rec->evlist, &rec->opts);
4213 if (rec->opts.full_auxtrace)
4216 if (rec->opts.text_poke) {
4232 if (record_opts__config(&rec->opts)) {
4249 if (rec->opts.nr_cblocks > nr_cblocks_max)
4250 rec->opts.nr_cblocks = nr_cblocks_max;
4251 pr_debug("nr_cblocks: %d\n", rec->opts.nr_cblocks);
4253 pr_debug("affinity: %s\n", affinity_tags[rec->opts.affinity]);
4254 pr_debug("mmap flush: %d\n", rec->opts.mmap_flush);
4256 if (rec->opts.comp_level > comp_level_max)
4257 rec->opts.comp_level = comp_level_max;
4258 pr_debug("comp level: %d\n", rec->opts.comp_level);
4267 evlist__close_control(rec->opts.ctl_fd, rec->opts.ctl_fd_ack, &rec->opts.ctl_fd_close);