Lines Matching refs:opts

154 	struct record_opts	opts;
205 return rec->opts.threads_spec;
509 struct record_opts *opts = (struct record_opts *)opt->value;
512 opts->nr_cblocks = 0;
515 opts->nr_cblocks = strtol(str, NULL, 0);
516 if (!opts->nr_cblocks)
517 opts->nr_cblocks = nr_cblocks_default;
547 return rec->opts.nr_cblocks > 0;
556 struct record_opts *opts = (struct record_opts *)opt->value;
569 opts->mmap_flush = parse_tag_value(str, tags);
570 if (opts->mmap_flush == (int)-1)
571 opts->mmap_flush = strtol(str, NULL, 0);
574 if (!opts->mmap_flush)
575 opts->mmap_flush = MMAP_FLUSH_DEFAULT;
577 flush_max = evlist__mmap_size(opts->mmap_pages);
579 if (opts->mmap_flush > flush_max)
580 opts->mmap_flush = flush_max;
590 struct record_opts *opts = opt->value;
593 opts->comp_level = 0;
596 opts->comp_level = strtol(str, NULL, 0);
597 if (!opts->comp_level)
598 opts->comp_level = comp_level_default;
608 return rec->opts.comp_level > 0;
768 rec->opts.auxtrace_snapshot_size);
831 if ((rec->opts.auxtrace_snapshot_opts || rec->opts.auxtrace_sample_opts)
843 err = auxtrace_parse_snapshot_options(rec->itr, &rec->opts,
844 rec->opts.auxtrace_snapshot_opts);
848 err = auxtrace_parse_sample_options(rec->itr, rec->evlist, &rec->opts,
849 rec->opts.auxtrace_sample_opts);
916 return off_cpu_prepare(rec->evlist, &rec->opts.target, &rec->opts);
940 struct record_opts *opts = &rec->opts;
950 if (opts->target.initial_delay || target__has_cpu(&opts->target) ||
957 if (!!opts->target.cpu_list && record__tracking_system_wide(rec))
968 if (opts->target.initial_delay && !evsel->immediate &&
969 !target__has_cpu(&opts->target))
1289 struct record_opts *opts = &rec->opts;
1290 bool auxtrace_overwrite = opts->auxtrace_snapshot_mode ||
1291 opts->auxtrace_sample_mode;
1294 if (opts->affinity != PERF_AFFINITY_SYS)
1297 if (evlist__mmap_ex(evlist, opts->mmap_pages,
1298 opts->auxtrace_mmap_pages,
1300 opts->nr_cblocks, opts->affinity,
1301 opts->mmap_flush, opts->comp_level) < 0) {
1308 opts->mmap_pages, opts->auxtrace_mmap_pages);
1320 if (evlist__initialize_ctlfd(evlist, opts->ctl_fd, opts->ctl_fd_ack))
1355 struct record_opts *opts = &rec->opts;
1361 if (evsel__fallback(pos, &opts->target, errno, msg, sizeof(msg))) {
1373 evsel__open_strerror(pos, &opts->target, errno, msg, sizeof(msg));
1507 if (rec->opts.affinity != PERF_AFFINITY_SYS &&
1620 if (map->auxtrace_mmap.base && !rec->opts.auxtrace_snapshot_mode &&
1621 !rec->opts.auxtrace_sample_mode &&
1746 if (!rec->opts.branch_stack)
1749 if (!rec->opts.full_auxtrace)
1752 if (!(rec->opts.use_clockid && rec->opts.clockid_res_ns))
1755 if (!rec->opts.use_clockid)
1802 bool needs_mmap = rec->opts.synth & PERF_SYNTH_MMAP;
1804 if (rec->opts.tail_synthesize != tail)
1815 rec->opts.sample_address);
1822 if (rec->opts.tail_synthesize != tail)
1845 if (target__none(&rec->opts.target))
1897 if (target__none(&rec->opts.target))
2035 struct record_opts *opts = &rec->opts;
2040 if (rec->opts.tail_synthesize != tail)
2064 if (rec->opts.full_auxtrace) {
2113 machine, opts);
2119 if (rec->opts.synth & PERF_SYNTH_CGROUP) {
2128 if (rec->opts.nr_threads_synthesize > 1) {
2134 if (rec->opts.synth & PERF_SYNTH_TASK) {
2135 bool needs_mmap = rec->opts.synth & PERF_SYNTH_MMAP;
2137 err = __machine__synthesize_threads(machine, tool, &opts->target,
2139 f, needs_mmap, opts->sample_address,
2140 rec->opts.nr_threads_synthesize);
2143 if (rec->opts.nr_threads_synthesize > 1) {
2161 struct record_opts *opts = &rec->opts;
2173 if (!opts->no_bpf_event) {
2189 if (evlist__start_sb_thread(rec->sb_evlist, &rec->opts.target)) {
2191 opts->no_bpf_event = true;
2204 if (!rec->opts.use_clockid)
2207 if (rec->opts.use_clockid && rec->opts.clockid_res_ns)
2208 session->header.env.clock.clockid_res_ns = rec->opts.clockid_res_ns;
2210 session->header.env.clock.clockid = rec->opts.clockid;
2217 if (clock_gettime(rec->opts.clockid, &ref_clockid)) {
2369 struct record_opts *opts = &rec->opts;
2383 if (rec->opts.record_namespaces)
2386 if (rec->opts.record_cgroup) {
2395 if (rec->opts.auxtrace_snapshot_mode || rec->switch_output.enabled) {
2397 if (rec->opts.auxtrace_snapshot_mode)
2416 if (rec->opts.full_auxtrace) {
2425 if (zstd_init(&session->zstd_data, rec->opts.comp_level) < 0) {
2445 session->header.env.comp_level = rec->opts.comp_level;
2447 if (rec->opts.kcore &&
2459 err = evlist__prepare_workload(rec->evlist, &opts->target, argv, data->is_pipe,
2475 rec->opts.sample_id = true;
2484 evlist__config(rec->evlist, opts, &callchain_param);
2496 if (rec->opts.kcore) {
2561 if (!target__none(&opts->target) && !opts->target.initial_delay)
2613 if (opts->target.initial_delay) {
2615 if (opts->target.initial_delay > 0) {
2616 usleep(opts->target.initial_delay * USEC_PER_MSEC);
2766 if (done && !disabled && !target__none(&opts->target)) {
2776 if (opts->auxtrace_snapshot_on_exit)
2797 if (target__none(&rec->opts.target))
2857 if (rec->samples && !rec->opts.full_auxtrace)
2884 if (!opts->no_bpf_event)
2972 rec->opts.nr_cblocks = strtol(value, NULL, 0);
2973 if (!rec->opts.nr_cblocks)
2974 rec->opts.nr_cblocks = nr_cblocks_default;
2991 return evlist__parse_event_enable_time(rec->evlist, &rec->opts, str, unset);
2996 struct record_opts *opts = (struct record_opts *)opt->value;
3002 opts->affinity = PERF_AFFINITY_NODE;
3004 opts->affinity = PERF_AFFINITY_CPU;
3053 struct record_opts *opts = opt->value;
3056 opts->threads_spec = THREAD_SPEC__CPU;
3060 opts->threads_user_spec = strdup(str);
3061 if (!opts->threads_user_spec)
3063 opts->threads_spec = THREAD_SPEC__USER;
3067 opts->threads_spec = s;
3073 if (opts->threads_spec == THREAD_SPEC__USER)
3074 pr_debug("threads_spec: %s\n", opts->threads_user_spec);
3076 pr_debug("threads_spec: %s\n", thread_spec_tags[opts->threads_spec]);
3112 struct record_opts *opts = opt->value;
3132 opts->mmap_pages = mmap_pages;
3144 opts->auxtrace_mmap_pages = mmap_pages;
3151 void __weak arch__add_leaf_frame_record_opts(struct record_opts *opts __maybe_unused)
3159 struct record_opts *opts = opt->value;
3161 return evlist__parse_control(str, &opts->ctl_fd, &opts->ctl_fd_ack, &opts->ctl_fd_close);
3166 u64 wakeup_size = evlist__mmap_size(rec->opts.mmap_pages);
3249 if (s->size && !rec->opts.no_buffering)
3302 struct record_opts *opts = opt->value;
3308 opts->synth = parse_synth_opt(p);
3311 if (opts->synth < 0) {
3329 .opts = {
3388 OPT_STRING('p', "pid", &record.opts.target.pid, "pid",
3390 OPT_STRING('t', "tid", &record.opts.target.tid, "tid",
3394 OPT_BOOLEAN(0, "no-buffering", &record.opts.no_buffering,
3396 OPT_BOOLEAN('R', "raw-samples", &record.opts.raw_samples,
3398 OPT_BOOLEAN('a', "all-cpus", &record.opts.target.system_wide,
3400 OPT_STRING('C', "cpu", &record.opts.target.cpu_list, "cpu",
3402 OPT_U64('c', "count", &record.opts.user_interval, "event period to sample"),
3405 OPT_BOOLEAN_SET('i', "no-inherit", &record.opts.no_inherit,
3406 &record.opts.no_inherit_set,
3408 OPT_BOOLEAN(0, "tail-synthesize", &record.opts.tail_synthesize,
3410 OPT_BOOLEAN(0, "overwrite", &record.opts.overwrite, "use overwrite mode"),
3411 OPT_BOOLEAN(0, "no-bpf-event", &record.opts.no_bpf_event, "do not record bpf events"),
3412 OPT_BOOLEAN(0, "strict-freq", &record.opts.strict_freq,
3414 OPT_CALLBACK('F', "freq", &record.opts, "freq or 'max'",
3417 OPT_CALLBACK('m', "mmap-pages", &record.opts, "pages[,pages]",
3420 OPT_CALLBACK(0, "mmap-flush", &record.opts, "number",
3426 OPT_CALLBACK(0, "call-graph", &record.opts,
3432 OPT_BOOLEAN('s', "stat", &record.opts.inherit_stat,
3434 OPT_BOOLEAN('d', "data", &record.opts.sample_address, "Record the sample addresses"),
3435 OPT_BOOLEAN(0, "phys-data", &record.opts.sample_phys_addr,
3437 OPT_BOOLEAN(0, "data-page-size", &record.opts.sample_data_page_size,
3439 OPT_BOOLEAN(0, "code-page-size", &record.opts.sample_code_page_size,
3441 OPT_BOOLEAN(0, "sample-cpu", &record.opts.sample_cpu, "Record the sample cpu"),
3442 OPT_BOOLEAN(0, "sample-identifier", &record.opts.sample_identifier,
3444 OPT_BOOLEAN_SET('T', "timestamp", &record.opts.sample_time,
3445 &record.opts.sample_time_set,
3447 OPT_BOOLEAN_SET('P', "period", &record.opts.period, &record.opts.period_set,
3449 OPT_BOOLEAN('n', "no-samples", &record.opts.no_samples,
3464 OPT_BOOLEAN(0, "kcore", &record.opts.kcore, "copy /proc/kcore"),
3465 OPT_STRING('u', "uid", &record.opts.target.uid_str, "user",
3468 OPT_CALLBACK_NOOPT('b', "branch-any", &record.opts.branch_stack,
3472 OPT_CALLBACK('j', "branch-filter", &record.opts.branch_stack,
3475 OPT_BOOLEAN('W', "weight", &record.opts.sample_weight,
3477 OPT_BOOLEAN(0, "transaction", &record.opts.sample_transaction,
3479 OPT_BOOLEAN(0, "per-thread", &record.opts.target.per_thread,
3481 OPT_CALLBACK_OPTARG('I', "intr-regs", &record.opts.sample_intr_regs, NULL, "any register",
3484 OPT_CALLBACK_OPTARG(0, "user-regs", &record.opts.sample_user_regs, NULL, "any register",
3487 OPT_BOOLEAN(0, "running-time", &record.opts.running_time,
3489 OPT_CALLBACK('k', "clockid", &record.opts,
3492 OPT_STRING_OPTARG('S', "snapshot", &record.opts.auxtrace_snapshot_opts,
3493 "opts", "AUX area tracing Snapshot Mode", ""),
3494 OPT_STRING_OPTARG(0, "aux-sample", &record.opts.auxtrace_sample_opts,
3495 "opts", "sample AUX area", ""),
3498 OPT_BOOLEAN(0, "namespaces", &record.opts.record_namespaces,
3500 OPT_BOOLEAN(0, "all-cgroups", &record.opts.record_cgroup,
3502 OPT_BOOLEAN_SET(0, "switch-events", &record.opts.record_switch_events,
3503 &record.opts.record_switch_events_set,
3505 OPT_BOOLEAN_FLAG(0, "all-kernel", &record.opts.all_kernel,
3508 OPT_BOOLEAN_FLAG(0, "all-user", &record.opts.all_user,
3511 OPT_BOOLEAN(0, "kernel-callchains", &record.opts.kernel_callchains,
3513 OPT_BOOLEAN(0, "user-callchains", &record.opts.user_callchains,
3538 OPT_CALLBACK_OPTARG(0, "aio", &record.opts,
3542 OPT_CALLBACK(0, "affinity", &record.opts, "node|cpu",
3546 OPT_CALLBACK_OPTARG('z', "compression-level", &record.opts, &comp_level_default, "n",
3553 &record.opts.nr_threads_synthesize,
3560 OPT_CALLBACK(0, "control", &record.opts, "fd:ctl-fd[,ack-fd] or fifo:ctl-fifo[,ack-fifo]",
3566 OPT_CALLBACK(0, "synth", &record.opts, "no|all|task|mmap|cgroup",
3572 OPT_CALLBACK_OPTARG(0, "threads", &record.opts, NULL, "spec",
3867 for (t = 0, user_spec = (char *)rec->opts.threads_user_spec; ; t++, user_spec = NULL) {
3959 switch (rec->opts.threads_spec) {
3998 rec->opts.affinity = PERF_AFFINITY_SYS;
4020 if (!argc && target__none(&rec->opts.target))
4021 rec->opts.target.system_wide = true;
4023 if (nr_cgroups && !rec->opts.target.system_wide) {
4039 rec->opts.build_id = true;
4044 if (rec->opts.record_cgroup && !perf_can_record_cgroup()) {
4050 if (rec->opts.kcore)
4051 rec->opts.text_poke = true;
4053 if (rec->opts.kcore || record__threads_enabled(rec))
4057 if (rec->opts.affinity != PERF_AFFINITY_SYS) {
4067 if (rec->opts.comp_level != 0) {
4072 if (rec->opts.record_switch_events &&
4153 if (record.opts.overwrite)
4154 record.opts.tail_synthesize = true;
4164 if (rec->opts.target.tid && !rec->opts.no_inherit_set)
4165 rec->opts.no_inherit = true;
4167 err = target__validate(&rec->opts.target);
4169 target__strerror(&rec->opts.target, err, errbuf, BUFSIZ);
4173 err = target__parse_uid(&rec->opts.target);
4177 target__strerror(&rec->opts.target, err, errbuf, BUFSIZ);
4185 rec->opts.ignore_missing_thread = rec->opts.target.uid != UINT_MAX || rec->opts.target.pid;
4187 evlist__warn_user_requested_cpus(rec->evlist, rec->opts.target.cpu_list);
4190 arch__add_leaf_frame_record_opts(&rec->opts);
4193 if (evlist__create_maps(rec->evlist, &rec->opts.target) < 0) {
4194 if (rec->opts.target.pid != NULL) {
4203 err = auxtrace_record__options(rec->itr, rec->evlist, &rec->opts);
4212 if (rec->opts.full_auxtrace)
4215 if (rec->opts.text_poke) {
4231 if (record_opts__config(&rec->opts)) {
4248 if (rec->opts.nr_cblocks > nr_cblocks_max)
4249 rec->opts.nr_cblocks = nr_cblocks_max;
4250 pr_debug("nr_cblocks: %d\n", rec->opts.nr_cblocks);
4252 pr_debug("affinity: %s\n", affinity_tags[rec->opts.affinity]);
4253 pr_debug("mmap flush: %d\n", rec->opts.mmap_flush);
4255 if (rec->opts.comp_level > comp_level_max)
4256 rec->opts.comp_level = comp_level_max;
4257 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);