perf tools: Remove needless 'extern' from function prototypes

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/n/tip-w246stf7ponfamclsai6b9zo@git.kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 e4763438
...@@ -25,19 +25,17 @@ ...@@ -25,19 +25,17 @@
# endif # endif
#endif #endif
extern int bench_numa(int argc, const char **argv, const char *prefix); int bench_numa(int argc, const char **argv, const char *prefix);
extern int bench_sched_messaging(int argc, const char **argv, const char *prefix); int bench_sched_messaging(int argc, const char **argv, const char *prefix);
extern int bench_sched_pipe(int argc, const char **argv, const char *prefix); int bench_sched_pipe(int argc, const char **argv, const char *prefix);
extern int bench_mem_memcpy(int argc, const char **argv, int bench_mem_memcpy(int argc, const char **argv, const char *prefix);
const char *prefix); int bench_mem_memset(int argc, const char **argv, const char *prefix);
extern int bench_mem_memset(int argc, const char **argv, const char *prefix); int bench_futex_hash(int argc, const char **argv, const char *prefix);
extern int bench_futex_hash(int argc, const char **argv, const char *prefix); int bench_futex_wake(int argc, const char **argv, const char *prefix);
extern int bench_futex_wake(int argc, const char **argv, const char *prefix); int bench_futex_wake_parallel(int argc, const char **argv, const char *prefix);
extern int bench_futex_wake_parallel(int argc, const char **argv, int bench_futex_requeue(int argc, const char **argv, const char *prefix);
const char *prefix);
extern int bench_futex_requeue(int argc, const char **argv, const char *prefix);
/* pi futexes */ /* pi futexes */
extern int bench_futex_lock_pi(int argc, const char **argv, const char *prefix); int bench_futex_lock_pi(int argc, const char **argv, const char *prefix);
#define BENCH_FORMAT_DEFAULT_STR "default" #define BENCH_FORMAT_DEFAULT_STR "default"
#define BENCH_FORMAT_DEFAULT 0 #define BENCH_FORMAT_DEFAULT 0
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#ifdef HAVE_ARCH_X86_64_SUPPORT #ifdef HAVE_ARCH_X86_64_SUPPORT
#define MEMCPY_FN(fn, name, desc) \ #define MEMCPY_FN(fn, name, desc) \
extern void *fn(void *, const void *, size_t); void *fn(void *, const void *, size_t);
#include "mem-memcpy-x86-64-asm-def.h" #include "mem-memcpy-x86-64-asm-def.h"
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
#ifdef HAVE_ARCH_X86_64_SUPPORT #ifdef HAVE_ARCH_X86_64_SUPPORT
#define MEMSET_FN(fn, name, desc) \ #define MEMSET_FN(fn, name, desc) \
extern void *fn(void *, int, size_t); void *fn(void *, int, size_t);
#include "mem-memset-x86-64-asm-def.h" #include "mem-memset-x86-64-asm-def.h"
......
...@@ -7,38 +7,38 @@ ...@@ -7,38 +7,38 @@
extern const char perf_usage_string[]; extern const char perf_usage_string[];
extern const char perf_more_info_string[]; extern const char perf_more_info_string[];
extern void list_common_cmds_help(void); void list_common_cmds_help(void);
extern const char *help_unknown_cmd(const char *cmd); const char *help_unknown_cmd(const char *cmd);
extern void prune_packed_objects(int); void prune_packed_objects(int);
extern int read_line_with_nul(char *buf, int size, FILE *file); int read_line_with_nul(char *buf, int size, FILE *file);
extern int check_pager_config(const char *cmd); int check_pager_config(const char *cmd);
extern int cmd_annotate(int argc, const char **argv, const char *prefix); int cmd_annotate(int argc, const char **argv, const char *prefix);
extern int cmd_bench(int argc, const char **argv, const char *prefix); int cmd_bench(int argc, const char **argv, const char *prefix);
extern int cmd_buildid_cache(int argc, const char **argv, const char *prefix); int cmd_buildid_cache(int argc, const char **argv, const char *prefix);
extern int cmd_buildid_list(int argc, const char **argv, const char *prefix); int cmd_buildid_list(int argc, const char **argv, const char *prefix);
extern int cmd_config(int argc, const char **argv, const char *prefix); int cmd_config(int argc, const char **argv, const char *prefix);
extern int cmd_diff(int argc, const char **argv, const char *prefix); int cmd_diff(int argc, const char **argv, const char *prefix);
extern int cmd_evlist(int argc, const char **argv, const char *prefix); int cmd_evlist(int argc, const char **argv, const char *prefix);
extern int cmd_help(int argc, const char **argv, const char *prefix); int cmd_help(int argc, const char **argv, const char *prefix);
extern int cmd_sched(int argc, const char **argv, const char *prefix); int cmd_sched(int argc, const char **argv, const char *prefix);
extern int cmd_list(int argc, const char **argv, const char *prefix); int cmd_list(int argc, const char **argv, const char *prefix);
extern int cmd_record(int argc, const char **argv, const char *prefix); int cmd_record(int argc, const char **argv, const char *prefix);
extern int cmd_report(int argc, const char **argv, const char *prefix); int cmd_report(int argc, const char **argv, const char *prefix);
extern int cmd_stat(int argc, const char **argv, const char *prefix); int cmd_stat(int argc, const char **argv, const char *prefix);
extern int cmd_timechart(int argc, const char **argv, const char *prefix); int cmd_timechart(int argc, const char **argv, const char *prefix);
extern int cmd_top(int argc, const char **argv, const char *prefix); int cmd_top(int argc, const char **argv, const char *prefix);
extern int cmd_script(int argc, const char **argv, const char *prefix); int cmd_script(int argc, const char **argv, const char *prefix);
extern int cmd_version(int argc, const char **argv, const char *prefix); int cmd_version(int argc, const char **argv, const char *prefix);
extern int cmd_probe(int argc, const char **argv, const char *prefix); int cmd_probe(int argc, const char **argv, const char *prefix);
extern int cmd_kmem(int argc, const char **argv, const char *prefix); int cmd_kmem(int argc, const char **argv, const char *prefix);
extern int cmd_lock(int argc, const char **argv, const char *prefix); int cmd_lock(int argc, const char **argv, const char *prefix);
extern int cmd_kvm(int argc, const char **argv, const char *prefix); int cmd_kvm(int argc, const char **argv, const char *prefix);
extern int cmd_test(int argc, const char **argv, const char *prefix); int cmd_test(int argc, const char **argv, const char *prefix);
extern int cmd_trace(int argc, const char **argv, const char *prefix); int cmd_trace(int argc, const char **argv, const char *prefix);
extern int cmd_inject(int argc, const char **argv, const char *prefix); int cmd_inject(int argc, const char **argv, const char *prefix);
extern int cmd_mem(int argc, const char **argv, const char *prefix); int cmd_mem(int argc, const char **argv, const char *prefix);
extern int cmd_data(int argc, const char **argv, const char *prefix); int cmd_data(int argc, const char **argv, const char *prefix);
extern int find_scripts(char **scripts_array, char **scripts_path_array); int find_scripts(char **scripts_array, char **scripts_path_array);
#endif #endif
...@@ -26,14 +26,14 @@ ...@@ -26,14 +26,14 @@
extern const char *config_exclusive_filename; extern const char *config_exclusive_filename;
typedef int (*config_fn_t)(const char *, const char *, void *); typedef int (*config_fn_t)(const char *, const char *, void *);
extern int perf_default_config(const char *, const char *, void *); int perf_default_config(const char *, const char *, void *);
extern int perf_config(config_fn_t fn, void *); int perf_config(config_fn_t fn, void *);
extern int perf_config_int(const char *, const char *); int perf_config_int(const char *, const char *);
extern u64 perf_config_u64(const char *, const char *); u64 perf_config_u64(const char *, const char *);
extern int perf_config_bool(const char *, const char *); int perf_config_bool(const char *, const char *);
extern int config_error_nonbool(const char *); int config_error_nonbool(const char *);
extern const char *perf_config_dirname(const char *, const char *); const char *perf_config_dirname(const char *, const char *);
extern const char *perf_etc_perfconfig(void); const char *perf_etc_perfconfig(void);
char *alias_lookup(const char *alias); char *alias_lookup(const char *alias);
int split_cmdline(char *cmdline, const char ***argv); int split_cmdline(char *cmdline, const char ***argv);
...@@ -67,10 +67,10 @@ static inline int is_absolute_path(const char *path) ...@@ -67,10 +67,10 @@ static inline int is_absolute_path(const char *path)
const char *make_nonrelative_path(const char *path); const char *make_nonrelative_path(const char *path);
char *strip_path_suffix(const char *path, const char *suffix); char *strip_path_suffix(const char *path, const char *suffix);
extern char *mkpath(const char *fmt, ...) __attribute__((format (printf, 1, 2))); char *mkpath(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
extern char *perf_path(const char *fmt, ...) __attribute__((format (printf, 1, 2))); char *perf_path(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
extern char *perf_pathdup(const char *fmt, ...) char *perf_pathdup(const char *fmt, ...)
__attribute__((format (printf, 1, 2))); __attribute__((format (printf, 1, 2)));
#endif /* __PERF_CACHE_H */ #endif /* __PERF_CACHE_H */
...@@ -220,7 +220,7 @@ int fill_callchain_info(struct addr_location *al, struct callchain_cursor_node * ...@@ -220,7 +220,7 @@ int fill_callchain_info(struct addr_location *al, struct callchain_cursor_node *
bool hide_unresolved); bool hide_unresolved);
extern const char record_callchain_help[]; extern const char record_callchain_help[];
extern int parse_callchain_record(const char *arg, struct callchain_param *param); int parse_callchain_record(const char *arg, struct callchain_param *param);
int parse_callchain_record_opt(const char *arg, struct callchain_param *param); int parse_callchain_record_opt(const char *arg, struct callchain_param *param);
int parse_callchain_report_opt(const char *arg); int parse_callchain_report_opt(const char *arg);
int parse_callchain_top_opt(const char *arg); int parse_callchain_top_opt(const char *arg);
...@@ -236,7 +236,7 @@ static inline void callchain_cursor_snapshot(struct callchain_cursor *dest, ...@@ -236,7 +236,7 @@ static inline void callchain_cursor_snapshot(struct callchain_cursor *dest,
} }
#ifdef HAVE_SKIP_CALLCHAIN_IDX #ifdef HAVE_SKIP_CALLCHAIN_IDX
extern int arch_skip_callchain_idx(struct thread *thread, struct ip_callchain *chain); int arch_skip_callchain_idx(struct thread *thread, struct ip_callchain *chain);
#else #else
static inline int arch_skip_callchain_idx(struct thread *thread __maybe_unused, static inline int arch_skip_callchain_idx(struct thread *thread __maybe_unused,
struct ip_callchain *chain __maybe_unused) struct ip_callchain *chain __maybe_unused)
......
...@@ -13,7 +13,7 @@ struct cgroup_sel { ...@@ -13,7 +13,7 @@ struct cgroup_sel {
extern int nr_cgroups; /* number of explicit cgroups defined */ extern int nr_cgroups; /* number of explicit cgroups defined */
extern void close_cgroup(struct cgroup_sel *cgrp); void close_cgroup(struct cgroup_sel *cgrp);
extern int parse_cgroups(const struct option *opt, const char *str, int unset); int parse_cgroups(const struct option *opt, const char *str, int unset);
#endif /* __CGROUP_H__ */ #endif /* __CGROUP_H__ */
...@@ -5,7 +5,7 @@ unsigned long perf_event_open_cloexec_flag(void); ...@@ -5,7 +5,7 @@ unsigned long perf_event_open_cloexec_flag(void);
#ifdef __GLIBC_PREREQ #ifdef __GLIBC_PREREQ
#if !__GLIBC_PREREQ(2, 6) && !defined(__UCLIBC__) #if !__GLIBC_PREREQ(2, 6) && !defined(__UCLIBC__)
extern int sched_getcpu(void) __THROW; int sched_getcpu(void) __THROW;
#endif #endif
#endif #endif
......
...@@ -25,48 +25,48 @@ ...@@ -25,48 +25,48 @@
#include <elfutils/version.h> #include <elfutils/version.h>
/* Find the realpath of the target file */ /* Find the realpath of the target file */
extern const char *cu_find_realpath(Dwarf_Die *cu_die, const char *fname); const char *cu_find_realpath(Dwarf_Die *cu_die, const char *fname);
/* Get DW_AT_comp_dir (should be NULL with older gcc) */ /* Get DW_AT_comp_dir (should be NULL with older gcc) */
extern const char *cu_get_comp_dir(Dwarf_Die *cu_die); const char *cu_get_comp_dir(Dwarf_Die *cu_die);
/* Get a line number and file name for given address */ /* Get a line number and file name for given address */
extern int cu_find_lineinfo(Dwarf_Die *cudie, unsigned long addr, int cu_find_lineinfo(Dwarf_Die *cudie, unsigned long addr,
const char **fname, int *lineno); const char **fname, int *lineno);
/* Walk on funcitons at given address */ /* Walk on funcitons at given address */
extern int cu_walk_functions_at(Dwarf_Die *cu_die, Dwarf_Addr addr, int cu_walk_functions_at(Dwarf_Die *cu_die, Dwarf_Addr addr,
int (*callback)(Dwarf_Die *, void *), void *data); int (*callback)(Dwarf_Die *, void *), void *data);
/* Ensure that this DIE is a subprogram and definition (not declaration) */ /* Ensure that this DIE is a subprogram and definition (not declaration) */
extern bool die_is_func_def(Dwarf_Die *dw_die); bool die_is_func_def(Dwarf_Die *dw_die);
/* Ensure that this DIE is an instance of a subprogram */ /* Ensure that this DIE is an instance of a subprogram */
extern bool die_is_func_instance(Dwarf_Die *dw_die); bool die_is_func_instance(Dwarf_Die *dw_die);
/* Compare diename and tname */ /* Compare diename and tname */
extern bool die_compare_name(Dwarf_Die *dw_die, const char *tname); bool die_compare_name(Dwarf_Die *dw_die, const char *tname);
/* Matching diename with glob pattern */ /* Matching diename with glob pattern */
extern bool die_match_name(Dwarf_Die *dw_die, const char *glob); bool die_match_name(Dwarf_Die *dw_die, const char *glob);
/* Get callsite line number of inline-function instance */ /* Get callsite line number of inline-function instance */
extern int die_get_call_lineno(Dwarf_Die *in_die); int die_get_call_lineno(Dwarf_Die *in_die);
/* Get callsite file name of inlined function instance */ /* Get callsite file name of inlined function instance */
extern const char *die_get_call_file(Dwarf_Die *in_die); const char *die_get_call_file(Dwarf_Die *in_die);
/* Get type die */ /* Get type die */
extern Dwarf_Die *die_get_type(Dwarf_Die *vr_die, Dwarf_Die *die_mem); Dwarf_Die *die_get_type(Dwarf_Die *vr_die, Dwarf_Die *die_mem);
/* Get a type die, but skip qualifiers and typedef */ /* Get a type die, but skip qualifiers and typedef */
extern Dwarf_Die *die_get_real_type(Dwarf_Die *vr_die, Dwarf_Die *die_mem); Dwarf_Die *die_get_real_type(Dwarf_Die *vr_die, Dwarf_Die *die_mem);
/* Check whether the DIE is signed or not */ /* Check whether the DIE is signed or not */
extern bool die_is_signed_type(Dwarf_Die *tp_die); bool die_is_signed_type(Dwarf_Die *tp_die);
/* Get data_member_location offset */ /* Get data_member_location offset */
extern int die_get_data_member_location(Dwarf_Die *mb_die, Dwarf_Word *offs); int die_get_data_member_location(Dwarf_Die *mb_die, Dwarf_Word *offs);
/* Return values for die_find_child() callbacks */ /* Return values for die_find_child() callbacks */
enum { enum {
...@@ -77,29 +77,29 @@ enum { ...@@ -77,29 +77,29 @@ enum {
}; };
/* Search child DIEs */ /* Search child DIEs */
extern Dwarf_Die *die_find_child(Dwarf_Die *rt_die, Dwarf_Die *die_find_child(Dwarf_Die *rt_die,
int (*callback)(Dwarf_Die *, void *), int (*callback)(Dwarf_Die *, void *),
void *data, Dwarf_Die *die_mem); void *data, Dwarf_Die *die_mem);
/* Search a non-inlined function including given address */ /* Search a non-inlined function including given address */
extern Dwarf_Die *die_find_realfunc(Dwarf_Die *cu_die, Dwarf_Addr addr, Dwarf_Die *die_find_realfunc(Dwarf_Die *cu_die, Dwarf_Addr addr,
Dwarf_Die *die_mem); Dwarf_Die *die_mem);
/* Search a non-inlined function with tail call at given address */ /* Search a non-inlined function with tail call at given address */
Dwarf_Die *die_find_tailfunc(Dwarf_Die *cu_die, Dwarf_Addr addr, Dwarf_Die *die_find_tailfunc(Dwarf_Die *cu_die, Dwarf_Addr addr,
Dwarf_Die *die_mem); Dwarf_Die *die_mem);
/* Search the top inlined function including given address */ /* Search the top inlined function including given address */
extern Dwarf_Die *die_find_top_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr, Dwarf_Die *die_find_top_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr,
Dwarf_Die *die_mem); Dwarf_Die *die_mem);
/* Search the deepest inlined function including given address */ /* Search the deepest inlined function including given address */
extern Dwarf_Die *die_find_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr, Dwarf_Die *die_find_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr,
Dwarf_Die *die_mem); Dwarf_Die *die_mem);
/* Walk on the instances of given DIE */ /* Walk on the instances of given DIE */
extern int die_walk_instances(Dwarf_Die *in_die, int die_walk_instances(Dwarf_Die *in_die,
int (*callback)(Dwarf_Die *, void *), void *data); int (*callback)(Dwarf_Die *, void *), void *data);
/* Walker on lines (Note: line number will not be sorted) */ /* Walker on lines (Note: line number will not be sorted) */
typedef int (* line_walk_callback_t) (const char *fname, int lineno, typedef int (* line_walk_callback_t) (const char *fname, int lineno,
...@@ -109,22 +109,20 @@ typedef int (* line_walk_callback_t) (const char *fname, int lineno, ...@@ -109,22 +109,20 @@ typedef int (* line_walk_callback_t) (const char *fname, int lineno,
* Walk on lines inside given DIE. If the DIE is a subprogram, walk only on * Walk on lines inside given DIE. If the DIE is a subprogram, walk only on
* the lines inside the subprogram, otherwise the DIE must be a CU DIE. * the lines inside the subprogram, otherwise the DIE must be a CU DIE.
*/ */
extern int die_walk_lines(Dwarf_Die *rt_die, line_walk_callback_t callback, int die_walk_lines(Dwarf_Die *rt_die, line_walk_callback_t callback, void *data);
void *data);
/* Find a variable called 'name' at given address */ /* Find a variable called 'name' at given address */
extern Dwarf_Die *die_find_variable_at(Dwarf_Die *sp_die, const char *name, Dwarf_Die *die_find_variable_at(Dwarf_Die *sp_die, const char *name,
Dwarf_Addr addr, Dwarf_Die *die_mem); Dwarf_Addr addr, Dwarf_Die *die_mem);
/* Find a member called 'name' */ /* Find a member called 'name' */
extern Dwarf_Die *die_find_member(Dwarf_Die *st_die, const char *name, Dwarf_Die *die_find_member(Dwarf_Die *st_die, const char *name,
Dwarf_Die *die_mem); Dwarf_Die *die_mem);
/* Get the name of given variable DIE */ /* Get the name of given variable DIE */
extern int die_get_typename(Dwarf_Die *vr_die, struct strbuf *buf); int die_get_typename(Dwarf_Die *vr_die, struct strbuf *buf);
/* Get the name and type of given variable DIE, stored as "type\tname" */ /* Get the name and type of given variable DIE, stored as "type\tname" */
extern int die_get_varname(Dwarf_Die *vr_die, struct strbuf *buf); int die_get_varname(Dwarf_Die *vr_die, struct strbuf *buf);
extern int die_get_var_range(Dwarf_Die *sp_die, Dwarf_Die *vr_die, int die_get_var_range(Dwarf_Die *sp_die, Dwarf_Die *vr_die, struct strbuf *buf);
struct strbuf *buf);
#endif #endif
...@@ -2,12 +2,10 @@ ...@@ -2,12 +2,10 @@
#define __GENELF_H__ #define __GENELF_H__
/* genelf.c */ /* genelf.c */
extern int jit_write_elf(int fd, uint64_t code_addr, const char *sym, int jit_write_elf(int fd, uint64_t code_addr, const char *sym,
const void *code, int csize, const void *code, int csize, void *debug, int nr_debug_entries);
void *debug, int nr_debug_entries);
/* genelf_debug.c */ /* genelf_debug.c */
extern int jit_add_debug_info(Elf *e, uint64_t code_addr, int jit_add_debug_info(Elf *e, uint64_t code_addr, void *debug, int nr_debug_entries);
void *debug, int nr_debug_entries);
#if defined(__arm__) #if defined(__arm__)
#define GEN_ELF_ARCH EM_ARM #define GEN_ELF_ARCH EM_ARM
......
...@@ -3,13 +3,9 @@ ...@@ -3,13 +3,9 @@
#include <data.h> #include <data.h>
extern int jit_process(struct perf_session *session, int jit_process(struct perf_session *session, struct perf_data_file *output,
struct perf_data_file *output, struct machine *machine, char *filename, pid_t pid, u64 *nbytes);
struct machine *machine,
char *filename, int jit_inject_record(const char *filename);
pid_t pid,
u64 *nbytes);
extern int jit_inject_record(const char *filename);
#endif /* __JIT_H__ */ #endif /* __JIT_H__ */
...@@ -39,11 +39,10 @@ struct llvm_param { ...@@ -39,11 +39,10 @@ struct llvm_param {
}; };
extern struct llvm_param llvm_param; extern struct llvm_param llvm_param;
extern int perf_llvm_config(const char *var, const char *value); int perf_llvm_config(const char *var, const char *value);
extern int llvm__compile_bpf(const char *path, void **p_obj_buf, int llvm__compile_bpf(const char *path, void **p_obj_buf, size_t *p_obj_buf_sz);
size_t *p_obj_buf_sz);
/* This function is for test__llvm() use only */ /* This function is for test__llvm() use only */
extern int llvm__search_clang(void); int llvm__search_clang(void);
#endif #endif
...@@ -22,19 +22,18 @@ struct tracepoint_path { ...@@ -22,19 +22,18 @@ struct tracepoint_path {
struct tracepoint_path *next; struct tracepoint_path *next;
}; };
extern struct tracepoint_path *tracepoint_id_to_path(u64 config); struct tracepoint_path *tracepoint_id_to_path(u64 config);
extern struct tracepoint_path *tracepoint_name_to_path(const char *name); struct tracepoint_path *tracepoint_name_to_path(const char *name);
extern bool have_tracepoints(struct list_head *evlist); bool have_tracepoints(struct list_head *evlist);
const char *event_type(int type); const char *event_type(int type);
extern int parse_events_option(const struct option *opt, const char *str, int parse_events_option(const struct option *opt, const char *str, int unset);
int unset); int parse_events(struct perf_evlist *evlist, const char *str,
extern int parse_events(struct perf_evlist *evlist, const char *str, struct parse_events_error *error);
struct parse_events_error *error); int parse_events_terms(struct list_head *terms, const char *str);
extern int parse_events_terms(struct list_head *terms, const char *str); int parse_filter(const struct option *opt, const char *str, int unset);
extern int parse_filter(const struct option *opt, const char *str, int unset); int exclude_perf(const struct option *opt, const char *arg, int unset);
extern int exclude_perf(const struct option *opt, const char *arg, int unset);
#define EVENTS_HELP_MAX (128*1024) #define EVENTS_HELP_MAX (128*1024)
...@@ -183,7 +182,7 @@ void print_symbol_events(const char *event_glob, unsigned type, ...@@ -183,7 +182,7 @@ void print_symbol_events(const char *event_glob, unsigned type,
void print_tracepoint_events(const char *subsys_glob, const char *event_glob, void print_tracepoint_events(const char *subsys_glob, const char *event_glob,
bool name_only); bool name_only);
int print_hwcache_events(const char *event_glob, bool name_only); int print_hwcache_events(const char *event_glob, bool name_only);
extern int is_valid_tracepoint(const char *event_string); int is_valid_tracepoint(const char *event_string);
int valid_event_mount(const char *eventfs); int valid_event_mount(const char *eventfs);
char *parse_events_formats_error_string(char *additional_terms); char *parse_events_formats_error_string(char *additional_terms);
......
...@@ -114,49 +114,44 @@ int init_probe_symbol_maps(bool user_only); ...@@ -114,49 +114,44 @@ int init_probe_symbol_maps(bool user_only);
void exit_probe_symbol_maps(void); void exit_probe_symbol_maps(void);
/* Command string to events */ /* Command string to events */
extern int parse_perf_probe_command(const char *cmd, int parse_perf_probe_command(const char *cmd, struct perf_probe_event *pev);
struct perf_probe_event *pev); int parse_probe_trace_command(const char *cmd, struct probe_trace_event *tev);
extern int parse_probe_trace_command(const char *cmd,
struct probe_trace_event *tev);
/* Events to command string */ /* Events to command string */
extern char *synthesize_perf_probe_command(struct perf_probe_event *pev); char *synthesize_perf_probe_command(struct perf_probe_event *pev);
extern char *synthesize_probe_trace_command(struct probe_trace_event *tev); char *synthesize_probe_trace_command(struct probe_trace_event *tev);
extern int synthesize_perf_probe_arg(struct perf_probe_arg *pa, char *buf, int synthesize_perf_probe_arg(struct perf_probe_arg *pa, char *buf, size_t len);
size_t len);
/* Check the perf_probe_event needs debuginfo */ /* Check the perf_probe_event needs debuginfo */
extern bool perf_probe_event_need_dwarf(struct perf_probe_event *pev); bool perf_probe_event_need_dwarf(struct perf_probe_event *pev);
/* Release event contents */ /* Release event contents */
extern void clear_perf_probe_event(struct perf_probe_event *pev); void clear_perf_probe_event(struct perf_probe_event *pev);
extern void clear_probe_trace_event(struct probe_trace_event *tev); void clear_probe_trace_event(struct probe_trace_event *tev);
/* Command string to line-range */ /* Command string to line-range */
extern int parse_line_range_desc(const char *cmd, struct line_range *lr); int parse_line_range_desc(const char *cmd, struct line_range *lr);
/* Release line range members */ /* Release line range members */
extern void line_range__clear(struct line_range *lr); void line_range__clear(struct line_range *lr);
/* Initialize line range */ /* Initialize line range */
extern int line_range__init(struct line_range *lr); int line_range__init(struct line_range *lr);
extern int add_perf_probe_events(struct perf_probe_event *pevs, int npevs); int add_perf_probe_events(struct perf_probe_event *pevs, int npevs);
extern int convert_perf_probe_events(struct perf_probe_event *pevs, int npevs); int convert_perf_probe_events(struct perf_probe_event *pevs, int npevs);
extern int apply_perf_probe_events(struct perf_probe_event *pevs, int npevs); int apply_perf_probe_events(struct perf_probe_event *pevs, int npevs);
extern void cleanup_perf_probe_events(struct perf_probe_event *pevs, int npevs); void cleanup_perf_probe_events(struct perf_probe_event *pevs, int npevs);
extern int del_perf_probe_events(struct strfilter *filter); int del_perf_probe_events(struct strfilter *filter);
extern int show_perf_probe_event(const char *group, const char *event, int show_perf_probe_event(const char *group, const char *event,
struct perf_probe_event *pev, struct perf_probe_event *pev,
const char *module, bool use_stdout); const char *module, bool use_stdout);
extern int show_perf_probe_events(struct strfilter *filter); int show_perf_probe_events(struct strfilter *filter);
extern int show_line_range(struct line_range *lr, const char *module, int show_line_range(struct line_range *lr, const char *module, bool user);
bool user); int show_available_vars(struct perf_probe_event *pevs, int npevs,
extern int show_available_vars(struct perf_probe_event *pevs, int npevs, struct strfilter *filter);
struct strfilter *filter); int show_available_funcs(const char *module, struct strfilter *filter, bool user);
extern int show_available_funcs(const char *module, struct strfilter *filter,
bool user);
bool arch__prefers_symtab(void); bool arch__prefers_symtab(void);
void arch__fix_tev_from_maps(struct perf_probe_event *pev, void arch__fix_tev_from_maps(struct perf_probe_event *pev,
struct probe_trace_event *tev, struct map *map); struct probe_trace_event *tev, struct map *map);
......
...@@ -34,27 +34,25 @@ struct debuginfo { ...@@ -34,27 +34,25 @@ struct debuginfo {
}; };
/* This also tries to open distro debuginfo */ /* This also tries to open distro debuginfo */
extern struct debuginfo *debuginfo__new(const char *path); struct debuginfo *debuginfo__new(const char *path);
extern void debuginfo__delete(struct debuginfo *dbg); void debuginfo__delete(struct debuginfo *dbg);
/* Find probe_trace_events specified by perf_probe_event from debuginfo */ /* Find probe_trace_events specified by perf_probe_event from debuginfo */
extern int debuginfo__find_trace_events(struct debuginfo *dbg, int debuginfo__find_trace_events(struct debuginfo *dbg,
struct perf_probe_event *pev, struct perf_probe_event *pev,
struct probe_trace_event **tevs); struct probe_trace_event **tevs);
/* Find a perf_probe_point from debuginfo */ /* Find a perf_probe_point from debuginfo */
extern int debuginfo__find_probe_point(struct debuginfo *dbg, int debuginfo__find_probe_point(struct debuginfo *dbg, unsigned long addr,
unsigned long addr, struct perf_probe_point *ppt);
struct perf_probe_point *ppt);
/* Find a line range */ /* Find a line range */
extern int debuginfo__find_line_range(struct debuginfo *dbg, int debuginfo__find_line_range(struct debuginfo *dbg, struct line_range *lr);
struct line_range *lr);
/* Find available variables */ /* Find available variables */
extern int debuginfo__find_available_vars_at(struct debuginfo *dbg, int debuginfo__find_available_vars_at(struct debuginfo *dbg,
struct perf_probe_event *pev, struct perf_probe_event *pev,
struct variable_list **vls); struct variable_list **vls);
/* Find a src file from a DWARF tag path */ /* Find a src file from a DWARF tag path */
int get_real_path(const char *raw_path, const char *comp_dir, int get_real_path(const char *raw_path, const char *comp_dir,
......
...@@ -24,6 +24,6 @@ ...@@ -24,6 +24,6 @@
* sq_quote() in a real application. * sq_quote() in a real application.
*/ */
extern void sq_quote_argv(struct strbuf *, const char **argv, size_t maxlen); void sq_quote_argv(struct strbuf *, const char **argv, size_t maxlen);
#endif /* __PERF_QUOTE_H */ #endif /* __PERF_QUOTE_H */
...@@ -51,16 +51,16 @@ struct strbuf { ...@@ -51,16 +51,16 @@ struct strbuf {
#define STRBUF_INIT { 0, 0, strbuf_slopbuf } #define STRBUF_INIT { 0, 0, strbuf_slopbuf }
/*----- strbuf life cycle -----*/ /*----- strbuf life cycle -----*/
extern void strbuf_init(struct strbuf *buf, ssize_t hint); void strbuf_init(struct strbuf *buf, ssize_t hint);
extern void strbuf_release(struct strbuf *); void strbuf_release(struct strbuf *buf);
extern char *strbuf_detach(struct strbuf *, size_t *); char *strbuf_detach(struct strbuf *buf, size_t *);
/*----- strbuf size related -----*/ /*----- strbuf size related -----*/
static inline ssize_t strbuf_avail(const struct strbuf *sb) { static inline ssize_t strbuf_avail(const struct strbuf *sb) {
return sb->alloc ? sb->alloc - sb->len - 1 : 0; return sb->alloc ? sb->alloc - sb->len - 1 : 0;
} }
extern void strbuf_grow(struct strbuf *, size_t); void strbuf_grow(struct strbuf *buf, size_t);
static inline void strbuf_setlen(struct strbuf *sb, size_t len) { static inline void strbuf_setlen(struct strbuf *sb, size_t len) {
if (!sb->alloc) if (!sb->alloc)
...@@ -77,16 +77,16 @@ static inline void strbuf_addch(struct strbuf *sb, int c) { ...@@ -77,16 +77,16 @@ static inline void strbuf_addch(struct strbuf *sb, int c) {
sb->buf[sb->len] = '\0'; sb->buf[sb->len] = '\0';
} }
extern void strbuf_add(struct strbuf *, const void *, size_t); void strbuf_add(struct strbuf *buf, const void *, size_t);
static inline void strbuf_addstr(struct strbuf *sb, const char *s) { static inline void strbuf_addstr(struct strbuf *sb, const char *s) {
strbuf_add(sb, s, strlen(s)); strbuf_add(sb, s, strlen(s));
} }
__attribute__((format(printf,2,3))) __attribute__((format(printf,2,3)))
extern void strbuf_addf(struct strbuf *sb, const char *fmt, ...); void strbuf_addf(struct strbuf *sb, const char *fmt, ...);
extern void strbuf_addv(struct strbuf *sb, const char *fmt, va_list ap); void strbuf_addv(struct strbuf *sb, const char *fmt, va_list ap);
/* XXX: if read fails, any partial read is undone */ /* XXX: if read fails, any partial read is undone */
extern ssize_t strbuf_read(struct strbuf *, int fd, ssize_t hint); ssize_t strbuf_read(struct strbuf *, int fd, ssize_t hint);
#endif /* __PERF_STRBUF_H */ #endif /* __PERF_STRBUF_H */
...@@ -3,32 +3,31 @@ ...@@ -3,32 +3,31 @@
#include <linux/types.h> #include <linux/types.h>
extern void open_svg(const char *filename, int cpus, int rows, u64 start, u64 end); void open_svg(const char *filename, int cpus, int rows, u64 start, u64 end);
extern void svg_ubox(int Yslot, u64 start, u64 end, double height, const char *type, int fd, int err, int merges); void svg_ubox(int Yslot, u64 start, u64 end, double height, const char *type, int fd, int err, int merges);
extern void svg_lbox(int Yslot, u64 start, u64 end, double height, const char *type, int fd, int err, int merges); void svg_lbox(int Yslot, u64 start, u64 end, double height, const char *type, int fd, int err, int merges);
extern void svg_fbox(int Yslot, u64 start, u64 end, double height, const char *type, int fd, int err, int merges); void svg_fbox(int Yslot, u64 start, u64 end, double height, const char *type, int fd, int err, int merges);
extern void svg_box(int Yslot, u64 start, u64 end, const char *type); void svg_box(int Yslot, u64 start, u64 end, const char *type);
extern void svg_blocked(int Yslot, int cpu, u64 start, u64 end, const char *backtrace); void svg_blocked(int Yslot, int cpu, u64 start, u64 end, const char *backtrace);
extern void svg_running(int Yslot, int cpu, u64 start, u64 end, const char *backtrace); void svg_running(int Yslot, int cpu, u64 start, u64 end, const char *backtrace);
extern void svg_waiting(int Yslot, int cpu, u64 start, u64 end, const char *backtrace); void svg_waiting(int Yslot, int cpu, u64 start, u64 end, const char *backtrace);
extern void svg_cpu_box(int cpu, u64 max_frequency, u64 turbo_frequency); void svg_cpu_box(int cpu, u64 max_frequency, u64 turbo_frequency);
extern void svg_process(int cpu, u64 start, u64 end, int pid, const char *name, const char *backtrace); void svg_process(int cpu, u64 start, u64 end, int pid, const char *name, const char *backtrace);
extern void svg_cstate(int cpu, u64 start, u64 end, int type); void svg_cstate(int cpu, u64 start, u64 end, int type);
extern void svg_pstate(int cpu, u64 start, u64 end, u64 freq); void svg_pstate(int cpu, u64 start, u64 end, u64 freq);
extern void svg_time_grid(double min_thickness); void svg_time_grid(double min_thickness);
extern void svg_io_legenda(void); void svg_io_legenda(void);
extern void svg_legenda(void); void svg_legenda(void);
extern void svg_wakeline(u64 start, int row1, int row2, const char *backtrace); void svg_wakeline(u64 start, int row1, int row2, const char *backtrace);
extern void svg_partial_wakeline(u64 start, int row1, char *desc1, int row2, char *desc2, const char *backtrace); void svg_partial_wakeline(u64 start, int row1, char *desc1, int row2, char *desc2, const char *backtrace);
extern void svg_interrupt(u64 start, int row, const char *backtrace); void svg_interrupt(u64 start, int row, const char *backtrace);
extern void svg_text(int Yslot, u64 start, const char *text); void svg_text(int Yslot, u64 start, const char *text);
extern void svg_close(void); void svg_close(void);
extern int svg_build_topology_map(char *sib_core, int sib_core_nr, int svg_build_topology_map(char *sib_core, int sib_core_nr, char *sib_thr, int sib_thr_nr);
char *sib_thr, int sib_thr_nr);
extern int svg_page_width; extern int svg_page_width;
extern u64 svg_highlight; extern u64 svg_highlight;
......
...@@ -34,8 +34,8 @@ ...@@ -34,8 +34,8 @@
#endif #endif
#ifdef HAVE_LIBELF_SUPPORT #ifdef HAVE_LIBELF_SUPPORT
extern Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep, Elf_Scn *elf_section_by_name(Elf *elf, GElf_Ehdr *ep,
GElf_Shdr *shp, const char *name, size_t *idx); GElf_Shdr *shp, const char *name, size_t *idx);
#endif #endif
#ifndef DMGL_PARAMS #ifndef DMGL_PARAMS
......
...@@ -133,17 +133,17 @@ extern char buildid_dir[]; ...@@ -133,17 +133,17 @@ extern char buildid_dir[];
#define PERF_GTK_DSO "libperf-gtk.so" #define PERF_GTK_DSO "libperf-gtk.so"
/* General helper functions */ /* General helper functions */
extern void usage(const char *err) NORETURN; void usage(const char *err) NORETURN;
extern void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2))); void die(const char *err, ...) NORETURN __attribute__((format (printf, 1, 2)));
extern int error(const char *err, ...) __attribute__((format (printf, 1, 2))); int error(const char *err, ...) __attribute__((format (printf, 1, 2)));
extern void warning(const char *err, ...) __attribute__((format (printf, 1, 2))); void warning(const char *err, ...) __attribute__((format (printf, 1, 2)));
#include "../../../include/linux/stringify.h" #include "../../../include/linux/stringify.h"
extern void set_warning_routine(void (*routine)(const char *err, va_list params)); void set_warning_routine(void (*routine)(const char *err, va_list params));
extern int prefixcmp(const char *str, const char *prefix); int prefixcmp(const char *str, const char *prefix);
extern void set_buildid_dir(const char *dir); void set_buildid_dir(const char *dir);
#ifdef __GLIBC_PREREQ #ifdef __GLIBC_PREREQ
#if __GLIBC_PREREQ(2, 1) #if __GLIBC_PREREQ(2, 1)
...@@ -164,8 +164,8 @@ static inline char *gitstrchrnul(const char *s, int c) ...@@ -164,8 +164,8 @@ static inline char *gitstrchrnul(const char *s, int c)
/* /*
* Wrappers: * Wrappers:
*/ */
extern char *xstrdup(const char *str); char *xstrdup(const char *str);
extern void *xrealloc(void *ptr, size_t size) __attribute__((weak)); void *xrealloc(void *ptr, size_t size) __attribute__((weak));
static inline void *zalloc(size_t size) static inline void *zalloc(size_t size)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册