perf srcline: Make hist_entry srcline helper consistent with map's
authorArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 28 May 2018 14:06:58 +0000 (11:06 -0300)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 4 Jun 2018 13:28:53 +0000 (10:28 -0300)
No need to have "get_srcline", plain hist_entry__srcline() is enough and
shorter.

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: https://lkml.kernel.org/n/tip-irhzpfmgdaf6cyk0uqqexoh9@git.kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/builtin-c2c.c
tools/perf/util/sort.c
tools/perf/util/sort.h

index 2126bfbcb385e4af0635e300ffc5be1760a4e83d..307b3594525f34cc9e14d758b71bcdf266414c3e 100644 (file)
@@ -1976,7 +1976,7 @@ static int filter_cb(struct hist_entry *he)
        c2c_he = container_of(he, struct c2c_hist_entry, he);
 
        if (c2c.show_src && !he->srcline)
-               he->srcline = hist_entry__get_srcline(he);
+               he->srcline = hist_entry__srcline(he);
 
        calc_width(c2c_he);
 
index 4ab0b4ab24e4e6e7541a88bf14b9efbd838486bd..fed2952ab45a7bc7658ec5c568698f5c148abfef 100644 (file)
@@ -331,7 +331,7 @@ struct sort_entry sort_sym = {
 
 /* --sort srcline */
 
-char *hist_entry__get_srcline(struct hist_entry *he)
+char *hist_entry__srcline(struct hist_entry *he)
 {
        return map__srcline(he->ms.map, he->ip, he->ms.sym);
 }
@@ -340,9 +340,9 @@ static int64_t
 sort__srcline_cmp(struct hist_entry *left, struct hist_entry *right)
 {
        if (!left->srcline)
-               left->srcline = hist_entry__get_srcline(left);
+               left->srcline = hist_entry__srcline(left);
        if (!right->srcline)
-               right->srcline = hist_entry__get_srcline(right);
+               right->srcline = hist_entry__srcline(right);
 
        return strcmp(right->srcline, left->srcline);
 }
@@ -351,7 +351,7 @@ static int hist_entry__srcline_snprintf(struct hist_entry *he, char *bf,
                                        size_t size, unsigned int width)
 {
        if (!he->srcline)
-               he->srcline = hist_entry__get_srcline(he);
+               he->srcline = hist_entry__srcline(he);
 
        return repsep_snprintf(bf, size, "%-.*s", width, he->srcline);
 }
index 9e6896293bbdf8a2742df0a844bd1357c5067650..f007a26d6f6d9060033e30fdaf77e0c8d8b4a0fc 100644 (file)
@@ -292,5 +292,5 @@ int64_t
 sort__daddr_cmp(struct hist_entry *left, struct hist_entry *right);
 int64_t
 sort__dcacheline_cmp(struct hist_entry *left, struct hist_entry *right);
-char *hist_entry__get_srcline(struct hist_entry *he);
+char *hist_entry__srcline(struct hist_entry *he);
 #endif /* __PERF_SORT_H */