aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/perf/util/sort.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c
index 57047c0a247c..fc4ff2a96616 100644
--- a/tools/perf/util/sort.c
+++ b/tools/perf/util/sort.c
@@ -404,6 +404,12 @@ sort__sym_from_cmp(struct hist_entry *left, struct hist_entry *right)
404 struct addr_map_symbol *from_l = &left->branch_info->from; 404 struct addr_map_symbol *from_l = &left->branch_info->from;
405 struct addr_map_symbol *from_r = &right->branch_info->from; 405 struct addr_map_symbol *from_r = &right->branch_info->from;
406 406
407 if (!left->branch_info || !right->branch_info)
408 return cmp_null(left->branch_info, right->branch_info);
409
410 from_l = &left->branch_info->from;
411 from_r = &right->branch_info->from;
412
407 if (!from_l->sym && !from_r->sym) 413 if (!from_l->sym && !from_r->sym)
408 return _sort__addr_cmp(from_l->addr, from_r->addr); 414 return _sort__addr_cmp(from_l->addr, from_r->addr);
409 415
@@ -430,10 +436,14 @@ sort__sym_to_cmp(struct hist_entry *left, struct hist_entry *right)
430static int hist_entry__sym_from_snprintf(struct hist_entry *he, char *bf, 436static int hist_entry__sym_from_snprintf(struct hist_entry *he, char *bf,
431 size_t size, unsigned int width) 437 size_t size, unsigned int width)
432{ 438{
433 struct addr_map_symbol *from = &he->branch_info->from; 439 if (he->branch_info) {
434 return _hist_entry__sym_snprintf(from->map, from->sym, from->addr, 440 struct addr_map_symbol *from = &he->branch_info->from;
435 he->level, bf, size, width);
436 441
442 return _hist_entry__sym_snprintf(from->map, from->sym, from->addr,
443 he->level, bf, size, width);
444 }
445
446 return repsep_snprintf(bf, size, "%-*.*s", width, width, "N/A");
437} 447}
438 448
439static int hist_entry__sym_to_snprintf(struct hist_entry *he, char *bf, 449static int hist_entry__sym_to_snprintf(struct hist_entry *he, char *bf,