lkml.org 
[lkml]   [2012]   [Nov]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 10/21] perf hists: Introduce hists__link
Date
On Fri,  9 Nov 2012 18:42:59 -0300, Arnaldo Carvalho de Melo wrote:
> From: Arnaldo Carvalho de Melo <acme@redhat.com>
>
> That given two hists will find the hist_entries (buckets) in the second
> hists that are for the same bucket in the first and link them, then it
> will look for all buckets in the second that don't have a counterpart in
> the first and will create a dummy counterpart that will then be linked
> to the entry in the second.
>
> For multiple events this will be done pairing the leader with all the
> other events in the group, so that in the end the leader will have all
> the buckets in all the hists in a group, dummy or not while the other
> hists will be left untouched.
[snip]
> + he = hist_entry__new(pair);
> + if (he) {
> + he->stat.nr_events = 0;
> + he->stat.period = 0;

What about other fields?
Why not use "memset(&he->stat, 0, sizeof(he->stat))" for this?

Thanks,
Namhyung


> + he->hists = hists;
> + rb_link_node(&he->rb_node, parent, p);
> + rb_insert_color(&he->rb_node, &hists->entries);
> + hists__inc_nr_entries(hists, he);
> + }
> +out:
> + return he;
> +}
> +


\
 
 \ /
  Last update: 2012-11-12 04:21    [W:0.142 / U:0.876 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site