|
From: Josef W. <Jos...@gm...> - 2004-03-23 12:00:31
|
On Monday 22 March 2004 21:03, Avery Pennarun wrote:
> On Mon, Mar 22, 2004 at 06:54:58PM +0100, Josef Weidendorfer wrote:
> > Another important issue: KCachegrind still isn't able to show different
> > call contexts of a function. But this is on my TODO list...
>
> I'm not sure I understand. If a calls c, and b calls c, and c allocates
> memory, then I think the memory should be accounted in exactly the same way
> as kcachegrind accounts CPU time. That is, memory allocated by c, when
> called from a, should be accounted to both c ("self") *and* a ("incl.").
> Then we can draw it in *exactly* the way kcachegrind already draws all its
> usage graphs. Right?
Oh, yes.
I think massif provides "self costs" for allocations attributed to allocation
contexts, which includes some call chain information. In contrast,
KCachegrind needs inclusive cost provided by the tool. So the conversion
would have to calculate inclusive costs from the self cost of contexts.
So if we name the context "c called from a" c'a, we have for example
provided by massif:
Type "Bytes Allocated": for a'c: 1000, for b'c: 20000
The conversion should produce data:
Self cost of c: 21000, cost of call from a to c: 1000, from b to c: 20000.
Another thing: doesn't massif provide the difference "Allocated" -
"Deallocated"? I'm not quite sure how to handle this.
Josef
>
> Thanks,
>
> Avery
|