|
@@ -356,12 +356,11 @@ static unsigned int annotate_browser__refresh(struct ui_browser *browser)
|
|
return ret;
|
|
return ret;
|
|
}
|
|
}
|
|
|
|
|
|
-static int disasm__cmp(struct annotation_line *a,
|
|
|
|
- struct annotation_line *b, int nr_pcnt)
|
|
|
|
|
|
+static int disasm__cmp(struct annotation_line *a, struct annotation_line *b)
|
|
{
|
|
{
|
|
int i;
|
|
int i;
|
|
|
|
|
|
- for (i = 0; i < nr_pcnt; i++) {
|
|
|
|
|
|
+ for (i = 0; i < a->samples_nr; i++) {
|
|
if (a->samples[i].percent == b->samples[i].percent)
|
|
if (a->samples[i].percent == b->samples[i].percent)
|
|
continue;
|
|
continue;
|
|
return a->samples[i].percent < b->samples[i].percent;
|
|
return a->samples[i].percent < b->samples[i].percent;
|
|
@@ -369,8 +368,7 @@ static int disasm__cmp(struct annotation_line *a,
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
-static void disasm_rb_tree__insert(struct rb_root *root, struct annotation_line *al,
|
|
|
|
- int nr_events)
|
|
|
|
|
|
+static void disasm_rb_tree__insert(struct rb_root *root, struct annotation_line *al)
|
|
{
|
|
{
|
|
struct rb_node **p = &root->rb_node;
|
|
struct rb_node **p = &root->rb_node;
|
|
struct rb_node *parent = NULL;
|
|
struct rb_node *parent = NULL;
|
|
@@ -380,7 +378,7 @@ static void disasm_rb_tree__insert(struct rb_root *root, struct annotation_line
|
|
parent = *p;
|
|
parent = *p;
|
|
l = rb_entry(parent, struct annotation_line, rb_node);
|
|
l = rb_entry(parent, struct annotation_line, rb_node);
|
|
|
|
|
|
- if (disasm__cmp(al, l, nr_events))
|
|
|
|
|
|
+ if (disasm__cmp(al, l))
|
|
p = &(*p)->rb_left;
|
|
p = &(*p)->rb_left;
|
|
else
|
|
else
|
|
p = &(*p)->rb_right;
|
|
p = &(*p)->rb_right;
|
|
@@ -452,7 +450,7 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
|
|
|
|
- for (i = 0; i < browser->nr_events; i++) {
|
|
|
|
|
|
+ for (i = 0; i < pos->al.samples_nr; i++) {
|
|
struct annotation_data *sample = &pos->al.samples[i];
|
|
struct annotation_data *sample = &pos->al.samples[i];
|
|
|
|
|
|
if (max_percent < sample->percent)
|
|
if (max_percent < sample->percent)
|
|
@@ -463,8 +461,7 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
|
|
RB_CLEAR_NODE(&pos->al.rb_node);
|
|
RB_CLEAR_NODE(&pos->al.rb_node);
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
- disasm_rb_tree__insert(&browser->entries, &pos->al,
|
|
|
|
- browser->nr_events);
|
|
|
|
|
|
+ disasm_rb_tree__insert(&browser->entries, &pos->al);
|
|
}
|
|
}
|
|
pthread_mutex_unlock(¬es->lock);
|
|
pthread_mutex_unlock(¬es->lock);
|
|
|
|
|