lkml.org 
[lkml]   [2014]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 10/28] perf report: Cache cumulative callchains
Date
Hi Jiri,

Thanks for reminding me. :)

On Thu, 9 Jan 2014 19:06:28 +0100, Jiri Olsa wrote:
> On Wed, Jan 08, 2014 at 05:46:15PM +0900, Namhyung Kim wrote:

[SNIP]
>> + /*
>> + * Check if there's duplicate entries in the callchain.
>> + * It's possible that it has cycles or recursive calls.
>> + */
>> + for (i = 0; i < iter->curr; i++) {
>> + if (hist_entry__cmp(he_cache[i], &he_tmp) == 0)
>
> we need here:
> iter->he = he_cache[i];
>
>> + return 0;
>> + }
>
> otherwise iter->he and al are not in sync and
> hist_entry__inc_addr_samples fails in hist_iter_cb

Right. But the point of the he_cache is to skip duplicate entries. So
I'd like to change it like setting it to NULL and check it before the
callback function:

while (iter->next_entry(iter, al)) {
err = iter->add_next_entry(iter, al);
if (err)
break;

if (iter->he && iter->add_entry_cb) {
err = iter->add_entry_cb(iter, al, ...);
if (err)
break;
}
}

What do you think?

Thanks,
Namhyung


\
 
 \ /
  Last update: 2014-01-14 01:41    [W:0.107 / U:0.364 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site