Lines Matching defs:record

3  * builtin-record.c
5 * Builtin record command: Record the profile of a workload
30 #include "util/record.h"
113 struct record *rec;
152 struct record {
203 static int record__threads_enabled(struct record *rec)
208 static bool switch_output_signal(struct record *rec)
214 static bool switch_output_size(struct record *rec)
221 static bool switch_output_time(struct record *rec)
227 static u64 record__bytes_written(struct record *rec)
232 static bool record__output_max_size_exceeded(struct record *rec)
238 static int record__write(struct record *rec, struct mmap *map __maybe_unused,
259 fprintf(stderr, "[ perf record: perf size limit reached (%" PRIu64 " KB),"
271 static int record__aio_enabled(struct record *rec);
272 static int record__comp_enabled(struct record *rec);
384 struct record *rec;
434 static int record__aio_push(struct record *rec, struct mmap *map, off_t *off)
481 static void record__aio_mmap_read_sync(struct record *rec)
521 static int record__aio_push(struct record *rec __maybe_unused, struct mmap *map __maybe_unused,
536 static void record__aio_mmap_read_sync(struct record *rec __maybe_unused)
541 static int record__aio_enabled(struct record *rec)
602 static int record__comp_enabled(struct record *rec)
612 struct record *rec = container_of(tool, struct record, tool);
633 struct record *rec = to;
702 struct record *rec = container_of(tool, struct record, tool);
735 static int record__auxtrace_mmap_read(struct record *rec,
751 static int record__auxtrace_mmap_read_snapshot(struct record *rec,
768 static int record__auxtrace_read_snapshot_all(struct record *rec)
788 static void record__read_auxtrace_snapshot(struct record *rec, bool on_exit)
801 static int record__auxtrace_snapshot_exit(struct record *rec)
817 static int record__auxtrace_init(struct record *rec)
851 int record__auxtrace_mmap_read(struct record *rec __maybe_unused,
858 void record__read_auxtrace_snapshot(struct record *rec __maybe_unused,
870 int record__auxtrace_snapshot_exit(struct record *rec __maybe_unused)
875 static int record__auxtrace_init(struct record *rec __maybe_unused)
904 static int record__config_off_cpu(struct record *rec)
1070 static void record__free_thread_data(struct record *rec)
1088 static int record__map_thread_evlist_pollfd_indexes(struct record *rec,
1102 static int record__update_evlist_pollfd_from_thread(struct record *rec,
1126 static int record__dup_non_perf_events(struct record *rec,
1152 static int record__alloc_thread_data(struct record *rec, struct evlist *evlist)
1216 static int record__mmap_evlist(struct record *rec,
1275 static int record__mmap(struct record *rec)
1280 static int record__open(struct record *rec)
1370 static void set_timestamp_boundary(struct record *rec, u64 sample_time)
1385 struct record *rec = container_of(tool, struct record, tool);
1396 static int process_buildids(struct record *rec)
1431 *As for guest kernel when processing subcommand record&report,
1441 pr_err("Couldn't record guest kernel [%d]'s reference"
1451 pr_err("Couldn't record guest kernel [%d]'s reference"
1465 static void record__adjust_affinity(struct record *rec, struct mmap *map)
1482 static size_t process_comp_header(void *record, size_t increment)
1484 struct perf_record_compressed *event = record;
1522 static int record__mmap_read_evlist(struct record *rec, struct evlist *evlist,
1606 static int record__mmap_read_all(struct record *rec, bool synch)
1688 static void record__init_features(struct record *rec)
1726 record__finish_output(struct record *rec)
1753 static int record__synthesize_workload(struct record *rec, bool tail)
1775 static int write_finished_init(struct record *rec, bool tail)
1783 static int record__synthesize(struct record *rec, bool tail);
1786 record__switch_output(struct record *rec, bool at_exit)
1820 fprintf(stderr, "[ perf record: Dump %s.%s ]\n",
1843 * In 'perf record --switch-output' without -a,
1858 static void __record__save_lost_samples(struct record *rec, struct evsel *evsel,
1880 static void record__read_lost_samples(struct record *rec)
1965 static const struct perf_event_mmap_page *record__pick_pc(struct record *rec)
1973 static int record__synthesize(struct record *rec, bool tail)
2017 WARN_ONCE(err < 0, "Couldn't record kernel reference relocation symbol\n"
2023 WARN_ONCE(err < 0, "Couldn't record kernel module information.\n"
2097 struct record *rec = data;
2102 static int record__setup_sb_evlist(struct record *rec)
2140 static int record__init_clock(struct record *rec)
2177 static void hit_auxtrace_snapshot_trigger(struct record *rec)
2205 static int record__start_threads(struct record *rec)
2268 static int record__stop_threads(struct record *rec)
2294 static unsigned long record__waking(struct record *rec)
2306 static int __cmd_record(struct record *rec, int argc, const char **argv)
2428 pr_debug3("perf record opening and mmapping events\n");
2434 pr_debug3("perf record done opening and mmapping events\n");
2568 pr_debug3("perf record has started\n");
2637 fprintf(stderr, "[ perf record: dump data: Woken up %ld times ]\n",
2733 fprintf(stderr, "[ perf record: Woken up %ld times to write data ]\n",
2804 fprintf(stderr, "[ perf record: Captured and wrote %.3f MB %s%s%s",
2843 int record_opts__parse_callchain(struct record_opts *record,
2861 record->sample_address = true;
2892 struct record *rec = cb;
2894 if (!strcmp(var, "record.build-id")) {
2907 if (!strcmp(var, "record.call-graph")) {
2908 var = "call-graph.record-mode";
2912 if (!strcmp(var, "record.aio")) {
2918 if (!strcmp(var, "record.debuginfod")) {
2930 struct record *rec = (struct record *)opt->value;
3105 static void switch_output_size_warn(struct record *rec)
3122 static int switch_output_setup(struct record *rec)
3197 "perf record [<options>] [<command>]",
3198 "perf record [<options>] -- <command> [<options>]",
3233 struct record *rec = container_of(tool, struct record, tool);
3269 static struct record record = {
3306 .evlistp = &record.evlist,
3310 .evlistp = &record.sb_evlist,
3316 * from builtin-record.c, i.e. use record_opts,
3317 * evlist__prepare_workload, etc instead of fork+exec'in 'perf record',
3324 OPT_CALLBACK(0, "filter", &record.evlist, "filter",
3326 OPT_CALLBACK_NOOPT(0, "exclude-perf", &record.evlist,
3327 NULL, "don't record events from perf itself",
3329 OPT_STRING('p', "pid", &record.opts.target.pid, "pid",
3330 "record events on existing process id"),
3331 OPT_STRING('t', "tid", &record.opts.target.tid, "tid",
3332 "record events on existing thread id"),
3333 OPT_INTEGER('r', "realtime", &record.realtime_prio,
3335 OPT_BOOLEAN(0, "no-buffering", &record.opts.no_buffering,
3337 OPT_BOOLEAN('R', "raw-samples", &record.opts.raw_samples,
3339 OPT_BOOLEAN('a', "all-cpus", &record.opts.target.system_wide,
3341 OPT_STRING('C', "cpu", &record.opts.target.cpu_list, "cpu",
3343 OPT_U64('c', "count", &record.opts.user_interval, "event period to sample"),
3344 OPT_STRING('o', "output", &record.data.path, "file",
3346 OPT_BOOLEAN_SET('i', "no-inherit", &record.opts.no_inherit,
3347 &record.opts.no_inherit_set,
3349 OPT_BOOLEAN(0, "tail-synthesize", &record.opts.tail_synthesize,
3351 OPT_BOOLEAN(0, "overwrite", &record.opts.overwrite, "use overwrite mode"),
3352 OPT_BOOLEAN(0, "no-bpf-event", &record.opts.no_bpf_event, "do not record bpf events"),
3353 OPT_BOOLEAN(0, "strict-freq", &record.opts.strict_freq,
3355 OPT_CALLBACK('F', "freq", &record.opts, "freq or 'max'",
3358 OPT_CALLBACK('m', "mmap-pages", &record.opts, "pages[,pages]",
3361 OPT_CALLBACK(0, "mmap-flush", &record.opts, "number",
3367 OPT_CALLBACK(0, "call-graph", &record.opts,
3373 OPT_BOOLEAN('s', "stat", &record.opts.inherit_stat,
3375 OPT_BOOLEAN('d', "data", &record.opts.sample_address, "Record the sample addresses"),
3376 OPT_BOOLEAN(0, "phys-data", &record.opts.sample_phys_addr,
3378 OPT_BOOLEAN(0, "data-page-size", &record.opts.sample_data_page_size,
3380 OPT_BOOLEAN(0, "code-page-size", &record.opts.sample_code_page_size,
3382 OPT_BOOLEAN(0, "sample-cpu", &record.opts.sample_cpu, "Record the sample cpu"),
3383 OPT_BOOLEAN(0, "sample-identifier", &record.opts.sample_identifier,
3385 OPT_BOOLEAN_SET('T', "timestamp", &record.opts.sample_time,
3386 &record.opts.sample_time_set,
3388 OPT_BOOLEAN_SET('P', "period", &record.opts.period, &record.opts.period_set,
3390 OPT_BOOLEAN('n', "no-samples", &record.opts.no_samples,
3392 OPT_BOOLEAN_SET('N', "no-buildid-cache", &record.no_buildid_cache,
3393 &record.no_buildid_cache_set,
3395 OPT_BOOLEAN_SET('B', "no-buildid", &record.no_buildid,
3396 &record.no_buildid_set,
3398 OPT_CALLBACK('G', "cgroup", &record.evlist, "name",
3401 OPT_CALLBACK('D', "delay", &record, "ms",
3405 OPT_BOOLEAN(0, "kcore", &record.opts.kcore, "copy /proc/kcore"),
3406 OPT_STRING('u', "uid", &record.opts.target.uid_str, "user",
3409 OPT_CALLBACK_NOOPT('b', "branch-any", &record.opts.branch_stack,
3413 OPT_CALLBACK('j', "branch-filter", &record.opts.branch_stack,
3416 OPT_BOOLEAN('W', "weight", &record.opts.sample_weight,
3418 OPT_BOOLEAN(0, "transaction", &record.opts.sample_transaction,
3420 OPT_BOOLEAN(0, "per-thread", &record.opts.target.per_thread,
3422 OPT_CALLBACK_OPTARG('I', "intr-regs", &record.opts.sample_intr_regs, NULL, "any register",
3425 OPT_CALLBACK_OPTARG(0, "user-regs", &record.opts.sample_user_regs, NULL, "any register",
3428 OPT_BOOLEAN(0, "running-time", &record.opts.running_time,
3430 OPT_CALLBACK('k', "clockid", &record.opts,
3433 OPT_STRING_OPTARG('S', "snapshot", &record.opts.auxtrace_snapshot_opts,
3435 OPT_STRING_OPTARG(0, "aux-sample", &record.opts.auxtrace_sample_opts,
3439 OPT_BOOLEAN(0, "namespaces", &record.opts.record_namespaces,
3441 OPT_BOOLEAN(0, "all-cgroups", &record.opts.record_cgroup,
3443 OPT_BOOLEAN_SET(0, "switch-events", &record.opts.record_switch_events,
3444 &record.opts.record_switch_events_set,
3446 OPT_BOOLEAN_FLAG(0, "all-kernel", &record.opts.all_kernel,
3449 OPT_BOOLEAN_FLAG(0, "all-user", &record.opts.all_user,
3452 OPT_BOOLEAN(0, "kernel-callchains", &record.opts.kernel_callchains,
3454 OPT_BOOLEAN(0, "user-callchains", &record.opts.user_callchains,
3458 OPT_BOOLEAN(0, "buildid-all", &record.buildid_all,
3460 OPT_BOOLEAN(0, "buildid-mmap", &record.buildid_mmap,
3462 OPT_BOOLEAN(0, "timestamp-filename", &record.timestamp_filename,
3464 OPT_BOOLEAN(0, "timestamp-boundary", &record.timestamp_boundary,
3466 OPT_STRING_OPTARG_SET(0, "switch-output", &record.switch_output.str,
3467 &record.switch_output.set, "signal or size[BKMG] or time[smhd]",
3471 &record.switch_output_event_set, "switch output event",
3474 OPT_INTEGER(0, "switch-max-files", &record.switch_output.num_files,
3479 OPT_CALLBACK_OPTARG(0, "aio", &record.opts,
3483 OPT_CALLBACK(0, "affinity", &record.opts, "node|cpu",
3487 OPT_CALLBACK_OPTARG('z', "compression-level", &record.opts, &comp_level_default, "n",
3491 OPT_CALLBACK(0, "max-size", &record.output_max_size,
3494 &record.opts.nr_threads_synthesize,
3497 OPT_CALLBACK(0, "pfm-events", &record.evlist, "event",
3501 OPT_CALLBACK(0, "control", &record.opts, "fd:ctl-fd[,ack-fd] or fifo:ctl-fifo[,ack-fifo]",
3507 OPT_CALLBACK(0, "synth", &record.opts, "no|all|task|mmap|cgroup",
3509 OPT_STRING_OPTARG_SET(0, "debuginfod", &record.debuginfod.urls,
3510 &record.debuginfod.set, "debuginfod urls",
3513 OPT_CALLBACK_OPTARG(0, "threads", &record.opts, NULL, "spec",
3516 OPT_BOOLEAN(0, "off-cpu", &record.off_cpu, "Enable off-cpu analysis"),
3559 static void record__free_thread_masks(struct record *rec, int nr_threads)
3570 static int record__alloc_thread_masks(struct record *rec, int nr_threads, int nr_bits)
3596 static int record__init_thread_cpu_masks(struct record *rec, struct perf_cpu_map *cpus)
3621 static int record__init_thread_masks_spec(struct record *rec, struct perf_cpu_map *cpus,
3735 static int record__init_thread_core_masks(struct record *rec, struct perf_cpu_map *cpus)
3753 static int record__init_thread_package_masks(struct record *rec, struct perf_cpu_map *cpus)
3771 static int record__init_thread_numa_masks(struct record *rec, struct perf_cpu_map *cpus)
3803 static int record__init_thread_user_masks(struct record *rec, struct perf_cpu_map *cpus)
3873 static int record__init_thread_default_masks(struct record *rec, struct perf_cpu_map *cpus)
3889 static int record__init_thread_masks(struct record *rec)
3928 struct record *rec = &record;
3958 perf_debuginfod_setup(&record.debuginfod);
3972 pr_err("Failed: no support to record build id in mmap events, update your kernel.\n");
4067 * In 'perf record --switch-output', disable buildid
4072 * perf record --switch-output --no-no-buildid \
4094 if (record.opts.overwrite)
4095 record.opts.tail_synthesize = true;
4194 err = __cmd_record(&record, argc, argv);
4208 struct record *rec = &record;
4218 struct record *rec = &record;