]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/blobdiff - tools/perf/util/callchain.c
perf report: Add branch flag to callchain cursor node
[mirror_ubuntu-artful-kernel.git] / tools / perf / util / callchain.c
index 07fd30bc2f816feeda146fe98343f5ce408884e8..138a415fad0d9b15e1cdc2ef6b73eefb351753e0 100644 (file)
@@ -193,7 +193,6 @@ int perf_callchain_config(const char *var, const char *value)
 
        if (!strcmp(var, "record-mode"))
                return parse_callchain_record_opt(value, &callchain_param);
-#ifdef HAVE_DWARF_UNWIND_SUPPORT
        if (!strcmp(var, "dump-size")) {
                unsigned long size = 0;
                int ret;
@@ -203,7 +202,6 @@ int perf_callchain_config(const char *var, const char *value)
 
                return ret;
        }
-#endif
        if (!strcmp(var, "print-type"))
                return parse_callchain_mode(value);
        if (!strcmp(var, "order"))
@@ -730,7 +728,8 @@ merge_chain_branch(struct callchain_cursor *cursor,
 
        list_for_each_entry_safe(list, next_list, &src->val, list) {
                callchain_cursor_append(cursor, list->ip,
-                                       list->ms.map, list->ms.sym);
+                                       list->ms.map, list->ms.sym,
+                                       false, NULL, 0, 0);
                list_del(&list->list);
                free(list);
        }
@@ -767,7 +766,9 @@ int callchain_merge(struct callchain_cursor *cursor,
 }
 
 int callchain_cursor_append(struct callchain_cursor *cursor,
-                           u64 ip, struct map *map, struct symbol *sym)
+                           u64 ip, struct map *map, struct symbol *sym,
+                           bool branch, struct branch_flags *flags,
+                           int nr_loop_iter, int samples)
 {
        struct callchain_cursor_node *node = *cursor->last;
 
@@ -782,6 +783,13 @@ int callchain_cursor_append(struct callchain_cursor *cursor,
        node->ip = ip;
        node->map = map;
        node->sym = sym;
+       node->branch = branch;
+       node->nr_loop_iter = nr_loop_iter;
+       node->samples = samples;
+
+       if (flags)
+               memcpy(&node->branch_flags, flags,
+                       sizeof(struct branch_flags));
 
        cursor->nr++;