summaryrefslogtreecommitdiffstats
path: root/tools/perf/util/symbol.h
diff options
context:
space:
mode:
authorJin Yao <yao.jin@linux.intel.com>2017-03-26 04:34:25 +0800
committerArnaldo Carvalho de Melo <acme@redhat.com>2017-03-27 11:59:23 -0300
commit5580338d0f207921bc1fef5b668cd564adcc3419 (patch)
tree0ef03c35c38b64667e75594cdc93dcb00330661c /tools/perf/util/symbol.h
parentb0ad8ea66445d64a469df0c710947f4cdb8ef16b (diff)
downloadlinux-5580338d0f207921bc1fef5b668cd564adcc3419.tar.gz
linux-5580338d0f207921bc1fef5b668cd564adcc3419.tar.bz2
linux-5580338d0f207921bc1fef5b668cd564adcc3419.zip
perf report: Refactor common code in srcline.c
Introduce dso__name() and filename_split() out of existing code because these codes will be used in several places in next patch. For filename_split(), it may also solve a potential memory leak in existing code. In existing addr2line(), sep = strchr(filename, ':'); if (sep) { *sep++ = '\0'; *file = filename; *line_nr = strtoul(sep, NULL, 0); ret = 1; } out: pclose(fp); return ret; If sep is NULL, filename is not freed or returned via file. Signed-off-by: Yao Jin <yao.jin@linux.intel.com> Tested-by: Milian Wolff <milian.wolff@kdab.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Kan Liang <kan.liang@intel.com> Link: http://lkml.kernel.org/r/1490474069-15823-2-git-send-email-yao.jin@linux.intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/util/symbol.h')
0 files changed, 0 insertions, 0 deletions