perf callchain: Enable printing the srcline in the history
[deliverable/linux.git] / tools / perf / util / srcline.c
index 77c180637138b6c00703e7bd5bcf2600d501adda..ac877f96fed7d23a5c074615391ed186a1f3c909 100644 (file)
@@ -258,7 +258,7 @@ char *get_srcline(struct dso *dso, unsigned long addr)
        const char *dso_name;
 
        if (!dso->has_srcline)
-               return SRCLINE_UNKNOWN;
+               goto out;
 
        if (dso->symsrc_filename)
                dso_name = dso->symsrc_filename;
@@ -289,7 +289,9 @@ out:
                dso->has_srcline = 0;
                dso__free_a2l(dso);
        }
-       return SRCLINE_UNKNOWN;
+       if (asprintf(&srcline, "%s[%lx]", dso->short_name, addr) < 0)
+               return SRCLINE_UNKNOWN;
+       return srcline;
 }
 
 void free_srcline(char *srcline)
This page took 0.025914 seconds and 5 git commands to generate.