/* Get the filename:line for the colored entries */
static int symbol__get_source_line(struct symbol *sym, struct map *map,
struct perf_evsel *evsel,
- struct rb_root *root, int len,
- const char *filename)
+ struct rb_root *root, int len)
{
u64 start;
int i, k;
goto next;
offset = start + i;
- src_line->path = get_srcline(filename, offset);
+ src_line->path = get_srcline(map->dso, offset);
insert_source_line(&tmp_root, src_line);
next:
bool full_paths, int min_pcnt, int max_lines)
{
struct dso *dso = map->dso;
- const char *filename = dso->long_name;
struct rb_root source_line = RB_ROOT;
u64 len;
len = symbol__size(sym);
if (print_lines) {
- symbol__get_source_line(sym, map, evsel, &source_line,
- len, filename);
- print_summary(&source_line, filename);
+ symbol__get_source_line(sym, map, evsel, &source_line, len);
+ print_summary(&source_line, dso->long_name);
}
symbol__annotate_printf(sym, map, evsel, full_paths,
#include <linux/kernel.h>
+#include "util/dso.h"
#include "util/util.h"
#include "util/debug.h"
return ret;
}
-char *get_srcline(const char *dso_name, unsigned long addr)
+char *get_srcline(struct dso *dso, unsigned long addr)
{
char *file;
unsigned line;
char *srcline = SRCLINE_UNKNOWN;
+ char *dso_name = dso->long_name;
size_t size;
if (dso_name[0] == '[')
#define SRCLINE_UNKNOWN ((char *) "??:0")
-char *get_srcline(const char *dso_name, unsigned long addr);
+struct dso;
+
+char *get_srcline(struct dso *dso, unsigned long addr);
void free_srcline(char *srcline);
#endif /* GIT_COMPAT_UTIL_H */