Calculating cumulative stack usage

From: Mel Gorman
Date: Thu May 20 2004 - 06:38:28 EST


I am not on the list at the moment or following the issues except on rare
occasions. I saw on LWN though that people were looking for an automatic
way of calculating cumulative stack usage. Codeviz
(http://www.csn.ul.ie/~mel/projects/codeviz) is able to do something like
this.

Without going into it in a lot of detail, it's a two stage process. Stack
usage is calculated at the same time as generating the call graph with
something like

genfull --pp-stack

Then to generate a call graph with cumulative usage, it would be something
like

gengraph -f somefunc
--pp-cstack="showcumulative=somefunc-someotherfunc,largeusage=3182"

This would generate a callgraph (in postscript) that showed the cumulative
usage in the bubbles between somefunc() and someotherfunc(). It had to be
between two functions because there was no easy way to calculate all
paths.

This would be a fairly manual process though and you would need to have an
idea of where large usage paths might be. However, as the amount of stack
every function uses is in the full.graph file, it would be possible to
identify canditates.

The documentation on how to do this is virtually non-existant because I
did not think there would be users of it but it can be written up.

--
Mel Gorman
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/