0001
0002 #ifndef _PERF_RECORD_H
0003 #define _PERF_RECORD_H
0004
0005 #include <time.h>
0006 #include <stdbool.h>
0007 #include <linux/types.h>
0008 #include <linux/stddef.h>
0009 #include <linux/perf_event.h>
0010 #include "util/target.h"
0011
0012 struct option;
0013
0014 struct record_opts {
0015 struct target target;
0016 bool group;
0017 bool inherit_stat;
0018 bool no_buffering;
0019 bool no_inherit;
0020 bool no_inherit_set;
0021 bool no_samples;
0022 bool raw_samples;
0023 bool sample_address;
0024 bool sample_phys_addr;
0025 bool sample_data_page_size;
0026 bool sample_code_page_size;
0027 bool sample_weight;
0028 bool sample_time;
0029 bool sample_time_set;
0030 bool sample_cpu;
0031 bool sample_identifier;
0032 bool period;
0033 bool period_set;
0034 bool running_time;
0035 bool full_auxtrace;
0036 bool auxtrace_snapshot_mode;
0037 bool auxtrace_snapshot_on_exit;
0038 bool auxtrace_sample_mode;
0039 bool record_namespaces;
0040 bool record_cgroup;
0041 bool record_switch_events;
0042 bool record_switch_events_set;
0043 bool all_kernel;
0044 bool all_user;
0045 bool kernel_callchains;
0046 bool user_callchains;
0047 bool tail_synthesize;
0048 bool overwrite;
0049 bool ignore_missing_thread;
0050 bool strict_freq;
0051 bool sample_id;
0052 bool no_bpf_event;
0053 bool kcore;
0054 bool text_poke;
0055 bool build_id;
0056 unsigned int freq;
0057 unsigned int mmap_pages;
0058 unsigned int auxtrace_mmap_pages;
0059 unsigned int user_freq;
0060 u64 branch_stack;
0061 u64 sample_intr_regs;
0062 u64 sample_user_regs;
0063 u64 default_interval;
0064 u64 user_interval;
0065 size_t auxtrace_snapshot_size;
0066 const char *auxtrace_snapshot_opts;
0067 const char *auxtrace_sample_opts;
0068 bool sample_transaction;
0069 int initial_delay;
0070 bool use_clockid;
0071 clockid_t clockid;
0072 u64 clockid_res_ns;
0073 int nr_cblocks;
0074 int affinity;
0075 int mmap_flush;
0076 unsigned int comp_level;
0077 unsigned int nr_threads_synthesize;
0078 int ctl_fd;
0079 int ctl_fd_ack;
0080 bool ctl_fd_close;
0081 int synth;
0082 int threads_spec;
0083 const char *threads_user_spec;
0084 };
0085
0086 extern const char * const *record_usage;
0087 extern struct option *record_options;
0088
0089 int record__parse_freq(const struct option *opt, const char *str, int unset);
0090
0091 static inline bool record_opts__no_switch_events(const struct record_opts *opts)
0092 {
0093 return opts->record_switch_events_set && !opts->record_switch_events;
0094 }
0095
0096 #endif