Talk:Kernel dynamic memory analysis

2012-10-05
Here is some feedback from testing on 2012-10-05:

These items are not in any order

Install issue
There's no 'install' mechanism for the tool, and the tool depends visualize_mem_tree.py being on the python path or in the same directory as the trace_analyze.py script. I tried hard-linking trace_analyze to a private 'bin' directory, but got a python error doing this. Using a symlink worked OK. If visualize_mem_tree.py is not used separately, it might be worth considering integrating everything into a single script. (or not - I'm not sure).

Extra rings
The chart for my kernel shows some unexpected rings. Specifically, I'm building in /home/tbird/work/mem/build/panda-torvalds My chart has an inner ring of 'build' (showing 100% of memory), a second ring of 'panda-torvalds' (showing 100% of memory), then a third ring where directories start to get broken out.

See this chart:

Is this correct?

Overlapping annotations
The annotations showing the name and size of the ring segments overlap sometimes, making some of them difficult or impossible to read. See above chart.

Availability to show plot interactively
The tool by default produces a png in the current directory. It would be nice to be able to control the output format and location, or allow the user to directly enter matplotlibs interactive viewer. (i.e. pylab.show).

Problem with absolute paths
I tried using the tool with an absolute path, and it had problems: $ trace_analyze.py -k /home/tbird/work/mem/build/panda-torvalds/ No trace log file specified: will report on static size only Reading symbol map at /home/tbird/work/mem/build/panda-torvalds Creating tree from compiled symbols at /home/tbird/work/mem/build/panda-torvalds readelf: Error: 'home/tbird/work/mem/build/panda-torvalds/.tmp_kallsyms1.o': No such file readelf: Error: 'home/tbird/work/mem/build/panda-torvalds/.tmp_kallsyms2.o': No such file ... [lots more 'No such file' errors]

Description of how to get trace
The instructions should includes steps for how to get the trace for the dynamic analysis. It looks like a comprehensive section is started in Documentation/memory_accounting section 3.2.1, so maybe this feedback is premature. Maybe a few short steps on the wiki page for people to get their first trace would be good.

Here's what I did: * cloned git repository * built kernel * generated first chart * ... [Tim needs to finish this list]