Skip to content

Commit

Permalink
perf tools: Remove needless 'extern' from function prototypes
Browse files Browse the repository at this point in the history
Cc: Adrian Hunter <[email protected]>
Cc: Jiri Olsa <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Wang Nan <[email protected]>
Link: http://lkml.kernel.org/n/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
acmel committed Mar 23, 2016
1 parent e476343 commit 3938bad
Show file tree
Hide file tree
Showing 20 changed files with 197 additions and 217 deletions.
22 changes: 10 additions & 12 deletions tools/perf/bench/bench.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,17 @@
# endif
#endif

extern int bench_numa(int argc, const char **argv, const char *prefix);
extern 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);
extern int bench_mem_memcpy(int argc, const char **argv,
const char *prefix);
extern int bench_mem_memset(int argc, const char **argv, const char *prefix);
extern int bench_futex_hash(int argc, const char **argv, const char *prefix);
extern int bench_futex_wake(int argc, const char **argv, const char *prefix);
extern int bench_futex_wake_parallel(int argc, const char **argv,
const char *prefix);
extern int bench_futex_requeue(int argc, const char **argv, const char *prefix);
int bench_numa(int argc, const char **argv, const char *prefix);
int bench_sched_messaging(int argc, const char **argv, const char *prefix);
int bench_sched_pipe(int argc, const char **argv, const char *prefix);
int bench_mem_memcpy(int argc, const char **argv, const char *prefix);
int bench_mem_memset(int argc, const char **argv, const char *prefix);
int bench_futex_hash(int argc, const char **argv, const char *prefix);
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);
int bench_futex_requeue(int argc, const char **argv, const char *prefix);
/* 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 0
Expand Down
2 changes: 1 addition & 1 deletion tools/perf/bench/mem-memcpy-arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifdef HAVE_ARCH_X86_64_SUPPORT

#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"

Expand Down
2 changes: 1 addition & 1 deletion tools/perf/bench/mem-memset-arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#ifdef HAVE_ARCH_X86_64_SUPPORT

#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"

Expand Down
64 changes: 32 additions & 32 deletions tools/perf/builtin.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,38 +7,38 @@
extern const char perf_usage_string[];
extern const char perf_more_info_string[];

extern void list_common_cmds_help(void);
extern const char *help_unknown_cmd(const char *cmd);
extern void prune_packed_objects(int);
extern int read_line_with_nul(char *buf, int size, FILE *file);
extern int check_pager_config(const char *cmd);
void list_common_cmds_help(void);
const char *help_unknown_cmd(const char *cmd);
void prune_packed_objects(int);
int read_line_with_nul(char *buf, int size, FILE *file);
int check_pager_config(const char *cmd);

extern int cmd_annotate(int argc, const char **argv, const char *prefix);
extern int cmd_bench(int argc, const char **argv, const char *prefix);
extern 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);
extern int cmd_config(int argc, const char **argv, const char *prefix);
extern int cmd_diff(int argc, const char **argv, const char *prefix);
extern int cmd_evlist(int argc, const char **argv, const char *prefix);
extern int cmd_help(int argc, const char **argv, const char *prefix);
extern int cmd_sched(int argc, const char **argv, const char *prefix);
extern int cmd_list(int argc, const char **argv, const char *prefix);
extern int cmd_record(int argc, const char **argv, const char *prefix);
extern int cmd_report(int argc, const char **argv, const char *prefix);
extern int cmd_stat(int argc, const char **argv, const char *prefix);
extern int cmd_timechart(int argc, const char **argv, const char *prefix);
extern int cmd_top(int argc, const char **argv, const char *prefix);
extern int cmd_script(int argc, const char **argv, const char *prefix);
extern int cmd_version(int argc, const char **argv, const char *prefix);
extern int cmd_probe(int argc, const char **argv, const char *prefix);
extern int cmd_kmem(int argc, const char **argv, const char *prefix);
extern int cmd_lock(int argc, const char **argv, const char *prefix);
extern int cmd_kvm(int argc, const char **argv, const char *prefix);
extern int cmd_test(int argc, const char **argv, const char *prefix);
extern int cmd_trace(int argc, const char **argv, const char *prefix);
extern int cmd_inject(int argc, const char **argv, const char *prefix);
extern 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_annotate(int argc, const char **argv, const char *prefix);
int cmd_bench(int argc, const char **argv, const char *prefix);
int cmd_buildid_cache(int argc, const char **argv, const char *prefix);
int cmd_buildid_list(int argc, const char **argv, const char *prefix);
int cmd_config(int argc, const char **argv, const char *prefix);
int cmd_diff(int argc, const char **argv, const char *prefix);
int cmd_evlist(int argc, const char **argv, const char *prefix);
int cmd_help(int argc, const char **argv, const char *prefix);
int cmd_sched(int argc, const char **argv, const char *prefix);
int cmd_list(int argc, const char **argv, const char *prefix);
int cmd_record(int argc, const char **argv, const char *prefix);
int cmd_report(int argc, const char **argv, const char *prefix);
int cmd_stat(int argc, const char **argv, const char *prefix);
int cmd_timechart(int argc, const char **argv, const char *prefix);
int cmd_top(int argc, const char **argv, const char *prefix);
int cmd_script(int argc, const char **argv, const char *prefix);
int cmd_version(int argc, const char **argv, const char *prefix);
int cmd_probe(int argc, const char **argv, const char *prefix);
int cmd_kmem(int argc, const char **argv, const char *prefix);
int cmd_lock(int argc, const char **argv, const char *prefix);
int cmd_kvm(int argc, const char **argv, const char *prefix);
int cmd_test(int argc, const char **argv, const char *prefix);
int cmd_trace(int argc, const char **argv, const char *prefix);
int cmd_inject(int argc, const char **argv, const char *prefix);
int cmd_mem(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
22 changes: 11 additions & 11 deletions tools/perf/util/cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
extern const char *config_exclusive_filename;

typedef int (*config_fn_t)(const char *, const char *, void *);
extern int perf_default_config(const char *, const char *, void *);
extern int perf_config(config_fn_t fn, void *);
extern int perf_config_int(const char *, const char *);
extern u64 perf_config_u64(const char *, const char *);
extern int perf_config_bool(const char *, const char *);
extern int config_error_nonbool(const char *);
extern const char *perf_config_dirname(const char *, const char *);
extern const char *perf_etc_perfconfig(void);
int perf_default_config(const char *, const char *, void *);
int perf_config(config_fn_t fn, void *);
int perf_config_int(const char *, const char *);
u64 perf_config_u64(const char *, const char *);
int perf_config_bool(const char *, const char *);
int config_error_nonbool(const char *);
const char *perf_config_dirname(const char *, const char *);
const char *perf_etc_perfconfig(void);

char *alias_lookup(const char *alias);
int split_cmdline(char *cmdline, const char ***argv);
Expand Down Expand Up @@ -67,10 +67,10 @@ static inline int is_absolute_path(const char *path)
const char *make_nonrelative_path(const char *path);
char *strip_path_suffix(const char *path, const char *suffix);

extern char *mkpath(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
extern char *perf_path(const char *fmt, ...) __attribute__((format (printf, 1, 2)));
char *mkpath(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)));

#endif /* __PERF_CACHE_H */
4 changes: 2 additions & 2 deletions tools/perf/util/callchain.h
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,7 @@ int fill_callchain_info(struct addr_location *al, struct callchain_cursor_node *
bool hide_unresolved);

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_report_opt(const char *arg);
int parse_callchain_top_opt(const char *arg);
Expand All @@ -236,7 +236,7 @@ static inline void callchain_cursor_snapshot(struct callchain_cursor *dest,
}

