Lines Matching refs:opts
90 struct record_opts opts; member
407 struct record_opts *opts = (struct record_opts *)opt->value; in record__aio_parse() local
410 opts->nr_cblocks = 0; in record__aio_parse()
413 opts->nr_cblocks = strtol(str, NULL, 0); in record__aio_parse()
414 if (!opts->nr_cblocks) in record__aio_parse()
415 opts->nr_cblocks = nr_cblocks_default; in record__aio_parse()
445 return rec->opts.nr_cblocks > 0; in record__aio_enabled()
454 struct record_opts *opts = (struct record_opts *)opt->value; in record__mmap_flush_parse() local
467 opts->mmap_flush = parse_tag_value(str, tags); in record__mmap_flush_parse()
468 if (opts->mmap_flush == (int)-1) in record__mmap_flush_parse()
469 opts->mmap_flush = strtol(str, NULL, 0); in record__mmap_flush_parse()
472 if (!opts->mmap_flush) in record__mmap_flush_parse()
473 opts->mmap_flush = MMAP_FLUSH_DEFAULT; in record__mmap_flush_parse()
475 flush_max = evlist__mmap_size(opts->mmap_pages); in record__mmap_flush_parse()
477 if (opts->mmap_flush > flush_max) in record__mmap_flush_parse()
478 opts->mmap_flush = flush_max; in record__mmap_flush_parse()
488 struct record_opts *opts = opt->value; in record__parse_comp_level() local
491 opts->comp_level = 0; in record__parse_comp_level()
494 opts->comp_level = strtol(str, NULL, 0); in record__parse_comp_level()
495 if (!opts->comp_level) in record__parse_comp_level()
496 opts->comp_level = comp_level_default; in record__parse_comp_level()
506 return rec->opts.comp_level > 0; in record__comp_enabled()
654 rec->opts.auxtrace_snapshot_size); in record__auxtrace_mmap_read_snapshot()
723 err = auxtrace_parse_snapshot_options(rec->itr, &rec->opts, in record__auxtrace_init()
724 rec->opts.auxtrace_snapshot_opts); in record__auxtrace_init()
728 err = auxtrace_parse_sample_options(rec->itr, rec->evlist, &rec->opts, in record__auxtrace_init()
729 rec->opts.auxtrace_sample_opts); in record__auxtrace_init()
841 struct record_opts *opts = &rec->opts; in record__mmap_evlist() local
842 bool auxtrace_overwrite = opts->auxtrace_snapshot_mode || in record__mmap_evlist()
843 opts->auxtrace_sample_mode; in record__mmap_evlist()
846 if (opts->affinity != PERF_AFFINITY_SYS) in record__mmap_evlist()
849 if (evlist__mmap_ex(evlist, opts->mmap_pages, in record__mmap_evlist()
850 opts->auxtrace_mmap_pages, in record__mmap_evlist()
852 opts->nr_cblocks, opts->affinity, in record__mmap_evlist()
853 opts->mmap_flush, opts->comp_level) < 0) { in record__mmap_evlist()
860 opts->mmap_pages, opts->auxtrace_mmap_pages); in record__mmap_evlist()
885 struct record_opts *opts = &rec->opts; in record__open() local
893 if (opts->initial_delay || target__has_cpu(&opts->target)) { in record__open()
907 if (opts->initial_delay && !pos->immediate) in record__open()
913 perf_evlist__config(evlist, opts, &callchain_param); in record__open()
930 evsel__open_strerror(pos, &opts->target, errno, msg, sizeof(msg)); in record__open()
1053 if (rec->opts.affinity != PERF_AFFINITY_SYS && in record__adjust_affinity()
1150 if (map->auxtrace_mmap.base && !rec->opts.auxtrace_snapshot_mode && in record__mmap_read_evlist()
1151 !rec->opts.auxtrace_sample_mode && in record__mmap_read_evlist()
1199 if (!rec->opts.branch_stack) in record__init_features()
1202 if (!rec->opts.full_auxtrace) in record__init_features()
1205 if (!(rec->opts.use_clockid && rec->opts.clockid_res_ns)) in record__init_features()
1208 if (!rec->opts.use_clockid) in record__init_features()
1246 if (rec->opts.tail_synthesize != tail) in record__synthesize_workload()
1256 rec->opts.sample_address); in record__synthesize_workload()
1276 if (target__none(&rec->opts.target)) in record__switch_output()
1327 if (target__none(&rec->opts.target)) in record__switch_output()
1379 struct record_opts *opts = &rec->opts; in record__synthesize() local
1385 if (rec->opts.tail_synthesize != tail) in record__synthesize()
1432 if (rec->opts.auxtrace_sample_mode) { in record__synthesize()
1440 if (rec->opts.full_auxtrace) { in record__synthesize()
1489 machine, opts); in record__synthesize()
1498 if (rec->opts.nr_threads_synthesize > 1) { in record__synthesize()
1503 err = __machine__synthesize_threads(machine, tool, &opts->target, rec->evlist->core.threads, in record__synthesize()
1504 f, opts->sample_address, in record__synthesize()
1505 rec->opts.nr_threads_synthesize); in record__synthesize()
1507 if (rec->opts.nr_threads_synthesize > 1) in record__synthesize()
1523 struct record_opts *opts = &rec->opts; in record__setup_sb_evlist() local
1535 if (!opts->no_bpf_event) { in record__setup_sb_evlist()
1551 if (perf_evlist__start_sb_thread(rec->sb_evlist, &rec->opts.target)) { in record__setup_sb_evlist()
1553 opts->no_bpf_event = true; in record__setup_sb_evlist()
1566 if (!rec->opts.use_clockid) in record__init_clock()
1569 if (rec->opts.use_clockid && rec->opts.clockid_res_ns) in record__init_clock()
1570 session->header.env.clock.clockid_res_ns = rec->opts.clockid_res_ns; in record__init_clock()
1572 session->header.env.clock.clockid = rec->opts.clockid; in record__init_clock()
1579 if (clock_gettime(rec->opts.clockid, &ref_clockid)) { in record__init_clock()
1613 struct record_opts *opts = &rec->opts; in __cmd_record() local
1627 if (rec->opts.record_namespaces) in __cmd_record()
1630 if (rec->opts.record_cgroup) { in __cmd_record()
1639 if (rec->opts.auxtrace_snapshot_mode || rec->switch_output.enabled) { in __cmd_record()
1641 if (rec->opts.auxtrace_snapshot_mode) in __cmd_record()
1658 if (zstd_init(&session->zstd_data, rec->opts.comp_level) < 0) { in __cmd_record()
1678 session->header.env.comp_level = rec->opts.comp_level; in __cmd_record()
1680 if (rec->opts.kcore && in __cmd_record()
1692 err = perf_evlist__prepare_workload(rec->evlist, &opts->target, in __cmd_record()
1709 rec->opts.sample_id = true; in __cmd_record()
1717 if (rec->opts.kcore) { in __cmd_record()
1789 if (!target__none(&opts->target) && !opts->initial_delay) in __cmd_record()
1841 if (evlist__initialize_ctlfd(rec->evlist, opts->ctl_fd, opts->ctl_fd_ack)) in __cmd_record()
1844 if (opts->initial_delay) { in __cmd_record()
1846 if (opts->initial_delay > 0) { in __cmd_record()
1847 usleep(opts->initial_delay * USEC_PER_MSEC); in __cmd_record()
1966 if (done && !disabled && !target__none(&opts->target)) { in __cmd_record()
1976 if (opts->auxtrace_snapshot_on_exit) in __cmd_record()
1990 if (target__none(&rec->opts.target)) in __cmd_record()
2043 if (rec->samples && !rec->opts.full_auxtrace) in __cmd_record()
2068 if (!opts->no_bpf_event) in __cmd_record()
2152 rec->opts.nr_cblocks = strtol(value, NULL, 0); in perf_record_config()
2153 if (!rec->opts.nr_cblocks) in perf_record_config()
2154 rec->opts.nr_cblocks = nr_cblocks_default; in perf_record_config()
2164 struct record_opts *opts = (struct record_opts *)opt->value; in record__parse_affinity() local
2170 opts->affinity = PERF_AFFINITY_NODE; in record__parse_affinity()
2172 opts->affinity = PERF_AFFINITY_CPU; in record__parse_affinity()
2208 struct record_opts *opts = opt->value; in record__parse_mmap_pages() local
2228 opts->mmap_pages = mmap_pages; in record__parse_mmap_pages()
2240 opts->auxtrace_mmap_pages = mmap_pages; in record__parse_mmap_pages()
2251 struct record_opts *opts = opt->value; in parse_control_option() local
2253 return evlist__parse_control(str, &opts->ctl_fd, &opts->ctl_fd_ack, &opts->ctl_fd_close); in parse_control_option()
2258 u64 wakeup_size = evlist__mmap_size(rec->opts.mmap_pages); in switch_output_size_warn()
2331 if (s->size && !rec->opts.no_buffering) in switch_output_setup()
2380 .opts = {
2428 OPT_STRING('p', "pid", &record.opts.target.pid, "pid",
2430 OPT_STRING('t', "tid", &record.opts.target.tid, "tid",
2434 OPT_BOOLEAN(0, "no-buffering", &record.opts.no_buffering,
2436 OPT_BOOLEAN('R', "raw-samples", &record.opts.raw_samples,
2438 OPT_BOOLEAN('a', "all-cpus", &record.opts.target.system_wide,
2440 OPT_STRING('C', "cpu", &record.opts.target.cpu_list, "cpu",
2442 OPT_U64('c', "count", &record.opts.user_interval, "event period to sample"),
2445 OPT_BOOLEAN_SET('i', "no-inherit", &record.opts.no_inherit,
2446 &record.opts.no_inherit_set,
2448 OPT_BOOLEAN(0, "tail-synthesize", &record.opts.tail_synthesize,
2450 OPT_BOOLEAN(0, "overwrite", &record.opts.overwrite, "use overwrite mode"),
2451 OPT_BOOLEAN(0, "no-bpf-event", &record.opts.no_bpf_event, "do not record bpf events"),
2452 OPT_BOOLEAN(0, "strict-freq", &record.opts.strict_freq,
2454 OPT_CALLBACK('F', "freq", &record.opts, "freq or 'max'",
2457 OPT_CALLBACK('m', "mmap-pages", &record.opts, "pages[,pages]",
2460 OPT_CALLBACK(0, "mmap-flush", &record.opts, "number",
2463 OPT_BOOLEAN(0, "group", &record.opts.group,
2468 OPT_CALLBACK(0, "call-graph", &record.opts,
2474 OPT_BOOLEAN('s', "stat", &record.opts.inherit_stat,
2476 OPT_BOOLEAN('d', "data", &record.opts.sample_address, "Record the sample addresses"),
2477 OPT_BOOLEAN(0, "phys-data", &record.opts.sample_phys_addr,
2479 OPT_BOOLEAN(0, "sample-cpu", &record.opts.sample_cpu, "Record the sample cpu"),
2480 OPT_BOOLEAN_SET('T', "timestamp", &record.opts.sample_time,
2481 &record.opts.sample_time_set,
2483 OPT_BOOLEAN_SET('P', "period", &record.opts.period, &record.opts.period_set,
2485 OPT_BOOLEAN('n', "no-samples", &record.opts.no_samples,
2496 OPT_INTEGER('D', "delay", &record.opts.initial_delay,
2498 OPT_BOOLEAN(0, "kcore", &record.opts.kcore, "copy /proc/kcore"),
2499 OPT_STRING('u', "uid", &record.opts.target.uid_str, "user",
2502 OPT_CALLBACK_NOOPT('b', "branch-any", &record.opts.branch_stack,
2506 OPT_CALLBACK('j', "branch-filter", &record.opts.branch_stack,
2509 OPT_BOOLEAN('W', "weight", &record.opts.sample_weight,
2511 OPT_BOOLEAN(0, "transaction", &record.opts.sample_transaction,
2513 OPT_BOOLEAN(0, "per-thread", &record.opts.target.per_thread,
2515 OPT_CALLBACK_OPTARG('I', "intr-regs", &record.opts.sample_intr_regs, NULL, "any register",
2518 OPT_CALLBACK_OPTARG(0, "user-regs", &record.opts.sample_user_regs, NULL, "any register",
2521 OPT_BOOLEAN(0, "running-time", &record.opts.running_time,
2523 OPT_CALLBACK('k', "clockid", &record.opts,
2526 OPT_STRING_OPTARG('S', "snapshot", &record.opts.auxtrace_snapshot_opts,
2528 OPT_STRING_OPTARG(0, "aux-sample", &record.opts.auxtrace_sample_opts,
2532 OPT_BOOLEAN(0, "namespaces", &record.opts.record_namespaces,
2534 OPT_BOOLEAN(0, "all-cgroups", &record.opts.record_cgroup,
2536 OPT_BOOLEAN_SET(0, "switch-events", &record.opts.record_switch_events,
2537 &record.opts.record_switch_events_set,
2539 OPT_BOOLEAN_FLAG(0, "all-kernel", &record.opts.all_kernel,
2542 OPT_BOOLEAN_FLAG(0, "all-user", &record.opts.all_user,
2545 OPT_BOOLEAN(0, "kernel-callchains", &record.opts.kernel_callchains,
2547 OPT_BOOLEAN(0, "user-callchains", &record.opts.user_callchains,
2573 OPT_CALLBACK_OPTARG(0, "aio", &record.opts,
2577 OPT_CALLBACK(0, "affinity", &record.opts, "node|cpu",
2581 OPT_CALLBACK_OPTARG('z', "compression-level", &record.opts, &comp_level_default,
2588 &record.opts.nr_threads_synthesize,
2595 OPT_CALLBACK(0, "control", &record.opts, "fd:ctl-fd[,ack-fd] or fifo:ctl-fifo[,ack-fifo]",
2635 rec->opts.affinity = PERF_AFFINITY_SYS; in cmd_record()
2651 if (!argc && target__none(&rec->opts.target)) in cmd_record()
2652 rec->opts.target.system_wide = true; in cmd_record()
2654 if (nr_cgroups && !rec->opts.target.system_wide) { in cmd_record()
2660 if (rec->opts.kcore) in cmd_record()
2663 if (rec->opts.comp_level != 0) { in cmd_record()
2668 if (rec->opts.record_switch_events && in cmd_record()
2704 if (rec->opts.affinity != PERF_AFFINITY_SYS) { in cmd_record()
2763 if (record.opts.overwrite) in cmd_record()
2764 record.opts.tail_synthesize = true; in cmd_record()
2767 __evlist__add_default(rec->evlist, !record.opts.no_samples) < 0) { in cmd_record()
2772 if (rec->opts.target.tid && !rec->opts.no_inherit_set) in cmd_record()
2773 rec->opts.no_inherit = true; in cmd_record()
2775 err = target__validate(&rec->opts.target); in cmd_record()
2777 target__strerror(&rec->opts.target, err, errbuf, BUFSIZ); in cmd_record()
2781 err = target__parse_uid(&rec->opts.target); in cmd_record()
2785 target__strerror(&rec->opts.target, err, errbuf, BUFSIZ); in cmd_record()
2793 rec->opts.ignore_missing_thread = rec->opts.target.uid != UINT_MAX || rec->opts.target.pid; in cmd_record()
2796 if (perf_evlist__create_maps(rec->evlist, &rec->opts.target) < 0) in cmd_record()
2799 err = auxtrace_record__options(rec->itr, rec->evlist, &rec->opts); in cmd_record()
2808 if (rec->opts.full_auxtrace) in cmd_record()
2811 if (rec->opts.text_poke) { in cmd_record()
2819 if (record_opts__config(&rec->opts)) { in cmd_record()
2824 if (rec->opts.nr_cblocks > nr_cblocks_max) in cmd_record()
2825 rec->opts.nr_cblocks = nr_cblocks_max; in cmd_record()
2826 pr_debug("nr_cblocks: %d\n", rec->opts.nr_cblocks); in cmd_record()
2828 pr_debug("affinity: %s\n", affinity_tags[rec->opts.affinity]); in cmd_record()
2829 pr_debug("mmap flush: %d\n", rec->opts.mmap_flush); in cmd_record()
2831 if (rec->opts.comp_level > comp_level_max) in cmd_record()
2832 rec->opts.comp_level = comp_level_max; in cmd_record()
2833 pr_debug("comp level: %d\n", rec->opts.comp_level); in cmd_record()
2842 evlist__close_control(rec->opts.ctl_fd, rec->opts.ctl_fd_ack, &rec->opts.ctl_fd_close); in cmd_record()