lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAM9d7chA2WZ-=Z+9C7Vr9eLEOPPPnXvdq=30Am7mBShbcgrUvw@mail.gmail.com>
Date:   Tue, 20 Sep 2016 10:10:52 +0900
From:   Namhyung Kim <namhyung@...nel.org>
To:     Jiri Olsa <jolsa@...hat.com>
Cc:     Arnaldo Carvalho de Melo <acme@...nel.org>,
        Ingo Molnar <mingo@...nel.org>,
        Peter Zijlstra <a.p.zijlstra@...llo.nl>,
        Jiri Olsa <jolsa@...nel.org>,
        LKML <linux-kernel@...r.kernel.org>,
        Andi Kleen <andi@...stfloor.org>
Subject: Re: [PATCH 1/7] perf hist: Introduce hists__match_hierarchy()

Hi Jiri,

On Mon, Sep 19, 2016 at 4:48 PM, Jiri Olsa <jolsa@...hat.com> wrote:
> On Tue, Sep 13, 2016 at 04:45:46PM +0900, Namhyung Kim wrote:
>
> SNIP
>
>> +static struct hist_entry *hists__find_hierarchy_entry(struct rb_root *root,
>> +                                                   struct hist_entry *he)
>> +{
>> +     struct rb_node *n = root->rb_node;
>> +
>> +     while (n) {
>> +             struct hist_entry *iter;
>> +             struct perf_hpp_fmt *fmt;
>> +             int64_t cmp = 0;
>> +
>> +             iter = rb_entry(n, struct hist_entry, rb_node_in);
>> +             perf_hpp_list__for_each_sort_list(he->hpp_list, fmt) {
>> +                     cmp = fmt->collapse(fmt, iter, he);
>> +                     if (cmp)
>> +                             break;
>> +             }
>
> could you call hist_entry__collapse in here instead of above code?

Nope.  The hist_entry__collapse() traverses the whole sort list of the
event (hists->hpp_list) while this function only traverses its own
sort list (he->hpp_list).  These are different when hierarchy is used.

Thanks,
Namhyung

>
>> +
>> +             if (cmp < 0)
>> +                     n = n->rb_left;
>> +             else if (cmp > 0)
>> +                     n = n->rb_right;
>> +             else
>> +                     return iter;
>> +     }
>> +
>> +     return NULL;
>> +}
>> +



-- 
Thanks,
Namhyung

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