Lines Matching refs:record

3  * builtin-record.c
5 * Builtin record command: Record the profile of a workload
28 #include "util/record.h"
88 struct record {
123 static bool switch_output_signal(struct record *rec)
129 static bool switch_output_size(struct record *rec)
136 static bool switch_output_time(struct record *rec)
142 static bool record__output_max_size_exceeded(struct record *rec)
148 static int record__write(struct record *rec, struct mmap *map __maybe_unused,
161 fprintf(stderr, "[ perf record: perf size limit reached (%" PRIu64 " KB),"
173 static int record__aio_enabled(struct record *rec);
174 static int record__comp_enabled(struct record *rec);
286 struct record *rec;
336 static int record__aio_push(struct record *rec, struct mmap *map, off_t *off)
383 static void record__aio_mmap_read_sync(struct record *rec)
423 static int record__aio_push(struct record *rec __maybe_unused, struct mmap *map __maybe_unused,
438 static void record__aio_mmap_read_sync(struct record *rec __maybe_unused)
443 static int record__aio_enabled(struct record *rec)
504 static int record__comp_enabled(struct record *rec)
514 struct record *rec = container_of(tool, struct record, tool);
534 struct record *rec = to;
598 struct record *rec = container_of(tool, struct record, tool);
631 static int record__auxtrace_mmap_read(struct record *rec,
647 static int record__auxtrace_mmap_read_snapshot(struct record *rec,
664 static int record__auxtrace_read_snapshot_all(struct record *rec)
684 static void record__read_auxtrace_snapshot(struct record *rec, bool on_exit)
697 static int record__auxtrace_snapshot_exit(struct record *rec)
713 static int record__auxtrace_init(struct record *rec)
739 int record__auxtrace_mmap_read(struct record *rec __maybe_unused,
746 void record__read_auxtrace_snapshot(struct record *rec __maybe_unused,
758 int record__auxtrace_snapshot_exit(struct record *rec __maybe_unused)
763 static int record__auxtrace_init(struct record *rec __maybe_unused)
838 static int record__mmap_evlist(struct record *rec,
874 static int record__mmap(struct record *rec)
879 static int record__open(struct record *rec)
973 struct record *rec = container_of(tool, struct record, tool);
987 static int process_buildids(struct record *rec)
1022 *As for guest kernel when processing subcommand record&report,
1032 pr_err("Couldn't record guest kernel [%d]'s reference"
1042 pr_err("Couldn't record guest kernel [%d]'s reference"
1051 static void record__adjust_affinity(struct record *rec, struct mmap *map)
1066 static size_t process_comp_header(void *record, size_t increment)
1068 struct perf_record_compressed *event = record;
1097 static int record__mmap_read_evlist(struct record *rec, struct evlist *evlist,
1174 static int record__mmap_read_all(struct record *rec, bool synch)
1185 static void record__init_features(struct record *rec)
1219 record__finish_output(struct record *rec)
1241 static int record__synthesize_workload(struct record *rec, bool tail)
1261 static int record__synthesize(struct record *rec, bool tail);
1264 record__switch_output(struct record *rec, bool at_exit)
1296 fprintf(stderr, "[ perf record: Dump %s.%s ]\n",
1319 * In 'perf record --switch-output' without -a,
1364 static const struct perf_event_mmap_page *record__pick_pc(struct record *rec)
1374 static int record__synthesize(struct record *rec, bool tail)
1419 pr_err("Couldn't record tracing data.\n");
1450 WARN_ONCE(err < 0, "Couldn't record kernel reference relocation symbol\n"
1456 WARN_ONCE(err < 0, "Couldn't record kernel module information.\n"
1516 struct record *rec = data;
1521 static int record__setup_sb_evlist(struct record *rec)
1559 static int record__init_clock(struct record *rec)
1596 static void hit_auxtrace_snapshot_trigger(struct record *rec)
1606 static int __cmd_record(struct record *rec, int argc, const char **argv)
1910 fprintf(stderr, "[ perf record: dump data: Woken up %ld times ]\n",
1988 fprintf(stderr, "[ perf record: Woken up %ld times to write data ]\n", waking);
2049 fprintf(stderr, "[ perf record: Captured and wrote %.3f MB %s%s%s",
2084 int record_opts__parse_callchain(struct record_opts *record,
2102 record->sample_address = true;
2133 struct record *rec = cb;
2135 if (!strcmp(var, "record.build-id")) {
2146 if (!strcmp(var, "record.call-graph")) {
2147 var = "call-graph.record-mode";
2151 if (!strcmp(var, "record.aio")) {
2256 static void switch_output_size_warn(struct record *rec)
2273 static int switch_output_setup(struct record *rec)
2338 "perf record [<options>] [<command>]",
2339 "perf record [<options>] -- <command> [<options>]",
2379 static struct record record = {
2415 * from builtin-record.c, i.e. use record_opts,
2416 * perf_evlist__prepare_workload, etc instead of fork+exec'in 'perf record',
2420 OPT_CALLBACK('e', "event", &record.evlist, "event",
2423 OPT_CALLBACK(0, "filter", &record.evlist, "filter",
2425 OPT_CALLBACK_NOOPT(0, "exclude-perf", &record.evlist,
2426 NULL, "don't record events from perf itself",
2428 OPT_STRING('p', "pid", &record.opts.target.pid, "pid",
2429 "record events on existing process id"),
2430 OPT_STRING('t', "tid", &record.opts.target.tid, "tid",
2431 "record events on existing thread id"),
2432 OPT_INTEGER('r', "realtime", &record.realtime_prio,
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"),
2443 OPT_STRING('o', "output", &record.data.path, "file",
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,
2487 OPT_BOOLEAN_SET('N', "no-buildid-cache", &record.no_buildid_cache,
2488 &record.no_buildid_cache_set,
2490 OPT_BOOLEAN_SET('B', "no-buildid", &record.no_buildid,
2491 &record.no_buildid_set,
2493 OPT_CALLBACK('G', "cgroup", &record.evlist, "name",
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,
2555 OPT_BOOLEAN(0, "buildid-all", &record.buildid_all,
2557 OPT_BOOLEAN(0, "timestamp-filename", &record.timestamp_filename,
2559 OPT_BOOLEAN(0, "timestamp-boundary", &record.timestamp_boundary,
2561 OPT_STRING_OPTARG_SET(0, "switch-output", &record.switch_output.str,
2562 &record.switch_output.set, "signal or size[BKMG] or time[smhd]",
2565 OPT_CALLBACK_SET(0, "switch-output-event", &record.sb_evlist, &record.switch_output_event_set, "switch output event",
2568 OPT_INTEGER(0, "switch-max-files", &record.switch_output.num_files,
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,
2585 OPT_CALLBACK(0, "max-size", &record.output_max_size,
2588 &record.opts.nr_threads_synthesize,
2591 OPT_CALLBACK(0, "pfm-events", &record.evlist, "event",
2595 OPT_CALLBACK(0, "control", &record.opts, "fd:ctl-fd[,ack-fd] or fifo:ctl-fifo[,ack-fifo]",
2609 struct record *rec = &record;
2736 * In 'perf record --switch-output', disable buildid
2741 * perf record --switch-output --no-no-buildid \
2763 if (record.opts.overwrite)
2764 record.opts.tail_synthesize = true;
2767 __evlist__add_default(rec->evlist, !record.opts.no_samples) < 0) {
2835 err = __cmd_record(&record, argc, argv);
2848 struct record *rec = &record;
2858 struct record *rec = &record;