Skip to content

Commit 6a53da0

Browse files
committed
perf srcline: Make hist_entry srcline helper consistent with map's
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>
1 parent bfa6351 commit 6a53da0

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

‎tools/perf/builtin-c2c.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1976,7 +1976,7 @@ static int filter_cb(struct hist_entry *he)
19761976
c2c_he = container_of(he, struct c2c_hist_entry, he);
19771977

19781978
if (c2c.show_src && !he->srcline)
1979-
he->srcline = hist_entry__get_srcline(he);
1979+
he->srcline = hist_entry__srcline(he);
19801980

19811981
calc_width(c2c_he);
19821982

‎tools/perf/util/sort.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -331,7 +331,7 @@ struct sort_entry sort_sym = {
331331

332332
/* --sort srcline */
333333

334-
char *hist_entry__get_srcline(struct hist_entry *he)
334+
char *hist_entry__srcline(struct hist_entry *he)
335335
{
336336
return map__srcline(he->ms.map, he->ip, he->ms.sym);
337337
}
@@ -340,9 +340,9 @@ static int64_t
340340
sort__srcline_cmp(struct hist_entry *left, struct hist_entry *right)
341341
{
342342
if (!left->srcline)
343-
left->srcline = hist_entry__get_srcline(left);
343+
left->srcline = hist_entry__srcline(left);
344344
if (!right->srcline)
345-
right->srcline = hist_entry__get_srcline(right);
345+
right->srcline = hist_entry__srcline(right);
346346

347347
return strcmp(right->srcline, left->srcline);
348348
}
@@ -351,7 +351,7 @@ static int hist_entry__srcline_snprintf(struct hist_entry *he, char *bf,
351351
size_t size, unsigned int width)
352352
{
353353
if (!he->srcline)
354-
he->srcline = hist_entry__get_srcline(he);
354+
he->srcline = hist_entry__srcline(he);
355355

356356
return repsep_snprintf(bf, size, "%-.*s", width, he->srcline);
357357
}

‎tools/perf/util/sort.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,5 +292,5 @@ int64_t
292292
sort__daddr_cmp(struct hist_entry *left, struct hist_entry *right);
293293
int64_t
294294
sort__dcacheline_cmp(struct hist_entry *left, struct hist_entry *right);
295-
char *hist_entry__get_srcline(struct hist_entry *he);
295+
char *hist_entry__srcline(struct hist_entry *he);
296296
#endif /* __PERF_SORT_H */

0 commit comments

Comments
 (0)