diff options
Diffstat (limited to 'tools/perf/util/sort.c')
-rw-r--r-- | tools/perf/util/sort.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/perf/util/sort.c b/tools/perf/util/sort.c index 313a5a730112..5f118a089519 100644 --- a/tools/perf/util/sort.c +++ b/tools/perf/util/sort.c | |||
@@ -7,6 +7,8 @@ const char default_parent_pattern[] = "^sys_|^do_page_fault"; | |||
7 | const char *parent_pattern = default_parent_pattern; | 7 | const char *parent_pattern = default_parent_pattern; |
8 | const char default_sort_order[] = "comm,dso,symbol"; | 8 | const char default_sort_order[] = "comm,dso,symbol"; |
9 | const char *sort_order = default_sort_order; | 9 | const char *sort_order = default_sort_order; |
10 | regex_t ignore_callees_regex; | ||
11 | int have_ignore_callees = 0; | ||
10 | int sort__need_collapse = 0; | 12 | int sort__need_collapse = 0; |
11 | int sort__has_parent = 0; | 13 | int sort__has_parent = 0; |
12 | int sort__has_sym = 0; | 14 | int sort__has_sym = 0; |
@@ -55,14 +57,14 @@ static int64_t cmp_null(void *l, void *r) | |||
55 | static int64_t | 57 | static int64_t |
56 | sort__thread_cmp(struct hist_entry *left, struct hist_entry *right) | 58 | sort__thread_cmp(struct hist_entry *left, struct hist_entry *right) |
57 | { | 59 | { |
58 | return right->thread->pid - left->thread->pid; | 60 | return right->thread->tid - left->thread->tid; |
59 | } | 61 | } |
60 | 62 | ||
61 | static int hist_entry__thread_snprintf(struct hist_entry *self, char *bf, | 63 | static int hist_entry__thread_snprintf(struct hist_entry *self, char *bf, |
62 | size_t size, unsigned int width) | 64 | size_t size, unsigned int width) |
63 | { | 65 | { |
64 | return repsep_snprintf(bf, size, "%*s:%5d", width - 6, | 66 | return repsep_snprintf(bf, size, "%*s:%5d", width - 6, |
65 | self->thread->comm ?: "", self->thread->pid); | 67 | self->thread->comm ?: "", self->thread->tid); |
66 | } | 68 | } |
67 | 69 | ||
68 | struct sort_entry sort_thread = { | 70 | struct sort_entry sort_thread = { |
@@ -77,7 +79,7 @@ struct sort_entry sort_thread = { | |||
77 | static int64_t | 79 | static int64_t |
78 | sort__comm_cmp(struct hist_entry *left, struct hist_entry *right) | 80 | sort__comm_cmp(struct hist_entry *left, struct hist_entry *right) |
79 | { | 81 | { |
80 | return right->thread->pid - left->thread->pid; | 82 | return right->thread->tid - left->thread->tid; |
81 | } | 83 | } |
82 | 84 | ||
83 | static int64_t | 85 | static int64_t |
@@ -872,6 +874,8 @@ static struct sort_dimension common_sort_dimensions[] = { | |||
872 | DIM(SORT_PARENT, "parent", sort_parent), | 874 | DIM(SORT_PARENT, "parent", sort_parent), |
873 | DIM(SORT_CPU, "cpu", sort_cpu), | 875 | DIM(SORT_CPU, "cpu", sort_cpu), |
874 | DIM(SORT_SRCLINE, "srcline", sort_srcline), | 876 | DIM(SORT_SRCLINE, "srcline", sort_srcline), |
877 | DIM(SORT_LOCAL_WEIGHT, "local_weight", sort_local_weight), | ||
878 | DIM(SORT_GLOBAL_WEIGHT, "weight", sort_global_weight), | ||
875 | }; | 879 | }; |
876 | 880 | ||
877 | #undef DIM | 881 | #undef DIM |
@@ -891,8 +895,6 @@ static struct sort_dimension bstack_sort_dimensions[] = { | |||
891 | #define DIM(d, n, func) [d - __SORT_MEMORY_MODE] = { .name = n, .entry = &(func) } | 895 | #define DIM(d, n, func) [d - __SORT_MEMORY_MODE] = { .name = n, .entry = &(func) } |
892 | 896 | ||
893 | static struct sort_dimension memory_sort_dimensions[] = { | 897 | static struct sort_dimension memory_sort_dimensions[] = { |
894 | DIM(SORT_LOCAL_WEIGHT, "local_weight", sort_local_weight), | ||
895 | DIM(SORT_GLOBAL_WEIGHT, "weight", sort_global_weight), | ||
896 | DIM(SORT_MEM_DADDR_SYMBOL, "symbol_daddr", sort_mem_daddr_sym), | 898 | DIM(SORT_MEM_DADDR_SYMBOL, "symbol_daddr", sort_mem_daddr_sym), |
897 | DIM(SORT_MEM_DADDR_DSO, "dso_daddr", sort_mem_daddr_dso), | 899 | DIM(SORT_MEM_DADDR_DSO, "dso_daddr", sort_mem_daddr_dso), |
898 | DIM(SORT_MEM_LOCKED, "locked", sort_mem_locked), | 900 | DIM(SORT_MEM_LOCKED, "locked", sort_mem_locked), |