15 #include <subcmd/parse-options.h> 55 #include <linux/time64.h> 112 pr_err(
"failed to write perf data, error: %m\n");
129 struct record *rec = container_of(tool,
struct record, tool);
170 #ifdef HAVE_AUXTRACE_SUPPORT 174 size_t len1,
void *data2,
size_t len2)
176 struct record *rec = container_of(tool,
struct record, tool);
186 file_offset = lseek(fd, 0, SEEK_CUR);
187 if (file_offset == -1)
196 padding = (len1 + len2) & 7;
198 padding = 8 - padding;
215 record__process_auxtrace);
225 static int record__auxtrace_mmap_read_snapshot(
struct record *rec,
231 record__process_auxtrace,
242 static int record__auxtrace_read_snapshot_all(
struct record *rec)
254 if (record__auxtrace_mmap_read_snapshot(rec, mm) != 0) {
265 pr_debug(
"Recording AUX area tracing snapshot\n");
266 if (record__auxtrace_read_snapshot_all(rec) < 0) {
330 if (errno == EPERM) {
331 pr_err(
"Permission error mapping pages.\n" 332 "Consider increasing " 333 "/proc/sys/kernel/perf_event_mlock_kb,\n" 334 "or try again with a smaller value of -m/--mmap_pages.\n" 335 "(current value: %u,%u)\n",
339 pr_err(
"failed to mmap with %d (%s)\n", errno,
340 str_error_r(errno, msg,
sizeof(msg)));
378 pos->
attr.enable_on_exec = 1;
394 errno, msg,
sizeof(msg));
403 pr_err(
"failed to set filter \"%s\" on event %s with %d (%s)\n",
405 str_error_r(errno, msg,
sizeof(msg)));
411 pr_err(
"failed to set config \"%s\" on event %s with %d (%s)\n",
413 str_error_r(errno, msg,
sizeof(msg)));
434 struct record *rec = container_of(tool,
struct record, tool);
494 pr_err(
"Couldn't record guest kernel [%d]'s reference" 495 " relocation symbol.\n", machine->
pid);
504 pr_err(
"Couldn't record guest kernel [%d]'s reference" 505 " relocation symbol.\n", machine->
pid);
509 .size =
sizeof(
struct perf_event_header),
531 for (i = 0; i < evlist->
nr_mmaps; i++) {
627 if (thread_map == NULL)
648 char timestamp[] =
"InvalidTimestamp";
658 pr_err(
"Failed to get current timestamp\n");
665 if (fd >= 0 && !at_exit) {
671 fprintf(stderr,
"[ perf record: Dump %s.%s ]\n",
702 void *ucontext __maybe_unused)
721 static const struct perf_event_mmap_page *
735 const struct perf_event_mmap_page *pc;
764 pr_err(
"Couldn't synthesize attrs.\n");
771 pr_err(
"Couldn't synthesize features.\n");
787 pr_err(
"Couldn't record tracing data.\n");
809 WARN_ONCE(err < 0,
"Couldn't record kernel reference relocation symbol\n" 810 "Symbol resolution may be skewed if relocation was used (e.g. kexec).\n" 811 "Check /proc/kallsyms permission or run as root.\n");
815 WARN_ONCE(err < 0,
"Couldn't record kernel module information.\n" 816 "Symbol resolution may be skewed if relocation was used (e.g. kexec).\n" 817 "Check /proc/modules permission or run as root.\n");
836 pr_err(
"Couldn't synthesize thread map.\n");
843 pr_err(
"Couldn't synthesize cpu map.\n");
858 unsigned long waking = 0;
859 const bool forks = argc > 0;
864 bool disabled =
false, draining =
false;
887 if (session == NULL) {
888 pr_err(
"Perf session creation failed.\n");
902 pr_err(
"Couldn't run the workload!\n");
904 goto out_delete_session;
927 pr_err(
"ERROR: Apply config to BPF failed: %s\n",
937 pr_warning(
"WARNING: No sample_id_all support, falling back to unordered processing\n");
956 pr_err(
"Couldn't generate buildids. " 957 "Use --no-buildid to profile anyway.\n");
967 struct sched_param param;
970 if (sched_setscheduler(0, SCHED_FIFO, ¶m)) {
971 pr_err(
"Could not set realtime priority.\n");
1015 (NR_NAMESPACES *
sizeof(
struct perf_ns_link_info)) +
1017 if (event == NULL) {
1041 perf_hooks__invoke_record_start();
1043 unsigned long long hits = rec->
samples;
1068 pr_err(
"AUX area tracing snapshot failed\n");
1096 fprintf(stderr,
"[ perf record: dump data: Woken up %ld times ]\n",
1101 pr_err(
"Failed to switch to new file\n");
1113 if (
done || draining)
1120 if (err > 0 || (err < 0 && errno == EINTR))
1145 pr_err(
"Workload failed: %s\n", emsg);
1151 fprintf(stderr,
"[ perf record: Woken up %ld times to write data ]\n", waking);
1167 else if (WIFEXITED(exit_status))
1168 status = WEXITSTATUS(exit_status);
1169 else if (WIFSIGNALED(exit_status))
1170 signr = WTERMSIG(exit_status);
1185 goto out_delete_session;
1190 perf_hooks__invoke_record_end();
1192 if (!err && !
quiet) {
1195 ".<timestamp>" :
"";
1198 scnprintf(samples,
sizeof(samples),
1199 " (%" PRIu64
" samples)", rec->
samples);
1203 fprintf(stderr,
"[ perf record: Captured and wrote %.3f MB %s%s%s ]\n",
1205 data->
file.
path, postfix, samples);
1220 pr_debug(
"callchain: stack dump size %d\n",
1226 const char *arg,
bool unset)
1257 const char *arg __maybe_unused,
1258 int unset __maybe_unused)
1275 if (!strcmp(var,
"record.build-id")) {
1276 if (!strcmp(value,
"cache"))
1278 else if (!strcmp(value,
"no-cache"))
1280 else if (!strcmp(value,
"skip"))
1286 if (!strcmp(var,
"record.call-graph")) {
1287 var =
"call-graph.record-mode";
1299 #define CLOCKID_MAP(n, c) \ 1300 { .name = n, .clockid = (c), } 1302 #define CLOCKID_END { .name = NULL, } 1308 #ifndef CLOCK_MONOTONIC_RAW 1309 #define CLOCK_MONOTONIC_RAW 4 1311 #ifndef CLOCK_BOOTTIME 1312 #define CLOCK_BOOTTIME 7 1315 #define CLOCK_TAI 11 1341 const char *ostr = str;
1359 if (sscanf(str,
"%d", &opts->
clockid) == 1)
1363 if (!strncasecmp(str,
"CLOCK_", 6))
1366 for (cm = clockids; cm->
name; cm++) {
1367 if (!strcasecmp(str, cm->name)) {
1374 ui__warning(
"unknown clockid %s, check man page\n", ostr);
1380 int unset __maybe_unused)
1428 if (s->
size < wakeup_size) {
1432 pr_warning(
"WARNING: switch-output data size lower than " 1433 "wakeup kernel buffer size (%s) " 1434 "expect bigger perf.data sizes\n", buf);
1442 { .
tag =
'B', .mult = 1 },
1443 { .tag =
'K', .mult = 1 << 10 },
1444 { .tag =
'M', .mult = 1 << 20 },
1445 { .tag =
'G', .mult = 1 << 30 },
1449 { .
tag =
's', .mult = 1 },
1450 { .tag =
'm', .mult = 60 },
1451 { .tag =
'h', .mult = 60*60 },
1452 { .tag =
'd', .mult = 60*60*24 },
1460 if (!strcmp(s->
str,
"signal")) {
1462 pr_debug(
"switch-output with SIGUSR2 signal\n");
1467 if (val != (
unsigned long) -1) {
1469 pr_debug(
"switch-output with %s size threshold\n", s->
str);
1474 if (val != (
unsigned long) -1) {
1476 pr_debug(
"switch-output with %s time threshold (%lu seconds)\n",
1494 "perf record [<options>] [<command>]",
1495 "perf record [<options>] -- <command> [<options>]",
1513 .mmap_pages = UINT_MAX,
1514 .user_freq = UINT_MAX,
1515 .user_interval = ULLONG_MAX,
1519 .default_per_cpu =
true,
1521 .proc_map_timeout = 500,
1531 .ordered_events =
true,
1536 "\n\t\t\t\tDefault: fp";
1548 OPT_CALLBACK(
'e',
"event", &record.
evlist,
"event",
1549 "event selector. use 'perf list' to list available events",
1551 OPT_CALLBACK(0,
"filter", &record.
evlist,
"filter",
1553 OPT_CALLBACK_NOOPT(0,
"exclude-perf", &record.
evlist,
1554 NULL,
"don't record events from perf itself",
1557 "record events on existing process id"),
1559 "record events on existing thread id"),
1561 "collect data with this RT SCHED_FIFO priority"),
1563 "collect data without buffering"),
1565 "collect raw sample records from all opened counters"),
1567 "system-wide collection from all CPUs"),
1569 "list of cpus to monitor"),
1571 OPT_STRING(
'o',
"output", &record.
data.
file.
path,
"file",
1572 "output file name"),
1575 "child tasks do not inherit counters"),
1577 "synthesize non-sample events at the end of output"),
1578 OPT_BOOLEAN(0,
"overwrite", &record.
opts.
overwrite,
"use overwrite mode"),
1580 "Fail if the specified frequency can't be used"),
1581 OPT_CALLBACK(
'F',
"freq", &record.
opts,
"freq or 'max'",
1582 "profile at this frequency",
1584 OPT_CALLBACK(
'm',
"mmap-pages", &record.
opts,
"pages[,pages]",
1585 "number of mmap data pages and AUX area tracing mmap pages",
1587 OPT_BOOLEAN(0,
"group", &record.
opts.
group,
1588 "put the counters into a counter group"),
1590 NULL,
"enables call-graph recording" ,
1592 OPT_CALLBACK(0,
"call-graph", &record.
opts,
1595 OPT_INCR(
'v',
"verbose", &
verbose,
1596 "be more verbose (show counter open errors, etc)"),
1597 OPT_BOOLEAN(
'q',
"quiet", &
quiet,
"don't print any message"),
1599 "per thread counts"),
1600 OPT_BOOLEAN(
'd',
"data", &record.
opts.
sample_address,
"Record the sample addresses"),
1602 "Record the sample physical addresses"),
1603 OPT_BOOLEAN(0,
"sample-cpu", &record.
opts.
sample_cpu,
"Record the sample cpu"),
1606 "Record the sample timestamps"),
1608 "Record the sample period"),
1613 "do not update the buildid cache"),
1614 OPT_BOOLEAN_SET(
'B',
"no-buildid", &record.
no_buildid,
1616 "do not collect buildids in perf.data"),
1617 OPT_CALLBACK(
'G',
"cgroup", &record.
evlist,
"name",
1618 "monitor event in cgroup name only",
1621 "ms to wait before starting measurement after program start"),
1626 "branch any",
"sample any taken branches",
1630 "branch filter mask",
"branch stack filter modes",
1633 "sample by weight (on special events only)"),
1635 "sample transaction flags (special events only)"),
1637 "use per-thread mmaps"),
1639 "sample selected machine registers on interrupt," 1640 " use -I ? to list register names",
parse_regs),
1642 "sample selected machine registers on interrupt," 1643 " use -I ? to list register names",
parse_regs),
1645 "Record running/enabled time of read (:S) events"),
1646 OPT_CALLBACK(
'k',
"clockid", &record.
opts,
1647 "clockid",
"clockid to use for events, see clock_gettime()",
1650 "opts",
"AUX area tracing Snapshot Mode",
""),
1652 "per thread proc mmap processing timeout in ms"),
1654 "Record namespaces events"),
1656 "Record context switch events"),
1658 "Configure all used events to run in kernel space.",
1659 PARSE_OPT_EXCLUSIVE),
1661 "Configure all used events to run in user space.",
1662 PARSE_OPT_EXCLUSIVE),
1664 "clang binary to use for compiling BPF scriptlets"),
1666 "options passed to clang when compiling BPF scriptlets"),
1668 "file",
"vmlinux pathname"),
1669 OPT_BOOLEAN(0,
"buildid-all", &record.
buildid_all,
1670 "Record build-id of all DSOs regardless of hits"),
1672 "append timestamp to output filename"),
1674 "Record timestamp boundary (time of first/last samples)"),
1677 "Switch output when receive SIGUSR2 or cross size,time threshold",
1679 OPT_BOOLEAN(0,
"dry-run", &
dry_run,
1680 "Parse options then exit"),
1689 struct record *rec = &
record;
1690 char errbuf[BUFSIZ];
1692 setlocale(LC_ALL,
"");
1694 #ifndef HAVE_LIBBPF_SUPPORT 1695 # define set_nobuild(s, l, c) set_option_nobuild(record_options, s, l, "NO_LIBBPF=1", c) 1701 #ifndef HAVE_BPF_PROLOGUE 1702 # if !defined (HAVE_DWARF_SUPPORT) 1703 # define REASON "NO_DWARF=1" 1704 # elif !defined (HAVE_LIBBPF_SUPPORT) 1705 # define REASON "NO_LIBBPF=1" 1707 # define REASON "this architecture doesn't support BPF prologue" 1709 # define set_nobuild(s, l, c) set_option_nobuild(record_options, s, l, REASON, c) 1724 PARSE_OPT_STOP_AT_NON_OPTION);
1734 "cgroup monitoring only available in system-wide mode");
1739 ui__error(
"kernel does not support recording context switch events\n");
1772 pr_err(
"ERROR: Setup BPF stdout failed: %s\n",
1781 "WARNING: Kernel address maps (/proc/{kallsyms,modules}) are restricted,\n" 1782 "check /proc/sys/kernel/kptr_restrict.\n\n" 1783 "Samples in kernel functions may not be resolved if a suitable vmlinux\n" 1784 "file is not found in the buildid cache or in the vmlinux path.\n\n" 1785 "Samples in kernel modules won't be resolved at all.\n\n" 1786 "If some relocation was applied (e.g. kexec) symbols may be misresolved\n" 1787 "even with a suitable vmlinux or kallsyms file.\n\n");
1807 bool disable =
true;
1825 pr_err(
"Not enough memory for event selector list\n");
1840 int saved_errno = errno;
1883 struct record *rec = &
record;
1898 struct record *rec = &
record;
static volatile int child_finished
enum target_errno target__parse_uid(struct target *target)
bool perf_can_record_switch_events(void)
void perf_session__set_id_hdr_size(struct perf_session *session)
size_t auxtrace_snapshot_size
int perf_evlist__prepare_workload(struct perf_evlist *evlist, struct target *target, const char *argv[], bool pipe_output, void(*exec_error)(int signo, siginfo_t *info, void *ucontext))
static void trigger_on(struct trigger *t)
struct perf_evlist::@110 workload
int perf_event__synthesize_namespaces(struct perf_tool *tool, union perf_event *event, pid_t pid, pid_t tgid, perf_event__handler_t process, struct machine *machine)
struct perf_evlist * evlist
int parse_filter(const struct option *opt, const char *str, int unset __maybe_unused)
int __weak perf_event__synth_time_conv(const struct perf_event_mmap_page *pc __maybe_unused, struct perf_tool *tool __maybe_unused, perf_event__handler_t process __maybe_unused, struct machine *machine __maybe_unused)
static int record__switch_output(struct record *rec, bool at_exit)
int bpf__strerror_setup_stdout(struct perf_evlist *evlist __maybe_unused, int err, char *buf, size_t size)
union perf_evsel_config_term::@112 val
static unsigned long perf_data__size(struct perf_data *data)
const char * vmlinux_name
int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
int(* perf_event__handler_t)(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct machine *machine)
int exclude_perf(const struct option *opt, const char *arg __maybe_unused, int unset __maybe_unused)
static int switch_output_setup(struct record *rec)
int ui__error(const char *format,...)
int cmd_record(int argc, const char **argv)
struct auxtrace_record * auxtrace_record__init(struct perf_evlist *evlist, int *err)
int perf_event__synthesize_kernel_mmap(struct perf_tool *tool, perf_event__handler_t process, struct machine *machine)
static void workload_exec_failed_signal(int signo __maybe_unused, siginfo_t *info, void *ucontext __maybe_unused)
int perf_default_config(const char *var, const char *value, void *dummy __maybe_unused)
enum target_errno target__validate(struct target *target)
int perf_event__process_mmap(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
int perf_event__synthesize_auxtrace_info(struct auxtrace_record *itr, struct perf_tool *tool, struct perf_session *session, perf_event__handler_t process)
#define CALLCHAIN_RECORD_HELP
static int record__mmap(struct record *rec)
void disable_buildid_cache(void)
void perf_evlist__enable(struct perf_evlist *evlist)
int __perf_evlist__add_default(struct perf_evlist *evlist, bool precise)
void machines__process_guests(struct machines *machines, machine__process_t process, void *data)
static struct record record
static int parse_clockid(const struct option *opt, const char *str, int unset)
static int process_sample_event(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel, struct machine *machine)
int ui__warning(const char *format,...)
int __machine__synthesize_threads(struct machine *machine, struct perf_tool *tool, struct target *target, struct thread_map *threads, perf_event__handler_t process, bool data_mmap, unsigned int proc_map_timeout, unsigned int nr_threads_synthesize)
static void trigger_ready(struct trigger *t)
int perf_event__synthesize_modules(struct perf_tool *tool, perf_event__handler_t process, struct machine *machine)
struct auxtrace_record * itr
static int record__mmap_read_evlist(struct record *rec, struct perf_evlist *evlist, bool overwrite)
bool perf_evlist__exclude_kernel(struct perf_evlist *evlist)
unsigned int proc_map_timeout
bool perf_evlist__sample_id_all(struct perf_evlist *evlist)
static int record__synthesize(struct record *rec, bool tail)
const char * auxtrace_snapshot_opts
struct perf_data_file file
int auxtrace_parse_snapshot_options(struct auxtrace_record *itr, struct record_opts *opts, const char *str)
static void trigger_hit(struct trigger *t)
enum perf_call_graph_mode record_mode
static int record__parse_mmap_pages(const struct option *opt, const char *str, int unset __maybe_unused)
struct perf_evlist * evlist
void perf_evlist__delete(struct perf_evlist *evlist)
struct namespaces_event namespaces
int record_opts__parse_callchain(struct record_opts *record, struct callchain_param *callchain, const char *arg, bool unset)
int perf_event__process_comm(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
int auxtrace_record__options(struct auxtrace_record *itr, struct perf_evlist *evlist, struct record_opts *opts)
int auxtrace_mmap__read(struct auxtrace_mmap *mm, struct auxtrace_record *itr, struct perf_tool *tool, process_auxtrace_t fn)
int perf_event__process_exit(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
static int __cmd_record(struct record *rec, int argc, const char **argv)
int perf_event__process_fork(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
int perf_evlist__start_workload(struct perf_evlist *evlist)
struct thread_map * threads
int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages, unsigned int auxtrace_pages, bool auxtrace_overwrite)
int perf_event__synthesize_cpu_map(struct perf_tool *tool, struct cpu_map *map, perf_event__handler_t process, struct machine *machine)
struct thread_map * thread_map__new_by_tid(pid_t tid)
static bool target__none(struct target *target)
int auxtrace_record__snapshot_finish(struct auxtrace_record *itr)
static int record__write(struct record *rec, void *bf, size_t size)
static struct perf_event_header finished_round_event
pid_t perf_event__synthesize_comm(struct perf_tool *tool, union perf_event *event, pid_t pid, perf_event__handler_t process, struct machine *machine)
static int process_buildids(struct record *rec)
void perf_session__delete(struct perf_session *session)
int record_opts__config(struct record_opts *opts)
int perf_evlist__add_dummy(struct perf_evlist *evlist)
int bpf__strerror_apply_obj_config(int err, char *buf, size_t size)
int __perf_evlist__parse_mmap_pages(unsigned int *mmap_pages, const char *str)
int parse_cgroups(const struct option *opt, const char *str, int unset __maybe_unused)
static bool trigger_is_error(struct trigger *t)
struct perf_mmap * overwrite_mmap
int dsos__hit_all(struct perf_session *session)
int perf_quiet_option(void)
bool perf_evsel__fallback(struct perf_evsel *evsel, int err, char *msg, size_t msgsize)
int target__strerror(struct target *target, int errnum, char *buf, size_t buflen)
int build_id__mark_dso_hit(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct perf_evsel *evsel __maybe_unused, struct machine *machine)
int record__parse_freq(const struct option *opt, const char *str, int unset)
struct switch_output switch_output
static void record__finish_output(struct record *rec)
static int auxtrace_record__snapshot_start(struct auxtrace_record *itr __maybe_unused)
int auxtrace_parse_filters(struct perf_evlist *evlist)
static void record__init_features(struct record *rec)
static bool switch_output_size(struct record *rec)
bool no_buildid_cache_set
#define set_nobuild(s, l, c)
const char *const * record_usage
int perf_evlist__poll(struct perf_evlist *evlist, int timeout)
#define pr_debug(fmt,...)
static struct perf_session * session
#define evlist__for_each_entry(evlist, evsel)
int perf_evlist__apply_filters(struct perf_evlist *evlist, struct perf_evsel **err_evsel)
void perf_evlist__toggle_bkw_mmap(struct perf_evlist *evlist, enum bkw_mmap_state state)
static int record__open(struct record *rec)
static struct perf_tool tool
static int process_synthesized_event(struct perf_tool *tool, union perf_event *event, struct perf_sample *sample __maybe_unused, struct machine *machine __maybe_unused)
static bool trigger_is_hit(struct trigger *t)
const char record_callchain_help[]
int fetch_current_timestamp(char *buf, size_t sz)
int bpf__apply_obj_config(void)
static DEFINE_TRIGGER(auxtrace_snapshot_trigger)
int unit_number__scnprintf(char *buf, size_t size, u64 n)
#define CLOCK_MONOTONIC_RAW
static bool switch_output_time(struct record *rec)
unsigned long parse_tag_value(const char *str, struct parse_tag *tags)
void perf_evlist__config(struct perf_evlist *evlist, struct record_opts *opts, struct callchain_param *callchain)
int perf_evsel__open_strerror(struct perf_evsel *evsel, struct target *target, int err, char *msg, size_t size)
void auxtrace_record__free(struct auxtrace_record *itr)
static void perf_event__synthesize_guest_os(struct machine *machine, void *data)
int auxtrace_mmap__read_snapshot(struct auxtrace_mmap *mm, struct auxtrace_record *itr, struct perf_tool *tool, process_auxtrace_t fn, size_t snapshot_size)
static int perf_data__fd(struct perf_data *data)
struct thread_map * threads
bool ignore_vmlinux_buildid
static void alarm_sig_handler(int sig)
static void snapshot_sig_handler(int sig)
static int record__auxtrace_init(struct record *rec __maybe_unused)
unsigned long long samples
static struct option __record_options[]
bool auxtrace_snapshot_mode
const char * perf_evsel__name(struct perf_evsel *evsel)
int perf_evlist__apply_drv_configs(struct perf_evlist *evlist, struct perf_evsel **err_evsel, struct perf_evsel_config_term **err_term)
struct perf_event_header header
static const char *const __record_usage[]
static void trigger_error(struct trigger *t)
int perf_evsel__open(struct perf_evsel *evsel, struct cpu_map *cpus, struct thread_map *threads)
int bpf__setup_stdout(struct perf_evlist *evlist)
static int perf_data__is_pipe(struct perf_data *data)
struct perf_session * session
struct option * record_options
struct perf_session * perf_session__new(struct perf_data *data, bool repipe, struct perf_tool *tool)
static struct perf_evsel * perf_evlist__first(struct perf_evlist *evlist)
int perf_event__process_mmap2(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
enum bkw_mmap_state bkw_mmap_state
int parse_events_option(const struct option *opt, const char *str, int unset __maybe_unused)
void perf_evlist__disable(struct perf_evlist *evlist)
static int record__synthesize_workload(struct record *rec, bool tail)
int perf_config(config_fn_t fn, void *data)
int perf_session__process_events(struct perf_session *session)
static const struct perf_event_mmap_page * perf_evlist__pick_pc(struct perf_evlist *evlist)
struct list_head auxtrace_index
static const struct perf_event_mmap_page * record__pick_pc(struct record *rec)
static void callchain_debug(struct callchain_param *callchain)
int perf_evlist__filter_pollfd(struct perf_evlist *evlist, short revents_and_mask)
static int record__pushfn(void *to, void *bf, size_t size)
bool have_tracepoints(struct list_head *evlist)
bool ignore_missing_thread
int perf_event__synthesize_thread_map(struct perf_tool *tool, struct thread_map *threads, perf_event__handler_t process, struct machine *machine, bool mmap_data, unsigned int proc_map_timeout)
size_t perf_evlist__mmap_size(unsigned long pages)
ssize_t perf_data__write(struct perf_data *data, void *buf, size_t size)
struct perf_header header
int auxtrace_index__auxtrace_event(struct list_head *head, union perf_event *event, off_t file_offset)
int symbol__init(struct perf_env *env)
static int record__mmap_evlist(struct record *rec, struct perf_evlist *evlist)
static void record__sig_exit(void)
static int perf_record_config(const char *var, const char *value, void *cb)
static void trigger_off(struct trigger *t)
#define CLOCKID_MAP(n, c)
void thread_map__put(struct thread_map *map)
static struct perf_evsel * perf_evlist__last(struct perf_evlist *evlist)
static const struct clockid_map clockids[]
static void switch_output_size_warn(struct record *rec)
static volatile int auxtrace_record__snapshot_started
#define pr_warning(fmt,...)
static int record__auxtrace_mmap_read(struct record *rec __maybe_unused, struct auxtrace_mmap *mm __maybe_unused)
static bool switch_output_signal(struct record *rec)
int parse_callchain_record_opt(const char *arg, struct callchain_param *param)
int parse_regs(const struct option *opt, const char *str, int unset)
int perf_event__process_namespaces(struct perf_tool *tool __maybe_unused, union perf_event *event, struct perf_sample *sample, struct machine *machine)
static int record__mmap_read_all(struct record *rec)
int perf_data__switch(struct perf_data *data, const char *postfix, size_t pos, bool at_exit)
static volatile int workload_exec_errno
static void record__read_auxtrace_snapshot(struct record *rec __maybe_unused)
unsigned int auxtrace_mmap_pages
int perf_mmap__push(struct perf_mmap *md, void *to, int push(void *to, void *buf, size_t size))
void sighandler_dump_stack(int sig)
void perf_hooks__recover(void)
static bool trigger_is_ready(struct trigger *t)
struct perf_evlist * perf_evlist__new(void)
struct perf_event_attr attr
bool record_switch_events
static volatile int signr
struct auxtrace_mmap auxtrace_mmap
int record_parse_callchain_opt(const struct option *opt, const char *arg, int unset)
int record_callchain_opt(const struct option *opt, const char *arg __maybe_unused, int unset __maybe_unused)
static void sig_handler(int sig)
static void sigsegv_handler(int sig)
int parse_branch_stack(const struct option *opt, const char *str, int unset)
int perf_event__synthesize_thread_map2(struct perf_tool *tool, struct thread_map *threads, perf_event__handler_t process, struct machine *machine)