perf str{filter,list}: Disentangle headers

There are places where we just need a forward declaration, and others
were we need to include strlist.h and/or strfilter.h, reducing the
impact of changes in headers on the build time, do it.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: David Ahern <dsahern@gmail.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-zab42gbiki88y9k0csorxekb@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent a43783ae
...@@ -16,7 +16,6 @@ ...@@ -16,7 +16,6 @@
#include <linux/rbtree.h> #include <linux/rbtree.h>
#include "util/symbol.h" #include "util/symbol.h"
#include "util/callchain.h" #include "util/callchain.h"
#include "util/strlist.h"
#include "util/values.h" #include "util/values.h"
#include "perf.h" #include "perf.h"
......
...@@ -30,7 +30,6 @@ ...@@ -30,7 +30,6 @@
#include <linux/time64.h> #include <linux/time64.h>
#include "util/symbol.h" #include "util/symbol.h"
#include "util/callchain.h" #include "util/callchain.h"
#include "util/strlist.h"
#include "perf.h" #include "perf.h"
#include "util/header.h" #include "util/header.h"
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "probe-event.h" #include "probe-event.h"
#include "probe-finder.h" // for MAX_PROBES #include "probe-finder.h" // for MAX_PROBES
#include "parse-events.h" #include "parse-events.h"
#include "strfilter.h"
#include "llvm-utils.h" #include "llvm-utils.h"
#include "c++/clang-c.h" #include "c++/clang-c.h"
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "header.h" #include "header.h"
#include "vdso.h" #include "vdso.h"
#include "probe-file.h" #include "probe-file.h"
#include "strlist.h"
#include "sane_ctype.h" #include "sane_ctype.h"
......
...@@ -5,7 +5,6 @@ ...@@ -5,7 +5,6 @@
#define SBUILD_ID_SIZE (BUILD_ID_SIZE * 2 + 1) #define SBUILD_ID_SIZE (BUILD_ID_SIZE * 2 + 1)
#include "tool.h" #include "tool.h"
#include "strlist.h"
#include <linux/types.h> #include <linux/types.h>
extern struct perf_tool build_id__mark_dso_hit_ops; extern struct perf_tool build_id__mark_dso_hit_ops;
...@@ -34,6 +33,9 @@ char *build_id_cache__origname(const char *sbuild_id); ...@@ -34,6 +33,9 @@ char *build_id_cache__origname(const char *sbuild_id);
char *build_id_cache__linkname(const char *sbuild_id, char *bf, size_t size); char *build_id_cache__linkname(const char *sbuild_id, char *bf, size_t size);
char *build_id_cache__cachedir(const char *sbuild_id, const char *name, char *build_id_cache__cachedir(const char *sbuild_id, const char *name,
bool is_kallsyms, bool is_vdso); bool is_kallsyms, bool is_vdso);
struct strlist;
struct strlist *build_id_cache__list_all(bool validonly); struct strlist *build_id_cache__list_all(bool validonly);
char *build_id_cache__complement(const char *incomplete_sbuild_id); char *build_id_cache__complement(const char *incomplete_sbuild_id);
int build_id_cache__list_build_ids(const char *pathname, int build_id_cache__list_build_ids(const char *pathname,
......
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
#include "evsel.h" #include "evsel.h"
#include "callchain.h" #include "callchain.h"
#include "map.h" #include "map.h"
#include "strlist.h"
#include "symbol.h" #include "symbol.h"
static int comma_fprintf(FILE *fp, bool *first, const char *fmt, ...) static int comma_fprintf(FILE *fp, bool *first, const char *fmt, ...)
......
...@@ -17,7 +17,6 @@ ...@@ -17,7 +17,6 @@
#include "debug.h" #include "debug.h"
#include "evlist.h" #include "evlist.h"
#include "symbol.h" #include "symbol.h"
#include "strlist.h"
#include <elf.h> #include <elf.h>
#include "tsc.h" #include "tsc.h"
......
...@@ -9,7 +9,6 @@ ...@@ -9,7 +9,6 @@
#include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */ #include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */
#include "map.h" #include "map.h"
#include "thread.h" #include "thread.h"
#include "strlist.h"
#include "vdso.h" #include "vdso.h"
#include "build-id.h" #include "build-id.h"
#include "util.h" #include "util.h"
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "parse-events.h" #include "parse-events.h"
#include <subcmd/exec-cmd.h> #include <subcmd/exec-cmd.h>
#include "string2.h" #include "string2.h"
#include "strlist.h"
#include "symbol.h" #include "symbol.h"
#include "cache.h" #include "cache.h"
#include "header.h" #include "header.h"
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#include "util.h" #include "util.h"
#include "event.h" #include "event.h"
#include "strlist.h" #include "strlist.h"
#include "strfilter.h"
#include "debug.h" #include "debug.h"
#include "cache.h" #include "cache.h"
#include "color.h" #include "color.h"
......
...@@ -3,8 +3,6 @@ ...@@ -3,8 +3,6 @@
#include <stdbool.h> #include <stdbool.h>
#include "intlist.h" #include "intlist.h"
#include "strlist.h"
#include "strfilter.h"
/* Probe related configurations */ /* Probe related configurations */
struct probe_conf { struct probe_conf {
...@@ -107,6 +105,8 @@ struct line_range { ...@@ -107,6 +105,8 @@ struct line_range {
struct intlist *line_list; /* Visible lines */ struct intlist *line_list; /* Visible lines */
}; };
struct strlist;
/* List of variables */ /* List of variables */
struct variable_list { struct variable_list {
struct probe_trace_point point; /* Actual probepoint */ struct probe_trace_point point; /* Actual probepoint */
...@@ -153,6 +153,9 @@ int convert_perf_probe_events(struct perf_probe_event *pevs, int npevs); ...@@ -153,6 +153,9 @@ int convert_perf_probe_events(struct perf_probe_event *pevs, int npevs);
int apply_perf_probe_events(struct perf_probe_event *pevs, int npevs); int apply_perf_probe_events(struct perf_probe_event *pevs, int npevs);
int show_probe_trace_events(struct perf_probe_event *pevs, int npevs); int show_probe_trace_events(struct perf_probe_event *pevs, int npevs);
void cleanup_perf_probe_events(struct perf_probe_event *pevs, int npevs); void cleanup_perf_probe_events(struct perf_probe_event *pevs, int npevs);
struct strfilter;
int del_perf_probe_events(struct strfilter *filter); int del_perf_probe_events(struct strfilter *filter);
int show_perf_probe_event(const char *group, const char *event, int show_perf_probe_event(const char *group, const char *event,
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "util.h" #include "util.h"
#include "event.h" #include "event.h"
#include "strlist.h" #include "strlist.h"
#include "strfilter.h"
#include "debug.h" #include "debug.h"
#include "cache.h" #include "cache.h"
#include "color.h" #include "color.h"
......
#ifndef __PROBE_FILE_H #ifndef __PROBE_FILE_H
#define __PROBE_FILE_H #define __PROBE_FILE_H
#include "strlist.h"
#include "strfilter.h"
#include "probe-event.h" #include "probe-event.h"
struct strlist;
struct strfilter;
/* Cache of probe definitions */ /* Cache of probe definitions */
struct probe_cache_entry { struct probe_cache_entry {
struct list_head node; struct list_head node;
...@@ -41,6 +42,7 @@ int probe_file__open_both(int *kfd, int *ufd, int flag); ...@@ -41,6 +42,7 @@ int probe_file__open_both(int *kfd, int *ufd, int flag);
struct strlist *probe_file__get_namelist(int fd); struct strlist *probe_file__get_namelist(int fd);
struct strlist *probe_file__get_rawlist(int fd); struct strlist *probe_file__get_rawlist(int fd);
int probe_file__add_event(int fd, struct probe_trace_event *tev); int probe_file__add_event(int fd, struct probe_trace_event *tev);
int probe_file__del_events(int fd, struct strfilter *filter); int probe_file__del_events(int fd, struct strfilter *filter);
int probe_file__get_events(int fd, struct strfilter *filter, int probe_file__get_events(int fd, struct strfilter *filter,
struct strlist *plist); struct strlist *plist);
......
...@@ -38,6 +38,7 @@ ...@@ -38,6 +38,7 @@
#include "debug.h" #include "debug.h"
#include "intlist.h" #include "intlist.h"
#include "util.h" #include "util.h"
#include "strlist.h"
#include "symbol.h" #include "symbol.h"
#include "probe-finder.h" #include "probe-finder.h"
#include "probe-file.h" #include "probe-file.h"
......
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
#include "symbol.h" #include "symbol.h"
#include "evsel.h" #include "evsel.h"
#include "evlist.h" #include "evlist.h"
#include "strlist.h"
#include <traceevent/event-parse.h> #include <traceevent/event-parse.h>
#include "mem-events.h" #include "mem-events.h"
#include <linux/kernel.h> #include <linux/kernel.h>
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#include "symbol.h" #include "symbol.h"
#include "string.h" #include "string.h"
#include "callchain.h" #include "callchain.h"
#include "strlist.h"
#include "values.h" #include "values.h"
#include "../perf.h" #include "../perf.h"
......
...@@ -40,7 +40,6 @@ ...@@ -40,7 +40,6 @@
#include <termios.h> #include <termios.h>
#include <linux/bitops.h> #include <linux/bitops.h>
#include <termios.h> #include <termios.h>
#include "strlist.h"
extern char buildid_dir[]; extern char buildid_dir[];
...@@ -89,6 +88,8 @@ static inline void *zalloc(size_t size) ...@@ -89,6 +88,8 @@ static inline void *zalloc(size_t size)
#define zfree(ptr) ({ free(*ptr); *ptr = NULL; }) #define zfree(ptr) ({ free(*ptr); *ptr = NULL; })
struct strlist;
int mkdir_p(char *path, mode_t mode); int mkdir_p(char *path, mode_t mode);
int rm_rf(const char *path); int rm_rf(const char *path);
struct strlist *lsdir(const char *name, bool (*filter)(const char *, struct dirent *)); struct strlist *lsdir(const char *name, bool (*filter)(const char *, struct dirent *));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment