|
@@ -111,17 +111,20 @@ struct sort_entry sort_thread = {
|
|
|
|
|
|
/* --sort comm */
|
|
|
|
|
|
+/*
|
|
|
+ * We can't use pointer comparison in functions below,
|
|
|
+ * because it gives different results based on pointer
|
|
|
+ * values, which could break some sorting assumptions.
|
|
|
+ */
|
|
|
static int64_t
|
|
|
sort__comm_cmp(struct hist_entry *left, struct hist_entry *right)
|
|
|
{
|
|
|
- /* Compare the addr that should be unique among 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 strcmp(comm__str(right->comm), comm__str(left->comm));
|
|
|
}
|
|
|
|