aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/util/sort.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index fc4ff2a96616..7a9054a23c36 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -387,6 +387,9 @@ static int hist_entry__dso_from_snprintf(struct hist_entry *he, char *bf,
387static int64_t 387static int64_t
388sort__dso_to_cmp(struct hist_entry *left, struct hist_entry *right) 388sort__dso_to_cmp(struct hist_entry *left, struct hist_entry *right)
389{ 389{
390 if (!left->branch_info || !right->branch_info)
391 return cmp_null(left->branch_info, right->branch_info);
392
390 return _sort__dso_cmp(left->branch_info->to.map, 393 return _sort__dso_cmp(left->branch_info->to.map,
391 right->branch_info->to.map); 394 right->branch_info->to.map);
392} 395}
@@ -394,8 +397,11 @@ sort__dso_to_cmp(struct hist_entry *left, struct hist_entry *right)
394static int hist_entry__dso_to_snprintf(struct hist_entry *he, char *bf, 397static int hist_entry__dso_to_snprintf(struct hist_entry *he, char *bf,
395 size_t size, unsigned int width) 398 size_t size, unsigned int width)
396{ 399{
397 return _hist_entry__dso_snprintf(he->branch_info->to.map, 400 if (he->branch_info)
398 bf, size, width); 401 return _hist_entry__dso_snprintf(he->branch_info->to.map,
402 bf, size, width);
403 else
404 return repsep_snprintf(bf, size, "%-*.*s", width, width, "N/A");
399} 405}
400 406
401static int64_t 407static int64_t