diff options
Diffstat (limited to 'tools/perf')
| -rw-r--r-- | tools/perf/util/sort.c | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 83336610faa9..03cabe5678d0 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c | |||
| @@ -160,9 +160,10 @@ struct sort_entry sort_dso = { | |||
| 160 | 160 | ||
| 161 | /* --sort symbol */ | 161 | /* --sort symbol */ |
| 162 | 162 | ||
| 163 | static int64_t _sort__sym_cmp(struct symbol *sym_l, struct symbol *sym_r, | 163 | static int64_t _sort__sym_cmp(struct symbol *sym_l, struct symbol *sym_r) |
| 164 | u64 ip_l, u64 ip_r) | ||
| 165 | { | 164 | { |
| 165 | u64 ip_l, ip_r; | ||
| 166 | |||
| 166 | if (!sym_l || !sym_r) | 167 | if (!sym_l || !sym_r) |
| 167 | return cmp_null(sym_l, sym_r); | 168 | return cmp_null(sym_l, sym_r); |
| 168 | 169 | ||
| @@ -178,21 +179,10 @@ static int64_t _sort__sym_cmp(struct symbol *sym_l, struct symbol *sym_r, | |||
| 178 | static int64_t | 179 | static int64_t |
| 179 | sort__sym_cmp(struct hist_entry *left, struct hist_entry *right) | 180 | sort__sym_cmp(struct hist_entry *left, struct hist_entry *right) |
| 180 | { | 181 | { |
| 181 | u64 ip_l, ip_r; | ||
| 182 | |||
| 183 | if (!left->ms.sym && !right->ms.sym) | 182 | if (!left->ms.sym && !right->ms.sym) |
| 184 | return right->level - left->level; | 183 | return right->level - left->level; |
| 185 | 184 | ||
| 186 | if (!left->ms.sym || !right->ms.sym) | 185 | return _sort__sym_cmp(left->ms.sym, right->ms.sym); |
| 187 | return cmp_null(left->ms.sym, right->ms.sym); | ||
| 188 | |||
| 189 | if (left->ms.sym == right->ms.sym) | ||
| 190 | return 0; | ||
| 191 | |||
| 192 | ip_l = left->ms.sym->start; | ||
| 193 | ip_r = right->ms.sym->start; | ||
| 194 | |||
| 195 | return _sort__sym_cmp(left->ms.sym, right->ms.sym, ip_l, ip_r); | ||
| 196 | } | 186 | } |
| 197 | 187 | ||
| 198 | static int _hist_entry__sym_snprintf(struct map *map, struct symbol *sym, | 188 | static int _hist_entry__sym_snprintf(struct map *map, struct symbol *sym, |
| @@ -383,8 +373,7 @@ sort__sym_from_cmp(struct hist_entry *left, struct hist_entry *right) | |||
| 383 | if (!from_l->sym && !from_r->sym) | 373 | if (!from_l->sym && !from_r->sym) |
| 384 | return right->level - left->level; | 374 | return right->level - left->level; |
| 385 | 375 | ||
| 386 | return _sort__sym_cmp(from_l->sym, from_r->sym, from_l->addr, | 376 | return _sort__sym_cmp(from_l->sym, from_r->sym); |
| 387 | from_r->addr); | ||
| 388 | } | 377 | } |
| 389 | 378 | ||
| 390 | static int64_t | 379 | static int64_t |
| @@ -396,7 +385,7 @@ sort__sym_to_cmp(struct hist_entry *left, struct hist_entry *right) | |||
| 396 | if (!to_l->sym && !to_r->sym) | 385 | if (!to_l->sym && !to_r->sym) |
| 397 | return right->level - left->level; | 386 | return right->level - left->level; |
| 398 | 387 | ||
| 399 | return _sort__sym_cmp(to_l->sym, to_r->sym, to_l->addr, to_r->addr); | 388 | return _sort__sym_cmp(to_l->sym, to_r->sym); |
| 400 | } | 389 | } |
| 401 | 390 | ||
| 402 | static int hist_entry__sym_from_snprintf(struct hist_entry *self, char *bf, | 391 | static int hist_entry__sym_from_snprintf(struct hist_entry *self, char *bf, |
