From: Arnaldo Carvalho de Melo <acme@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: linux-kernel@vger.kernel.org,
Arnaldo Carvalho de Melo <acme@redhat.com>,
Adrian Hunter <adrian.hunter@intel.com>,
David Ahern <dsahern@gmail.com>, Jiri Olsa <jolsa@kernel.org>,
Namhyung Kim <namhyung@kernel.org>,
Wang Nan <wangnan0@huawei.com>
Subject: [PATCH 20/28] perf str{filter,list}: Disentangle headers
Date: Wed, 19 Apr 2017 13:17:15 -0300 [thread overview]
Message-ID: <20170419161723.21011-21-acme@kernel.org> (raw)
In-Reply-To: <20170419161723.21011-1-acme@kernel.org>
From: Arnaldo Carvalho de Melo <acme@redhat.com>
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.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
tools/perf/builtin-report.c | 1 -
tools/perf/builtin-timechart.c | 1 -
tools/perf/util/bpf-loader.c | 1 +
tools/perf/util/build-id.c | 1 +
tools/perf/util/build-id.h | 4 +++-
tools/perf/util/evsel_fprintf.c | 1 +
tools/perf/util/jitdump.c | 1 -
tools/perf/util/map.c | 1 -
tools/perf/util/parse-events.c | 1 +
tools/perf/util/probe-event.c | 1 +
tools/perf/util/probe-event.h | 7 +++++--
tools/perf/util/probe-file.c | 1 +
tools/perf/util/probe-file.h | 6 ++++--
tools/perf/util/probe-finder.c | 1 +
tools/perf/util/sort.c | 1 +
tools/perf/util/sort.h | 1 -
tools/perf/util/util.h | 3 ++-
17 files changed, 22 insertions(+), 11 deletions(-)
diff --git a/tools/perf/builtin-report.c b/tools/perf/builtin-report.c
index 2941d8df4d40..f50738e0006e 100644
--- a/tools/perf/builtin-report.c
+++ b/tools/perf/builtin-report.c
@@ -16,7 +16,6 @@
#include <linux/rbtree.h>
#include "util/symbol.h"
#include "util/callchain.h"
-#include "util/strlist.h"
#include "util/values.h"
#include "perf.h"
diff --git a/tools/perf/builtin-timechart.c b/tools/perf/builtin-timechart.c
index e2576c8f6d4e..38e2c437b7b3 100644
--- a/tools/perf/builtin-timechart.c
+++ b/tools/perf/builtin-timechart.c
@@ -30,7 +30,6 @@
#include <linux/time64.h>
#include "util/symbol.h"
#include "util/callchain.h"
-#include "util/strlist.h"
#include "perf.h"
#include "util/header.h"
diff --git a/tools/perf/util/bpf-loader.c b/tools/perf/util/bpf-loader.c
index bf21c1ca9771..4bd2d1d882af 100644
--- a/tools/perf/util/bpf-loader.c
+++ b/tools/perf/util/bpf-loader.c
@@ -19,6 +19,7 @@
#include "probe-event.h"
#include "probe-finder.h" // for MAX_PROBES
#include "parse-events.h"
+#include "strfilter.h"
#include "llvm-utils.h"
#include "c++/clang-c.h"
diff --git a/tools/perf/util/build-id.c b/tools/perf/util/build-id.c
index 8d8ef1d31b1e..f9ccd053cdf6 100644
--- a/tools/perf/util/build-id.c
+++ b/tools/perf/util/build-id.c
@@ -19,6 +19,7 @@
#include "header.h"
#include "vdso.h"
#include "probe-file.h"
+#include "strlist.h"
#include "sane_ctype.h"
diff --git a/tools/perf/util/build-id.h b/tools/perf/util/build-id.h
index d27990610f9f..a96081121179 100644
--- a/tools/perf/util/build-id.h
+++ b/tools/perf/util/build-id.h
@@ -5,7 +5,6 @@
#define SBUILD_ID_SIZE (BUILD_ID_SIZE * 2 + 1)
#include "tool.h"
-#include "strlist.h"
#include <linux/types.h>
extern struct perf_tool build_id__mark_dso_hit_ops;
@@ -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__cachedir(const char *sbuild_id, const char *name,
bool is_kallsyms, bool is_vdso);
+
+struct strlist;
+
struct strlist *build_id_cache__list_all(bool validonly);
char *build_id_cache__complement(const char *incomplete_sbuild_id);
int build_id_cache__list_build_ids(const char *pathname,
diff --git a/tools/perf/util/evsel_fprintf.c b/tools/perf/util/evsel_fprintf.c
index 8000f62d5d53..e415aee6a245 100644
--- a/tools/perf/util/evsel_fprintf.c
+++ b/tools/perf/util/evsel_fprintf.c
@@ -5,6 +5,7 @@
#include "evsel.h"
#include "callchain.h"
#include "map.h"
+#include "strlist.h"
#include "symbol.h"
static int comma_fprintf(FILE *fp, bool *first, const char *fmt, ...)
diff --git a/tools/perf/util/jitdump.c b/tools/perf/util/jitdump.c
index 388078d84eed..9084930e1757 100644
--- a/tools/perf/util/jitdump.c
+++ b/tools/perf/util/jitdump.c
@@ -17,7 +17,6 @@
#include "debug.h"
#include "evlist.h"
#include "symbol.h"
-#include "strlist.h"
#include <elf.h>
#include "tsc.h"
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index 9059d20c3b8a..ebfa5d92358a 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -9,7 +9,6 @@
#include <uapi/linux/mman.h> /* To get things like MAP_HUGETLB even on older libc headers */
#include "map.h"
#include "thread.h"
-#include "strlist.h"
#include "vdso.h"
#include "build-id.h"
#include "util.h"
diff --git a/tools/perf/util/parse-events.c b/tools/perf/util/parse-events.c
index d4877c8438e5..580f0e17ad38 100644
--- a/tools/perf/util/parse-events.c
+++ b/tools/perf/util/parse-events.c
@@ -9,6 +9,7 @@
#include "parse-events.h"
#include <subcmd/exec-cmd.h>
#include "string2.h"
+#include "strlist.h"
#include "symbol.h"
#include "cache.h"
#include "header.h"
diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c
index 8f1374071cfc..84e7e698411e 100644
--- a/tools/perf/util/probe-event.c
+++ b/tools/perf/util/probe-event.c
@@ -36,6 +36,7 @@
#include "util.h"
#include "event.h"
#include "strlist.h"
+#include "strfilter.h"
#include "debug.h"
#include "cache.h"
#include "color.h"
diff --git a/tools/perf/util/probe-event.h b/tools/perf/util/probe-event.h
index 5d4e94061402..373842656fb6 100644
--- a/tools/perf/util/probe-event.h
+++ b/tools/perf/util/probe-event.h
@@ -3,8 +3,6 @@
#include <stdbool.h>
#include "intlist.h"
-#include "strlist.h"
-#include "strfilter.h"
/* Probe related configurations */
struct probe_conf {
@@ -107,6 +105,8 @@ struct line_range {
struct intlist *line_list; /* Visible lines */
};
+struct strlist;
+
/* List of variables */
struct variable_list {
struct probe_trace_point point; /* Actual probepoint */
@@ -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 show_probe_trace_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 show_perf_probe_event(const char *group, const char *event,
diff --git a/tools/perf/util/probe-file.c b/tools/perf/util/probe-file.c
index 1ccaefdc05c4..685653f2bc32 100644
--- a/tools/perf/util/probe-file.c
+++ b/tools/perf/util/probe-file.c
@@ -19,6 +19,7 @@
#include "util.h"
#include "event.h"
#include "strlist.h"
+#include "strfilter.h"
#include "debug.h"
#include "cache.h"
#include "color.h"
diff --git a/tools/perf/util/probe-file.h b/tools/perf/util/probe-file.h
index dbf95a00864a..5ecc9d3925db 100644
--- a/tools/perf/util/probe-file.h
+++ b/tools/perf/util/probe-file.h
@@ -1,10 +1,11 @@
#ifndef __PROBE_FILE_H
#define __PROBE_FILE_H
-#include "strlist.h"
-#include "strfilter.h"
#include "probe-event.h"
+struct strlist;
+struct strfilter;
+
/* Cache of probe definitions */
struct probe_cache_entry {
struct list_head node;
@@ -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_rawlist(int fd);
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__get_events(int fd, struct strfilter *filter,
struct strlist *plist);
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index 3f3cd11d3b7c..a5731de0e5eb 100644
--- a/tools/perf/util/probe-finder.c
+++ b/tools/perf/util/probe-finder.c
@@ -38,6 +38,7 @@
#include "debug.h"
#include "intlist.h"
#include "util.h"
+#include "strlist.h"
#include "symbol.h"
#include "probe-finder.h"
#include "probe-file.h"
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 9aa058e167e8..4df228ab4db1 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -7,6 +7,7 @@
#include "symbol.h"
#include "evsel.h"
#include "evlist.h"
+#include "strlist.h"
#include <traceevent/event-parse.h>
#include "mem-events.h"
#include <linux/kernel.h>
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index 535903297cee..421232a27e7b 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -11,7 +11,6 @@
#include "symbol.h"
#include "string.h"
#include "callchain.h"
-#include "strlist.h"
#include "values.h"
#include "../perf.h"
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 6fd9963be1c8..397676c25232 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -40,7 +40,6 @@
#include <termios.h>
#include <linux/bitops.h>
#include <termios.h>
-#include "strlist.h"
extern char buildid_dir[];
@@ -89,6 +88,8 @@ static inline void *zalloc(size_t size)
#define zfree(ptr) ({ free(*ptr); *ptr = NULL; })
+struct strlist;
+
int mkdir_p(char *path, mode_t mode);
int rm_rf(const char *path);
struct strlist *lsdir(const char *name, bool (*filter)(const char *, struct dirent *));
--
2.9.3
next prev parent reply other threads:[~2017-04-19 16:20 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-04-19 16:16 [GIT PULL 00/28] perf/core fixes and cleanups Arnaldo Carvalho de Melo
2017-04-19 16:16 ` [PATCH 01/28] perf unwind arm64: Add missing errno.h header Arnaldo Carvalho de Melo
2017-04-19 16:16 ` [PATCH 02/28] perf tools: Remove FLEX_ARRAY definition Arnaldo Carvalho de Melo
2017-04-19 16:16 ` [PATCH 03/28] tools include: Introduce linux/bug.h, from the kernel sources Arnaldo Carvalho de Melo
2017-04-19 16:16 ` [PATCH 04/28] tools include: Adopt __same_type() and __must_be_array() from the kernel Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 05/28] tools include: Move ARRAY_SIZE() to linux/kernel.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 06/28] perf tools: Add include <linux/kernel.h> where ARRAY_SIZE() is used Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 07/28] objtool: Drop ARRAY_SIZE() definition, tools/include/linux/kernel.h has it now Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 08/28] tools include: Drop ARRAY_SIZE() definition from linux/hashtable.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 09/28] perf tools: Remove unused macros from util.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 10/28] perf tools: Including missing inttypes.h header Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 11/28] perf tools: Remove PRI[xu] macros from perf.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 12/28] perf tools: Replace STR() calls with __stringify() Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 13/28] perf tools: Ditch unused PATH_SEP, STRIP_EXTENSION Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 14/28] perf tools: Move sane ctype stuff from util.h to sane_ctype.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 15/28] tools include: Include missing headers for fls() and types in linux/log2.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 16/28] perf tools: Move print_binary definitions to separate files Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 17/28] perf tools: Move srcline definitions to separate header Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 18/28] perf tools: Move extra string util functions to util/string2.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 19/28] perf tools: Include errno.h where needed Arnaldo Carvalho de Melo
2017-04-19 16:17 ` Arnaldo Carvalho de Melo [this message]
2017-04-19 16:17 ` [PATCH 21/28] perf tools: Don't include terminal handling headers in util.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 22/28] perf tools: Move path related functions to util/path.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 23/28] perf tools: No need to include bitops.h in util.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 24/28] perf tools: Use api/fs/tracing_path.h where needed Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 25/28] perf tools: Remove misplaced __maybe_unused in some functions Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 26/28] perf tools: Remove include dirent.h from util.h Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 27/28] perf tools: Remove regex.h and fnmatch.h " Arnaldo Carvalho de Melo
2017-04-19 16:17 ` [PATCH 28/28] perf tools: Ditch unused strchrnul() reimplementation Arnaldo Carvalho de Melo
2017-04-20 8:10 ` [GIT PULL 00/28] perf/core fixes and cleanups Ingo Molnar
2017-04-20 11:24 ` Arnaldo Carvalho de Melo
2017-04-20 11:29 ` Ingo Molnar
2017-04-20 17:10 ` Arnaldo Carvalho de Melo
2017-04-20 18:29 ` Arnaldo Carvalho de Melo
2017-04-20 18:51 ` Arnaldo Carvalho de Melo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170419161723.21011-21-acme@kernel.org \
--to=acme@kernel.org \
--cc=acme@redhat.com \
--cc=adrian.hunter@intel.com \
--cc=dsahern@gmail.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=wangnan0@huawei.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).