diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-08-22 15:40:29 -0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2019-08-26 11:58:22 -0300 |
commit | aeb00b1aeab6dadd72c24f93bea51a46e109c2ba (patch) | |
tree | 892b5327ab415f62b61dcd39d6400eb66ef47e6d /tools/perf/util | |
parent | 38b7b678fe989f9c403c001d96887939aaa1b68a (diff) |
perf record: Move record_opts and other record decls out of perf.h
And into a separate util/record.h, to better isolate things and make
sure that those who use record_opts and the other moved declarations
are explicitly including the necessary header.
Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lkml.kernel.org/n/tip-31q8mei1qkh74qvkl9nwidfq@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util')
-rw-r--r-- | tools/perf/util/auxtrace.c | 2 | ||||
-rw-r--r-- | tools/perf/util/bpf-event.c | 1 | ||||
-rw-r--r-- | tools/perf/util/evsel.c | 1 | ||||
-rw-r--r-- | tools/perf/util/kvm-stat.h | 2 | ||||
-rw-r--r-- | tools/perf/util/machine.c | 1 | ||||
-rw-r--r-- | tools/perf/util/machine.h | 1 | ||||
-rw-r--r-- | tools/perf/util/record.c | 1 | ||||
-rw-r--r-- | tools/perf/util/record.h | 74 | ||||
-rw-r--r-- | tools/perf/util/stat.c | 1 | ||||
-rw-r--r-- | tools/perf/util/stat.h | 2 | ||||
-rw-r--r-- | tools/perf/util/top.h | 1 |
11 files changed, 85 insertions, 2 deletions
diff --git a/tools/perf/util/auxtrace.c b/tools/perf/util/auxtrace.c index 094e6ceb3cf2..12e9b7acbb2c 100644 --- a/tools/perf/util/auxtrace.c +++ b/tools/perf/util/auxtrace.c @@ -26,7 +26,6 @@ #include <linux/list.h> #include <linux/zalloc.h> -#include "../perf.h" #include "evlist.h" #include "dso.h" #include "map.h" @@ -41,6 +40,7 @@ #include <linux/hash.h> #include "event.h" +#include "record.h" #include "session.h" #include "debug.h" #include <subcmd/parse-options.h> diff --git a/tools/perf/util/bpf-event.c b/tools/perf/util/bpf-event.c index 5a5dcc6d8f85..5c634bcfea7e 100644 --- a/tools/perf/util/bpf-event.c +++ b/tools/perf/util/bpf-event.c @@ -14,6 +14,7 @@ #include "session.h" #include "map.h" #include "evlist.h" +#include "record.h" #define ptr_to_u64(ptr) ((__u64)(unsigned long)(ptr)) diff --git a/tools/perf/util/evsel.c b/tools/perf/util/evsel.c index e983e721beca..9fadd5857ccc 100644 --- a/tools/perf/util/evsel.c +++ b/tools/perf/util/evsel.c @@ -34,6 +34,7 @@ #include "thread_map.h" #include "target.h" #include "perf_regs.h" +#include "record.h" #include "debug.h" #include "trace-event.h" #include "stat.h" diff --git a/tools/perf/util/kvm-stat.h b/tools/perf/util/kvm-stat.h index a09c495f866b..46913637085b 100644 --- a/tools/perf/util/kvm-stat.h +++ b/tools/perf/util/kvm-stat.h @@ -2,9 +2,9 @@ #ifndef __PERF_KVM_STAT_H #define __PERF_KVM_STAT_H -#include "../perf.h" #include "tool.h" #include "stat.h" +#include "record.h" struct evsel; struct evlist; diff --git a/tools/perf/util/machine.c b/tools/perf/util/machine.c index 5734460fc89e..f7c1a7e6c4ba 100644 --- a/tools/perf/util/machine.c +++ b/tools/perf/util/machine.c @@ -13,6 +13,7 @@ #include "symbol.h" #include "sort.h" #include "strlist.h" +#include "target.h" #include "thread.h" #include "vdso.h" #include <stdbool.h> diff --git a/tools/perf/util/machine.h b/tools/perf/util/machine.h index 8b9d7157276d..7d69119d0b5d 100644 --- a/tools/perf/util/machine.h +++ b/tools/perf/util/machine.h @@ -14,6 +14,7 @@ struct branch_stack; struct evsel; struct perf_sample; struct symbol; +struct target; struct thread; union perf_event; diff --git a/tools/perf/util/record.c b/tools/perf/util/record.c index 51bbd0714e6d..574507d46c98 100644 --- a/tools/perf/util/record.c +++ b/tools/perf/util/record.c @@ -9,6 +9,7 @@ #include <perf/cpumap.h> #include "util.h" #include "cloexec.h" +#include "record.h" typedef void (*setup_probe_fn_t)(struct evsel *evsel); diff --git a/tools/perf/util/record.h b/tools/perf/util/record.h new file mode 100644 index 000000000000..00275afc524d --- /dev/null +++ b/tools/perf/util/record.h @@ -0,0 +1,74 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef _PERF_RECORD_H +#define _PERF_RECORD_H + +#include <time.h> +#include <stdbool.h> +#include <linux/types.h> +#include <linux/stddef.h> +#include <linux/perf_event.h> +#include "util/target.h" + +struct option; + +struct record_opts { + struct target target; + bool group; + bool inherit_stat; + bool no_buffering; + bool no_inherit; + bool no_inherit_set; + bool no_samples; + bool raw_samples; + bool sample_address; + bool sample_phys_addr; + bool sample_weight; + bool sample_time; + bool sample_time_set; + bool sample_cpu; + bool period; + bool period_set; + bool running_time; + bool full_auxtrace; + bool auxtrace_snapshot_mode; + bool auxtrace_snapshot_on_exit; + bool record_namespaces; + bool record_switch_events; + bool all_kernel; + bool all_user; + bool kernel_callchains; + bool user_callchains; + bool tail_synthesize; + bool overwrite; + bool ignore_missing_thread; + bool strict_freq; + bool sample_id; + bool no_bpf_event; + unsigned int freq; + unsigned int mmap_pages; + unsigned int auxtrace_mmap_pages; + unsigned int user_freq; + u64 branch_stack; + u64 sample_intr_regs; + u64 sample_user_regs; + u64 default_interval; + u64 user_interval; + size_t auxtrace_snapshot_size; + const char *auxtrace_snapshot_opts; + bool sample_transaction; + unsigned initial_delay; + bool use_clockid; + clockid_t clockid; + u64 clockid_res_ns; + int nr_cblocks; + int affinity; + int mmap_flush; + unsigned int comp_level; +}; + +extern const char * const *record_usage; +extern struct option *record_options; + +int record__parse_freq(const struct option *opt, const char *str, int unset); + +#endif // _PERF_RECORD_H diff --git a/tools/perf/util/stat.c b/tools/perf/util/stat.c index 0cbfd1eca1dd..f985336b3a22 100644 --- a/tools/perf/util/stat.c +++ b/tools/perf/util/stat.c @@ -4,6 +4,7 @@ #include <math.h> #include "counts.h" #include "stat.h" +#include "target.h" #include "evlist.h" #include "evsel.h" #include "thread_map.h" diff --git a/tools/perf/util/stat.h b/tools/perf/util/stat.h index 9e425ecd82d9..14fe3e548229 100644 --- a/tools/perf/util/stat.h +++ b/tools/perf/util/stat.h @@ -198,6 +198,8 @@ int perf_stat_process_counter(struct perf_stat_config *config, struct perf_tool; union perf_event; struct perf_session; +struct target; + int perf_event__process_stat_event(struct perf_session *session, union perf_event *event); diff --git a/tools/perf/util/top.h b/tools/perf/util/top.h index dc4bb6e52a83..7367433e767a 100644 --- a/tools/perf/util/top.h +++ b/tools/perf/util/top.h @@ -5,6 +5,7 @@ #include "tool.h" #include "evswitch.h" #include "annotate.h" +#include "record.h" #include <linux/types.h> #include <stddef.h> #include <stdbool.h> |