diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 4593f36ecc4c..09d4696fd9a1 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c @@ -89,14 +89,14 @@ static int64_t sort__comm_cmp(struct hist_entry *left, struct hist_entry *right) { /* Compare the addr that should be unique among comm */ - return comm__str(right->comm) - comm__str(left->comm); + return strcmp(comm__str(right->comm), comm__str(left->comm)); } static int64_t sort__comm_collapse(struct hist_entry *left, struct hist_entry *right) { /* Compare the addr that should be unique among comm */ - return comm__str(right->comm) - comm__str(left->comm); + return strcmp(comm__str(right->comm), comm__str(left->comm)); } static int64_t