aboutsummaryrefslogtreecommitdiffstats
path: root/tools/perf/util
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/util')
-rw-r--r--tools/perf/util/callchain.h6
-rw-r--r--tools/perf/util/hist.c3
-rw-r--r--tools/perf/util/session.c7
3 files changed, 14 insertions, 2 deletions
diff --git a/tools/perf/util/callchain.h b/tools/perf/util/callchain.h
index 1a79df9f739f..9b4ff16cac96 100644
--- a/tools/perf/util/callchain.h
+++ b/tools/perf/util/callchain.h
@@ -14,6 +14,11 @@ enum chain_mode {
14 CHAIN_GRAPH_REL 14 CHAIN_GRAPH_REL
15}; 15};
16 16
17enum chain_order {
18 ORDER_CALLER,
19 ORDER_CALLEE
20};
21
17struct callchain_node { 22struct callchain_node {
18 struct callchain_node *parent; 23 struct callchain_node *parent;
19 struct list_head siblings; 24 struct list_head siblings;
@@ -41,6 +46,7 @@ struct callchain_param {
41 u32 print_limit; 46 u32 print_limit;
42 double min_percent; 47 double min_percent;
43 sort_chain_func_t sort; 48 sort_chain_func_t sort;
49 enum chain_order order;
44}; 50};
45 51
46struct callchain_list { 52struct callchain_list {
diff --git a/tools/perf/util/hist.c b/tools/perf/util/hist.c
index 627a02e03c57..dae4202fa65a 100644
--- a/tools/perf/util/hist.c
+++ b/tools/perf/util/hist.c
@@ -14,7 +14,8 @@ enum hist_filter {
14 14
15struct callchain_param callchain_param = { 15struct callchain_param callchain_param = {
16 .mode = CHAIN_GRAPH_REL, 16 .mode = CHAIN_GRAPH_REL,
17 .min_percent = 0.5 17 .min_percent = 0.5,
18 .order = ORDER_CALLEE
18}; 19};
19 20
20u16 hists__col_len(struct hists *self, enum hist_column col) 21u16 hists__col_len(struct hists *self, enum hist_column col)
diff --git a/tools/perf/util/session.c b/tools/perf/util/session.c
index b723f211881c..558bcf996949 100644
--- a/tools/perf/util/session.c
+++ b/tools/perf/util/session.c
@@ -247,9 +247,14 @@ int perf_session__resolve_callchain(struct perf_session *self,
247 callchain_cursor_reset(&self->callchain_cursor); 247 callchain_cursor_reset(&self->callchain_cursor);
248 248
249 for (i = 0; i < chain->nr; i++) { 249 for (i = 0; i < chain->nr; i++) {
250 u64 ip = chain->ips[i]; 250 u64 ip;
251 struct addr_location al; 251 struct addr_location al;
252 252
253 if (callchain_param.order == ORDER_CALLEE)
254 ip = chain->ips[i];
255 else
256 ip = chain->ips[chain->nr - i - 1];
257
253 if (ip >= PERF_CONTEXT_MAX) { 258 if (ip >= PERF_CONTEXT_MAX) {
254 switch (ip) { 259 switch (ip) {
255 case PERF_CONTEXT_HV: 260 case PERF_CONTEXT_HV: