aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2017-02-16 13:51:27 -0500
committerThomas Gleixner <tglx@linutronix.de>2017-02-16 13:51:27 -0500
commit5b1ad68f9b1951ef78312d2935906cc8a8bd2e12 (patch)
treee81b71c961e885cef0d3992e083acec845166870 /tools/perf
parent1013fe32a63d1139b1b32049ea46c0c462738d8b (diff)
parent7089db84e356562f8ba737c29e472cc42d530dbc (diff)
Merge branch 'linus' into x86/mm
Make sure to get the latest fixes before applying the ptdump enhancements.
Diffstat (limited to 'tools/perf')
-rw-r--r--tools/perf/builtin-diff.c2
-rw-r--r--tools/perf/ui/hist.c10
-rw-r--r--tools/perf/util/callchain.c11
-rw-r--r--tools/perf/util/callchain.h6
-rw-r--r--tools/perf/util/hist.c7
-rw-r--r--tools/perf/util/hist.h7
6 files changed, 40 insertions, 3 deletions
diff --git a/tools/perf/builtin-diff.c b/tools/perf/builtin-diff.c
index 9ff0db4e2d0c..933aeec46f4a 100644
--- a/tools/perf/builtin-diff.c
+++ b/tools/perf/builtin-diff.c
@@ -1199,7 +1199,7 @@ static int ui_init(void)
1199 BUG_ON(1); 1199 BUG_ON(1);
1200 } 1200 }
1201 1201
1202 perf_hpp__register_sort_field(fmt); 1202 perf_hpp__prepend_sort_field(fmt);
1203 return 0; 1203 return 0;
1204} 1204}
1205 1205
diff --git a/tools/perf/ui/hist.c b/tools/perf/ui/hist.c
index 37388397b5bc..18cfcdc90356 100644
--- a/tools/perf/ui/hist.c
+++ b/tools/perf/ui/hist.c
@@ -521,6 +521,12 @@ void perf_hpp_list__register_sort_field(struct perf_hpp_list *list,
521 list_add_tail(&format->sort_list, &list->sorts); 521 list_add_tail(&format->sort_list, &list->sorts);
522} 522}
523 523
524void perf_hpp_list__prepend_sort_field(struct perf_hpp_list *list,
525 struct perf_hpp_fmt *format)
526{
527 list_add(&format->sort_list, &list->sorts);
528}
529
524void perf_hpp__column_unregister(struct perf_hpp_fmt *format) 530void perf_hpp__column_unregister(struct perf_hpp_fmt *format)
525{ 531{
526 list_del(&format->list); 532 list_del(&format->list);
@@ -560,6 +566,10 @@ void perf_hpp__setup_output_field(struct perf_hpp_list *list)
560 perf_hpp_list__for_each_sort_list(list, fmt) { 566 perf_hpp_list__for_each_sort_list(list, fmt) {
561 struct perf_hpp_fmt *pos; 567 struct perf_hpp_fmt *pos;
562 568
569 /* skip sort-only fields ("sort_compute" in perf diff) */
570 if (!fmt->entry && !fmt->color)
571 continue;
572
563 perf_hpp_list__for_each_format(list, pos) { 573 perf_hpp_list__for_each_format(list, pos) {
564 if (fmt_equal(fmt, pos)) 574 if (fmt_equal(fmt, pos))
565 goto next; 575 goto next;
diff --git a/tools/perf/util/callchain.c b/tools/perf/util/callchain.c
index 42922512c1c6..8b610dd9e2f6 100644
--- a/tools/perf/util/callchain.c
+++ b/tools/perf/util/callchain.c
@@ -437,7 +437,7 @@ fill_node(struct callchain_node *node, struct callchain_cursor *cursor)
437 } 437 }
438 call->ip = cursor_node->ip; 438 call->ip = cursor_node->ip;
439 call->ms.sym = cursor_node->sym; 439 call->ms.sym = cursor_node->sym;
440 call->ms.map = cursor_node->map; 440 call->ms.map = map__get(cursor_node->map);
441 441
442 if (cursor_node->branch) { 442 if (cursor_node->branch) {
443 call->branch_count = 1; 443 call->branch_count = 1;
@@ -477,6 +477,7 @@ add_child(struct callchain_node *parent,
477 477
478 list_for_each_entry_safe(call, tmp, &new->val, list) { 478 list_for_each_entry_safe(call, tmp, &new->val, list) {
479 list_del(&call->list); 479 list_del(&call->list);
480 map__zput(call->ms.map);
480 free(call); 481 free(call);
481 } 482 }
482 free(new); 483 free(new);
@@ -761,6 +762,7 @@ merge_chain_branch(struct callchain_cursor *cursor,
761 list->ms.map, list->ms.sym, 762 list->ms.map, list->ms.sym,
762 false, NULL, 0, 0); 763 false, NULL, 0, 0);
763 list_del(&list->list); 764 list_del(&list->list);
765 map__zput(list->ms.map);
764 free(list); 766 free(list);
765 } 767 }
766 768
@@ -811,7 +813,8 @@ int callchain_cursor_append(struct callchain_cursor *cursor,
811 } 813 }
812 814
813 node->ip = ip; 815 node->ip = ip;
814 node->map = map; 816 map__zput(node->map);
817 node->map = map__get(map);
815 node->sym = sym; 818 node->sym = sym;
816 node->branch = branch; 819 node->branch = branch;
817 node->nr_loop_iter = nr_loop_iter; 820 node->nr_loop_iter = nr_loop_iter;
@@ -1142,11 +1145,13 @@ static void free_callchain_node(struct callchain_node *node)
1142 1145
1143 list_for_each_entry_safe(list, tmp, &node->parent_val, list) { 1146 list_for_each_entry_safe(list, tmp, &node->parent_val, list) {
1144 list_del(&list->list); 1147 list_del(&list->list);
1148 map__zput(list->ms.map);
1145 free(list); 1149 free(list);
1146 } 1150 }
1147 1151
1148 list_for_each_entry_safe(list, tmp, &node->val, list) { 1152 list_for_each_entry_safe(list, tmp, &node->val, list) {
1149 list_del(&list->list); 1153 list_del(&list->list);
1154 map__zput(list->ms.map);
1150 free(list); 1155 free(list);
1151 } 1156 }
1152 1157
@@ -1210,6 +1215,7 @@ int callchain_node__make_parent_list(struct callchain_node *node)
1210 goto out; 1215 goto out;
1211 *new = *chain; 1216 *new = *chain;
1212 new->has_children = false; 1217 new->has_children = false;
1218 map__get(new->ms.map);
1213 list_add_tail(&new->list, &head); 1219 list_add_tail(&new->list, &head);
1214 } 1220 }
1215 parent = parent->parent; 1221 parent = parent->parent;
@@ -1230,6 +1236,7 @@ int callchain_node__make_parent_list(struct callchain_node *node)
1230out: 1236out:
1231 list_for_each_entry_safe(chain, new, &head, list) { 1237 list_for_each_entry_safe(chain, new, &head, list) {
1232 list_del(&chain->list); 1238 list_del(&chain->list);
1239 map__zput(chain->ms.map);
1233 free(chain); 1240 free(chain);
1234 } 1241 }
1235 return -ENOMEM; 1242 return -ENOMEM;
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
index 35c8e379530f..4f4b60f1558a 100644
--- a/tools/perf/util/callchain.h
+++ b/tools/perf/util/callchain.h
@@ -5,6 +5,7 @@
5#include <linux/list.h> 5#include <linux/list.h>
6#include <linux/rbtree.h> 6#include <linux/rbtree.h>
7#include "event.h" 7#include "event.h"
8#include "map.h"
8#include "symbol.h" 9#include "symbol.h"
9 10
10#define HELP_PAD "\t\t\t\t" 11#define HELP_PAD "\t\t\t\t"
@@ -184,8 +185,13 @@ int callchain_merge(struct callchain_cursor *cursor,
184 */ 185 */
185static inline void callchain_cursor_reset(struct callchain_cursor *cursor) 186static inline void callchain_cursor_reset(struct callchain_cursor *cursor)
186{ 187{
188 struct callchain_cursor_node *node;
189
187 cursor->nr = 0; 190 cursor->nr = 0;
188 cursor->last = &cursor->first; 191 cursor->last = &cursor->first;
192
193 for (node = cursor->first; node != NULL; node = node->next)
194 map__zput(node->map);
189} 195}
190 196
191int callchain_cursor_append(struct callchain_cursor *cursor, u64 ip, 197int callchain_cursor_append(struct callchain_cursor *cursor, u64 ip,
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 6770a9645609..7d1b7d33e644 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -1,6 +1,7 @@
1#include "util.h" 1#include "util.h"
2#include "build-id.h" 2#include "build-id.h"
3#include "hist.h" 3#include "hist.h"
4#include "map.h"
4#include "session.h" 5#include "session.h"
5#include "sort.h" 6#include "sort.h"
6#include "evlist.h" 7#include "evlist.h"
@@ -1019,6 +1020,10 @@ int hist_entry_iter__add(struct hist_entry_iter *iter, struct addr_location *al,
1019 int max_stack_depth, void *arg) 1020 int max_stack_depth, void *arg)
1020{ 1021{
1021 int err, err2; 1022 int err, err2;
1023 struct map *alm = NULL;
1024
1025 if (al && al->map)
1026 alm = map__get(al->map);
1022 1027
1023 err = sample__resolve_callchain(iter->sample, &callchain_cursor, &iter->parent, 1028 err = sample__resolve_callchain(iter->sample, &callchain_cursor, &iter->parent,
1024 iter->evsel, al, max_stack_depth); 1029 iter->evsel, al, max_stack_depth);
@@ -1058,6 +1063,8 @@ out:
1058 if (!err) 1063 if (!err)
1059 err = err2; 1064 err = err2;
1060 1065
1066 map__put(alm);
1067
1061 return err; 1068 return err;
1062} 1069}
1063 1070
diff --git a/tools/perf/util/hist.h b/tools/perf/util/hist.h
index d4b6514eeef5..28c216e3d5b7 100644
--- a/tools/perf/util/hist.h
+++ b/tools/perf/util/hist.h
@@ -283,6 +283,8 @@ void perf_hpp_list__column_register(struct perf_hpp_list *list,
283 struct perf_hpp_fmt *format); 283 struct perf_hpp_fmt *format);
284void perf_hpp_list__register_sort_field(struct perf_hpp_list *list, 284void perf_hpp_list__register_sort_field(struct perf_hpp_list *list,
285 struct perf_hpp_fmt *format); 285 struct perf_hpp_fmt *format);
286void perf_hpp_list__prepend_sort_field(struct perf_hpp_list *list,
287 struct perf_hpp_fmt *format);
286 288
287static inline void perf_hpp__column_register(struct perf_hpp_fmt *format) 289static inline void perf_hpp__column_register(struct perf_hpp_fmt *format)
288{ 290{
@@ -294,6 +296,11 @@ static inline void perf_hpp__register_sort_field(struct perf_hpp_fmt *format)
294 perf_hpp_list__register_sort_field(&perf_hpp_list, format); 296 perf_hpp_list__register_sort_field(&perf_hpp_list, format);
295} 297}
296 298
299static inline void perf_hpp__prepend_sort_field(struct perf_hpp_fmt *format)
300{
301 perf_hpp_list__prepend_sort_field(&perf_hpp_list, format);
302}
303
297#define perf_hpp_list__for_each_format(_list, format) \ 304#define perf_hpp_list__for_each_format(_list, format) \
298 list_for_each_entry(format, &(_list)->fields, list) 305 list_for_each_entry(format, &(_list)->fields, list)
299 306