linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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 17/28] perf tools: Move srcline definitions to separate header
Date: Wed, 19 Apr 2017 13:17:12 -0300	[thread overview]
Message-ID: <20170419161723.21011-18-acme@kernel.org> (raw)
In-Reply-To: <20170419161723.21011-1-acme@kernel.org>

From: Arnaldo Carvalho de Melo <acme@redhat.com>

Out of util.h into a new file, srcline.h

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-ludnlm4djqcdjziekzr4s3u9@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 tools/perf/ui/browsers/hists.c |  1 +
 tools/perf/ui/stdio/hist.c     |  1 +
 tools/perf/util/hist.c         |  1 +
 tools/perf/util/map.c          |  1 +
 tools/perf/util/sort.h         |  1 +
 tools/perf/util/srcline.c      |  1 +
 tools/perf/util/srcline.h      | 34 ++++++++++++++++++++++++++++++++++
 tools/perf/util/util.h         | 27 ---------------------------
 8 files changed, 40 insertions(+), 27 deletions(-)
 create mode 100644 tools/perf/util/srcline.h

diff --git a/tools/perf/ui/browsers/hists.c b/tools/perf/ui/browsers/hists.c
index 56f5c038689e..ac7f6a3e4a86 100644
--- a/tools/perf/ui/browsers/hists.c
+++ b/tools/perf/ui/browsers/hists.c
@@ -19,6 +19,7 @@
 #include "../ui.h"
 #include "map.h"
 #include "annotate.h"
+#include "srcline.h"
 
 #include "sane_ctype.h"
 
diff --git a/tools/perf/ui/stdio/hist.c b/tools/perf/ui/stdio/hist.c
index 297a79c69b71..66aa4eb369f1 100644
--- a/tools/perf/ui/stdio/hist.c
+++ b/tools/perf/ui/stdio/hist.c
@@ -4,6 +4,7 @@
 #include "../../util/hist.h"
 #include "../../util/sort.h"
 #include "../../util/evsel.h"
+#include "../../util/srcline.h"
 #include "../../util/sane_ctype.h"
 
 static size_t callchain__fprintf_left_margin(FILE *fp, int left_margin)
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 61bf304206fd..af3bd5d31d99 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -8,6 +8,7 @@
 #include "evlist.h"
 #include "evsel.h"
 #include "annotate.h"
+#include "srcline.h"
 #include "ui/progress.h"
 #include <math.h>
 
diff --git a/tools/perf/util/map.c b/tools/perf/util/map.c
index c1870ac365a3..9059d20c3b8a 100644
--- a/tools/perf/util/map.c
+++ b/tools/perf/util/map.c
@@ -16,6 +16,7 @@
 #include "debug.h"
 #include "machine.h"
 #include <linux/string.h>
+#include "srcline.h"
 #include "unwind.h"
 
 static void __maps__insert(struct maps *maps, struct map *map);
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h
index e35fb186d048..535903297cee 100644
--- a/tools/perf/util/sort.h
+++ b/tools/perf/util/sort.h
@@ -21,6 +21,7 @@
 #include <subcmd/parse-options.h>
 #include "parse-events.h"
 #include "hist.h"
+#include "srcline.h"
 #include "thread.h"
 
 extern regex_t parent_regex;
diff --git a/tools/perf/util/srcline.c b/tools/perf/util/srcline.c
index ef192802edc9..df051a52393c 100644
--- a/tools/perf/util/srcline.c
+++ b/tools/perf/util/srcline.c
@@ -9,6 +9,7 @@
 #include "util/util.h"
 #include "util/debug.h"
 #include "util/callchain.h"
+#include "srcline.h"
 
 #include "symbol.h"
 
diff --git a/tools/perf/util/srcline.h b/tools/perf/util/srcline.h
new file mode 100644
index 000000000000..7b52ba88676e
--- /dev/null
+++ b/tools/perf/util/srcline.h
@@ -0,0 +1,34 @@
+#ifndef PERF_SRCLINE_H
+#define PERF_SRCLINE_H
+
+#include <linux/list.h>
+#include <linux/types.h>
+
+struct dso;
+struct symbol;
+
+extern bool srcline_full_filename;
+char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
+		  bool show_sym, bool show_addr);
+char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
+		  bool show_sym, bool show_addr, bool unwind_inlines);
+void free_srcline(char *srcline);
+
+#define SRCLINE_UNKNOWN  ((char *) "??:0")
+
+struct inline_list {
+	char			*filename;
+	char			*funcname;
+	unsigned int		line_nr;
+	struct list_head	list;
+};
+
+struct inline_node {
+	u64			addr;
+	struct list_head	val;
+};
+
+struct inline_node *dso__parse_addr_inlines(struct dso *dso, u64 addr);
+void inline_node__delete(struct inline_node *node);
+
+#endif /* PERF_SRCLINE_H */
diff --git a/tools/perf/util/util.h b/tools/perf/util/util.h
index 4d9069ab569a..46cfdccc32bc 100644
--- a/tools/perf/util/util.h
+++ b/tools/perf/util/util.h
@@ -144,8 +144,6 @@ struct parse_tag {
 
 unsigned long parse_tag_value(const char *str, struct parse_tag *tags);
 
-#define SRCLINE_UNKNOWN  ((char *) "??:0")
-
 static inline int path__join(char *bf, size_t size,
 			     const char *path1, const char *path2)
 {
@@ -161,16 +159,6 @@ static inline int path__join3(char *bf, size_t size,
 			 path2, path2[0] ? "/" : "", path3);
 }
 
-struct dso;
-struct symbol;
-
-extern bool srcline_full_filename;
-char *get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
-		  bool show_sym, bool show_addr);
-char *__get_srcline(struct dso *dso, u64 addr, struct symbol *sym,
-		  bool show_sym, bool show_addr, bool unwind_inlines);
-void free_srcline(char *srcline);
-
 int perf_event_paranoid(void);
 
 void mem_bswap_64(void *src, int byte_size);
@@ -221,19 +209,4 @@ int timestamp__scnprintf_usec(u64 timestamp, char *buf, size_t sz);
 
 int unit_number__scnprintf(char *buf, size_t size, u64 n);
 
-struct inline_list {
-	char			*filename;
-	char			*funcname;
-	unsigned int		line_nr;
-	struct list_head	list;
-};
-
-struct inline_node {
-	u64			addr;
-	struct list_head	val;
-};
-
-struct inline_node *dso__parse_addr_inlines(struct dso *dso, u64 addr);
-void inline_node__delete(struct inline_node *node);
-
 #endif /* GIT_COMPAT_UTIL_H */
-- 
2.9.3

  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 ` Arnaldo Carvalho de Melo [this message]
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 ` [PATCH 20/28] perf str{filter,list}: Disentangle headers Arnaldo Carvalho de Melo
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-18-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).