|
@@ -15,6 +15,8 @@
|
|
#include <errno.h>
|
|
#include <errno.h>
|
|
#include <math.h>
|
|
#include <math.h>
|
|
|
|
|
|
|
|
+#include "asm/bug.h"
|
|
|
|
+
|
|
#include "hist.h"
|
|
#include "hist.h"
|
|
#include "util.h"
|
|
#include "util.h"
|
|
#include "sort.h"
|
|
#include "sort.h"
|
|
@@ -358,19 +360,14 @@ append_chain_children(struct callchain_node *root,
|
|
/* lookup in childrens */
|
|
/* lookup in childrens */
|
|
while (*p) {
|
|
while (*p) {
|
|
s64 ret;
|
|
s64 ret;
|
|
- struct callchain_list *cnode;
|
|
|
|
|
|
|
|
parent = *p;
|
|
parent = *p;
|
|
rnode = rb_entry(parent, struct callchain_node, rb_node_in);
|
|
rnode = rb_entry(parent, struct callchain_node, rb_node_in);
|
|
- cnode = list_first_entry(&rnode->val, struct callchain_list,
|
|
|
|
- list);
|
|
|
|
|
|
|
|
- /* just check first entry */
|
|
|
|
- ret = match_chain(node, cnode);
|
|
|
|
- if (ret == 0) {
|
|
|
|
- append_chain(rnode, cursor, period);
|
|
|
|
|
|
+ /* If at least first entry matches, rely to children */
|
|
|
|
+ ret = append_chain(rnode, cursor, period);
|
|
|
|
+ if (ret == 0)
|
|
goto inc_children_hit;
|
|
goto inc_children_hit;
|
|
- }
|
|
|
|
|
|
|
|
if (ret < 0)
|
|
if (ret < 0)
|
|
p = &parent->rb_left;
|
|
p = &parent->rb_left;
|
|
@@ -396,6 +393,7 @@ append_chain(struct callchain_node *root,
|
|
u64 start = cursor->pos;
|
|
u64 start = cursor->pos;
|
|
bool found = false;
|
|
bool found = false;
|
|
u64 matches;
|
|
u64 matches;
|
|
|
|
+ int cmp = 0;
|
|
|
|
|
|
/*
|
|
/*
|
|
* Lookup in the current node
|
|
* Lookup in the current node
|
|
@@ -410,7 +408,8 @@ append_chain(struct callchain_node *root,
|
|
if (!node)
|
|
if (!node)
|
|
break;
|
|
break;
|
|
|
|
|
|
- if (match_chain(node, cnode) != 0)
|
|
|
|
|
|
+ cmp = match_chain(node, cnode);
|
|
|
|
+ if (cmp)
|
|
break;
|
|
break;
|
|
|
|
|
|
found = true;
|
|
found = true;
|
|
@@ -420,9 +419,10 @@ append_chain(struct callchain_node *root,
|
|
|
|
|
|
/* matches not, relay no the parent */
|
|
/* matches not, relay no the parent */
|
|
if (!found) {
|
|
if (!found) {
|
|
|
|
+ WARN_ONCE(!cmp, "Chain comparison error\n");
|
|
cursor->curr = curr_snap;
|
|
cursor->curr = curr_snap;
|
|
cursor->pos = start;
|
|
cursor->pos = start;
|
|
- return -1;
|
|
|
|
|
|
+ return cmp;
|
|
}
|
|
}
|
|
|
|
|
|
matches = cursor->pos - start;
|
|
matches = cursor->pos - start;
|