diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-05-28 10:06:58 -0400 |
---|---|---|
committer | Arnaldo Carvalho de Melo <acme@redhat.com> | 2018-06-04 09:28:53 -0400 |
commit | 6a53da05c433284252c9363043bf3d8a5789cfca (patch) | |
tree | 774d04af64d86e9fd6628147ec549dd762ab52ef | |
parent | bfa63519fb94fd8b4b0e5ffcd8bde650ea8b20c1 (diff) |
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>
-rw-r--r-- | tools/perf/builtin-c2c.c | 2 | ||||
-rw-r--r-- | tools/perf/util/sort.c | 8 | ||||
-rw-r--r-- | tools/perf/util/sort.h | 2 |
3 files changed, 6 insertions, 6 deletions
diff --git a/tools/perf/builtin-c2c.c b/tools/perf/builtin-c2c.c index 2126bfbcb385..307b3594525f 100644 --- a/tools/perf/builtin-c2c.c +++ b/tools/perf/builtin-c2c.c | |||
@@ -1976,7 +1976,7 @@ static int filter_cb(struct hist_entry *he) | |||
1976 | c2c_he = container_of(he, struct c2c_hist_entry, he); | 1976 | c2c_he = container_of(he, struct c2c_hist_entry, he); |
1977 | 1977 | ||
1978 | if (c2c.show_src && !he->srcline) | 1978 | if (c2c.show_src && !he->srcline) |
1979 | he->srcline = hist_entry__get_srcline(he); | 1979 | he->srcline = hist_entry__srcline(he); |
1980 | 1980 | ||
1981 | calc_width(c2c_he); | 1981 | calc_width(c2c_he); |
1982 | 1982 | ||
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 4ab0b4ab24e4..fed2952ab45a 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c | |||
@@ -331,7 +331,7 @@ struct sort_entry sort_sym = { | |||
331 | 331 | ||
332 | /* --sort srcline */ | 332 | /* --sort srcline */ |
333 | 333 | ||
334 | char *hist_entry__get_srcline(struct hist_entry *he) | 334 | char *hist_entry__srcline(struct hist_entry *he) |
335 | { | 335 | { |
336 | return map__srcline(he->ms.map, he->ip, he->ms.sym); | 336 | return map__srcline(he->ms.map, he->ip, he->ms.sym); |
337 | } | 337 | } |
@@ -340,9 +340,9 @@ static int64_t | |||
340 | sort__srcline_cmp(struct hist_entry *left, struct hist_entry *right) | 340 | sort__srcline_cmp(struct hist_entry *left, struct hist_entry *right) |
341 | { | 341 | { |
342 | if (!left->srcline) | 342 | if (!left->srcline) |
343 | left->srcline = hist_entry__get_srcline(left); | 343 | left->srcline = hist_entry__srcline(left); |
344 | if (!right->srcline) | 344 | if (!right->srcline) |
345 | right->srcline = hist_entry__get_srcline(right); | 345 | right->srcline = hist_entry__srcline(right); |
346 | 346 | ||
347 | return strcmp(right->srcline, left->srcline); | 347 | return strcmp(right->srcline, left->srcline); |
348 | } | 348 | } |
@@ -351,7 +351,7 @@ static int hist_entry__srcline_snprintf(struct hist_entry *he, char *bf, | |||
351 | size_t size, unsigned int width) | 351 | size_t size, unsigned int width) |
352 | { | 352 | { |
353 | if (!he->srcline) | 353 | if (!he->srcline) |
354 | he->srcline = hist_entry__get_srcline(he); | 354 | he->srcline = hist_entry__srcline(he); |
355 | 355 | ||
356 | return repsep_snprintf(bf, size, "%-.*s", width, he->srcline); | 356 | return repsep_snprintf(bf, size, "%-.*s", width, he->srcline); |
357 | } | 357 | } |
diff --git a/tools/perf/util/sort.h b/tools/perf/util/sort.h index 9e6896293bbd..f007a26d6f6d 100644 --- a/tools/perf/util/sort.h +++ b/tools/perf/util/sort.h | |||
@@ -292,5 +292,5 @@ int64_t | |||
292 | sort__daddr_cmp(struct hist_entry *left, struct hist_entry *right); | 292 | sort__daddr_cmp(struct hist_entry *left, struct hist_entry *right); |
293 | int64_t | 293 | int64_t |
294 | sort__dcacheline_cmp(struct hist_entry *left, struct hist_entry *right); | 294 | 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); |
296 | #endif /* __PERF_SORT_H */ | 296 | #endif /* __PERF_SORT_H */ |