|
@@ -1,5 +1,6 @@
|
|
|
#include "sort.h"
|
|
|
#include "hist.h"
|
|
|
+#include "comm.h"
|
|
|
#include "symbol.h"
|
|
|
|
|
|
regex_t parent_regex;
|
|
@@ -81,25 +82,20 @@ static int64_t
|
|
|
sort__comm_cmp(struct hist_entry *left, struct hist_entry *right)
|
|
|
{
|
|
|
/* Compare the addr that should be unique among comm */
|
|
|
- return thread__comm_str(right->thread) - thread__comm_str(left->thread);
|
|
|
+ return comm__str(right->comm) - comm__str(left->comm);
|
|
|
}
|
|
|
|
|
|
static int64_t
|
|
|
sort__comm_collapse(struct hist_entry *left, struct hist_entry *right)
|
|
|
{
|
|
|
- const char *comm_l = thread__comm_str(left->thread);
|
|
|
- const char *comm_r = thread__comm_str(right->thread);
|
|
|
-
|
|
|
- if (!comm_l || !comm_r)
|
|
|
- return cmp_null(comm_l, comm_r);
|
|
|
-
|
|
|
- return strcmp(comm_l, comm_r);
|
|
|
+ /* Compare the addr that should be unique among comm */
|
|
|
+ return comm__str(right->comm) - comm__str(left->comm);
|
|
|
}
|
|
|
|
|
|
static int hist_entry__comm_snprintf(struct hist_entry *he, char *bf,
|
|
|
size_t size, unsigned int width)
|
|
|
{
|
|
|
- return repsep_snprintf(bf, size, "%*s", width, thread__comm_str(he->thread));
|
|
|
+ return repsep_snprintf(bf, size, "%*s", width, comm__str(he->comm));
|
|
|
}
|
|
|
|
|
|
struct sort_entry sort_comm = {
|