perf tools: Move srcline definitions to separate header

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.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent fea01392
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
#include "../ui.h" #include "../ui.h"
#include "map.h" #include "map.h"
#include "annotate.h" #include "annotate.h"
#include "srcline.h"
#include "sane_ctype.h" #include "sane_ctype.h"
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "../../util/hist.h" #include "../../util/hist.h"
#include "../../util/sort.h" #include "../../util/sort.h"
#include "../../util/evsel.h" #include "../../util/evsel.h"
#include "../../util/srcline.h"
#include "../../util/sane_ctype.h" #include "../../util/sane_ctype.h"
static size_t callchain__fprintf_left_margin(FILE *fp, int left_margin) static size_t callchain__fprintf_left_margin(FILE *fp, int left_margin)
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#include "evlist.h" #include "evlist.h"
#include "evsel.h" #include "evsel.h"
#include "annotate.h" #include "annotate.h"
#include "srcline.h"
#include "ui/progress.h" #include "ui/progress.h"
#include <math.h> #include <math.h>
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#include "debug.h" #include "debug.h"
#include "machine.h" #include "machine.h"
#include <linux/string.h> #include <linux/string.h>
#include "srcline.h"
#include "unwind.h" #include "unwind.h"
static void __maps__insert(struct maps *maps, struct map *map); static void __maps__insert(struct maps *maps, struct map *map);
......
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#include <subcmd/parse-options.h> #include <subcmd/parse-options.h>
#include "parse-events.h" #include "parse-events.h"
#include "hist.h" #include "hist.h"
#include "srcline.h"
#include "thread.h" #include "thread.h"
extern regex_t parent_regex; extern regex_t parent_regex;
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include "util/util.h" #include "util/util.h"
#include "util/debug.h" #include "util/debug.h"
#include "util/callchain.h" #include "util/callchain.h"
#include "srcline.h"
#include "symbol.h" #include "symbol.h"
......
#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 */
...@@ -144,8 +144,6 @@ struct parse_tag { ...@@ -144,8 +144,6 @@ struct parse_tag {
unsigned long parse_tag_value(const char *str, struct parse_tag *tags); 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, static inline int path__join(char *bf, size_t size,
const char *path1, const char *path2) const char *path1, const char *path2)
{ {
...@@ -161,16 +159,6 @@ static inline int path__join3(char *bf, size_t size, ...@@ -161,16 +159,6 @@ static inline int path__join3(char *bf, size_t size,
path2, path2[0] ? "/" : "", path3); 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); int perf_event_paranoid(void);
void mem_bswap_64(void *src, int byte_size); void mem_bswap_64(void *src, int byte_size);
...@@ -221,19 +209,4 @@ int timestamp__scnprintf_usec(u64 timestamp, char *buf, size_t sz); ...@@ -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); 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 */ #endif /* GIT_COMPAT_UTIL_H */
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