#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
static inline int arch_skip_callchain_idx(struct thread *thread __maybe_unused,
struct ip_callchain *chain __maybe_unused)
Expand Down
4 changes: 2 additions & 2 deletions tools/perf/util/cgroup.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct cgroup_sel {


extern int nr_cgroups; /* number of explicit cgroups defined */
extern void close_cgroup(struct cgroup_sel *cgrp);
extern int parse_cgroups(const struct option *opt, const char *str, int unset);
void close_cgroup(struct cgroup_sel *cgrp);
int parse_cgroups(const struct option *opt, const char *str, int unset);

#endif /* __CGROUP_H__ */
2 changes: 1 addition & 1 deletion tools/perf/util/cloexec.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ unsigned long perf_event_open_cloexec_flag(void);

#ifdef __GLIBC_PREREQ
#if !__GLIBC_PREREQ(2, 6) && !defined(__UCLIBC__)
extern int sched_getcpu(void) __THROW;
int sched_getcpu(void) __THROW;
#endif
#endif

Expand Down
72 changes: 35 additions & 37 deletions tools/perf/util/dwarf-aux.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,48 +25,48 @@
#include <elfutils/version.h>

/* 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) */
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 */
extern int cu_find_lineinfo(Dwarf_Die *cudie, unsigned long addr,
const char **fname, int *lineno);
int cu_find_lineinfo(Dwarf_Die *cudie, unsigned long addr,
const char **fname, int *lineno);

/* Walk on funcitons at given address */
extern int cu_walk_functions_at(Dwarf_Die *cu_die, Dwarf_Addr addr,
int (*callback)(Dwarf_Die *, void *), void *data);
int cu_walk_functions_at(Dwarf_Die *cu_die, Dwarf_Addr addr,
int (*callback)(Dwarf_Die *, void *), void *data);

/* 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 */
extern bool die_is_func_instance(Dwarf_Die *dw_die);
bool die_is_func_instance(Dwarf_Die *dw_die);

/* 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 */
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 */
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 */
extern const char *die_get_call_file(Dwarf_Die *in_die);
const char *die_get_call_file(Dwarf_Die *in_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 */
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 */
extern bool die_is_signed_type(Dwarf_Die *tp_die);
bool die_is_signed_type(Dwarf_Die *tp_die);

/* 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 */
enum {
Expand All @@ -77,29 +77,29 @@ enum {
};

/* Search child DIEs */
extern Dwarf_Die *die_find_child(Dwarf_Die *rt_die,
int (*callback)(Dwarf_Die *, void *),
void *data, Dwarf_Die *die_mem);
Dwarf_Die *die_find_child(Dwarf_Die *rt_die,
int (*callback)(Dwarf_Die *, void *),
void *data, Dwarf_Die *die_mem);

/* Search a non-inlined function including given address */
extern Dwarf_Die *die_find_realfunc(Dwarf_Die *cu_die, Dwarf_Addr addr,
Dwarf_Die *die_mem);
Dwarf_Die *die_find_realfunc(Dwarf_Die *cu_die, Dwarf_Addr addr,
Dwarf_Die *die_mem);

/* 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_mem);

/* 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_mem);
Dwarf_Die *die_find_top_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr,
Dwarf_Die *die_mem);

/* Search the deepest inlined function including given address */
extern Dwarf_Die *die_find_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr,
Dwarf_Die *die_mem);
Dwarf_Die *die_find_inlinefunc(Dwarf_Die *sp_die, Dwarf_Addr addr,
Dwarf_Die *die_mem);

/* Walk on the instances of given DIE */
extern int die_walk_instances(Dwarf_Die *in_die,
int (*callback)(Dwarf_Die *, void *), void *data);
int die_walk_instances(Dwarf_Die *in_die,
int (*callback)(Dwarf_Die *, void *), void *data);

/* Walker on lines (Note: line number will not be sorted) */
typedef int (* line_walk_callback_t) (const char *fname, int lineno,
Expand All @@ -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
* 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,
void *data);
int die_walk_lines(Dwarf_Die *rt_die, line_walk_callback_t callback, void *data);

/* Find a variable called 'name' at given address */
extern Dwarf_Die *die_find_variable_at(Dwarf_Die *sp_die, const char *name,
Dwarf_Addr addr, Dwarf_Die *die_mem);
Dwarf_Die *die_find_variable_at(Dwarf_Die *sp_die, const char *name,
Dwarf_Addr addr, Dwarf_Die *die_mem);

/* Find a member called 'name' */
extern Dwarf_Die *die_find_member(Dwarf_Die *st_die, const char *name,
Dwarf_Die *die_mem);
Dwarf_Die *die_find_member(Dwarf_Die *st_die, const char *name,
Dwarf_Die *die_mem);

/* 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" */
extern 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,
struct strbuf *buf);
int die_get_varname(Dwarf_Die *vr_die, struct strbuf *buf);
int die_get_var_range(Dwarf_Die *sp_die, Dwarf_Die *vr_die, struct strbuf *buf);
#endif
8 changes: 3 additions & 5 deletions tools/perf/util/genelf.h
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,10 @@
#define __GENELF_H__

/* genelf.c */
extern int jit_write_elf(int fd, uint64_t code_addr, const char *sym,
const void *code, int csize,
void *debug, int nr_debug_entries);
int jit_write_elf(int fd, uint64_t code_addr, const char *sym,
const void *code, int csize, void *debug, int nr_debug_entries);
/* genelf_debug.c */
extern int jit_add_debug_info(Elf *e, uint64_t code_addr,
void *debug, int nr_debug_entries);
int jit_add_debug_info(Elf *e, uint64_t code_addr, void *debug, int nr_debug_entries);

#if defined(__arm__)
#define GEN_ELF_ARCH EM_ARM
Expand Down
12 changes: 4 additions & 8 deletions tools/perf/util/jit.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,9 @@

#include <data.h>

extern int jit_process(struct perf_session *session,
struct perf_data_file *output,
struct machine *machine,
char *filename,
pid_t pid,
u64 *nbytes);

extern int jit_inject_record(const char *filename);
int jit_process(struct perf_session *session, struct perf_data_file *output,
struct machine *machine, char *filename, pid_t pid, u64 *nbytes);

int jit_inject_record(const char *filename);

#endif /* __JIT_H__ */
7 changes: 3 additions & 4 deletions tools/perf/util/llvm-utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,10 @@ struct 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,
size_t *p_obj_buf_sz);
int llvm__compile_bpf(const char *path, void **p_obj_buf, size_t *p_obj_buf_sz);

/* This function is for test__llvm() use only */
extern int llvm__search_clang(void);
int llvm__search_clang(void);
#endif
Loading

0 comments on commit 3938bad

Please sign in to comment.