chromiumos/platform/mem_report.git
20 months agoAdded SelfMemUse() master
thiagog [Wed, 18 Jul 2012 20:34:13 +0000 (13:34 -0700)]
Added SelfMemUse()

BUG=None
TEST=None

SelfMemUse was added in order to monitor the memory consumption of the
script itself

Change-Id: I49c577de732b9886c142ce2b6cacf6ff222c8571
Signed-off-by: Thiago Goncales <thiagog@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/27801
Reviewed-by: Grant Grundler <grundler@chromium.org>
20 months agoMerge "Improved ProcSnaphot.getSingleChromeType()"
Gerrit [Wed, 18 Jul 2012 23:25:59 +0000 (16:25 -0700)]
Merge "Improved ProcSnaphot.getSingleChromeType()"

20 months agoMerge "Added more types of memory data to html_args"
Gerrit [Wed, 18 Jul 2012 21:02:45 +0000 (14:02 -0700)]
Merge "Added more types of memory data to html_args"

20 months agoImproved ProcSnaphot.getSingleChromeType() 25/27725/2
thiagog [Tue, 17 Jul 2012 21:22:09 +0000 (14:22 -0700)]
Improved ProcSnaphot.getSingleChromeType()

BUG=None
TEST=Manual

- getSingleChromeType now account for some processes that did not have a
  cmdline file formatted properly as the rest, such as some zygotes
  processes

Change-Id: I40e5095affcc90c1c07a3794c1a020742bde9a5d
Signed-off-by: Thiago Goncales <thiagog@chromium.org>
21 months agoTimelogtemplate displays multiple graph types on one page using function 67/27667/2
Amy Zhang [Tue, 17 Jul 2012 18:04:28 +0000 (11:04 -0700)]
Timelogtemplate displays multiple graph types on one page using function

RSS, PSS, Private, Shared, Private Clean, Private Dirty, Shared Clean,
Shared Dirty, Referenced, and Anonymous

BUG=none
TEST=manual

Signed-off-by: Amy Zhang <ayzhang@chromium.org>
Change-Id: I1917d36eddae5eaac7742da10af4a3de2d87f097

21 months agoAdded more types of memory data to html_args 24/27724/1
thiagog [Tue, 17 Jul 2012 17:36:24 +0000 (10:36 -0700)]
Added more types of memory data to html_args

BUG=None
TEST=Manual

Change-Id: I831fd1148fcf7b79348784df8c2b4733ca6177c7
Signed-off-by: Thiago Goncales <thiagog@chromium.org>
21 months agoMerge "Timelogtemplate displays two graphs on same page - RSS and PSS"
Gerrit [Mon, 16 Jul 2012 20:37:48 +0000 (13:37 -0700)]
Merge "Timelogtemplate displays two graphs on same page - RSS and PSS"

21 months agoBetter rounding to mBs + multiple graphs support 10/27510/2
Thiago Goncales [Mon, 16 Jul 2012 17:15:59 +0000 (10:15 -0700)]
Better rounding to mBs + multiple graphs support

BUG=None
TEST=Manual

- Using round() to get  mBs to one decimal point
- logtime graphs now allow for multiple graphs data be collected at
  once. To match the template changes,'title' and 'vaxis' are now gone.
- Added exception to getSystemParameters() to account for weird lines in
  lsb-release
- System information now formatted properly + field 'release' now added
  to html_args

Change-Id: I644d9ebfa1071f51fd947d07dbed44700a988344
Signed-off-by: Thiago Goncales <thiagog@chromium.org>
21 months agoTimelogtemplate displays two graphs on same page - RSS and PSS 17/27517/1
Amy Zhang [Mon, 16 Jul 2012 18:29:27 +0000 (11:29 -0700)]
Timelogtemplate displays two graphs on same page - RSS and PSS

BUG=none
TEST=manual

Change-Id: I39a993c9425a1e12cf6e462cb3388d5570550e3a
Signed-off-by: Amy Zhang <ayzhang@chromium.org>
21 months agoMerge changes Ia9e51df3,I8ffca626
Gerrit [Mon, 16 Jul 2012 15:50:28 +0000 (08:50 -0700)]
Merge changes Ia9e51df3,I8ffca626

* changes:
  Private + shared fields available on Smaps; Graphing fcns renamed
  GPU support + system information + Timestamp since boot

21 months agoMerge "README updated, changed "locked" to "Locked" in references"
Gerrit [Sat, 14 Jul 2012 00:59:05 +0000 (17:59 -0700)]
Merge "README updated, changed "locked" to "Locked" in references"

21 months agoREADME updated, changed "locked" to "Locked" in references 78/27378/2
Amy Zhang [Thu, 12 Jul 2012 20:14:33 +0000 (13:14 -0700)]
README updated, changed "locked" to "Locked" in references

Added general descriptions of files in mem_report package to the README

BUG=none
TEST=manual

Change-Id: Ie060fc25b49ec5c4e707f2512277e7b4e000c882
Signed-off-by: Amy Zhang <ayzhang@chromium.org>
21 months agoPrivate + shared fields available on Smaps; Graphing fcns renamed 88/27388/1
Thiago Goncales [Fri, 13 Jul 2012 00:11:34 +0000 (17:11 -0700)]
Private + shared fields available on Smaps; Graphing fcns renamed

BUG=None
TEST=Manual

- 'Private' and 'Shared' fields are now available on Smaps directly.
  graphlop.py was updated accordingly.
- Renamed graphing functions to better reflect their purpose

Change-Id: Ia9e51df3b94178d9f3d5a4133434f1a9a394bbd0
Signed-off-by: Thiago Goncales <thiagog@chromium.org>
21 months agoGPU support + system information + Timestamp since boot 87/27387/1
Thiago Goncales [Thu, 12 Jul 2012 18:47:59 +0000 (11:47 -0700)]
GPU support + system information + Timestamp since boot

BUG=None
TEST=Manual

- Graphs now display GPU memory usage
- Graphs now can have display system information (still not decided on
  how to best do so)
- Timestamp now shows the seconds passed since boot time

Change-Id: I8ffca626e09538305469520efdd8cdd66390e4f0
Signed-off-by: Thiago Goncales <thiagog@chromium.org>
21 months agoModified grapher.py for new template names, added template error. 77/27377/1
Amy Zhang [Fri, 13 Jul 2012 18:20:31 +0000 (11:20 -0700)]
Modified grapher.py for new template names, added template error.

Grapher.py works with the modified graph template file names.

If the none of the 3 predetermined templates exist in the user's current
directory, the program exits with a system error message.

BUG=none
TEST=manual

Change-Id: Ib79772e3c8df86b3c730736de87c36eed637162d
Signed-off-by: Amy Zhang <ayzhang@chromium.org>
21 months agoRenamed line, pie, bar graph templates to reflect functionality 76/27376/1
Amy Zhang [Fri, 13 Jul 2012 18:18:23 +0000 (11:18 -0700)]
Renamed line, pie, bar graph templates to reflect functionality

BUG=none
TEST=manual

Change-Id: Ibcf162ad42c0d31be0ccb58d86419249fe54a260
Signed-off-by: Amy Zhang <ayzhang@chromium.org>
21 months agoTemplates prepared for meta data and log start time 36/27236/2
Amy Zhang [Thu, 12 Jul 2012 00:59:03 +0000 (17:59 -0700)]
Templates prepared for meta data and log start time

Meta data will replace variable %(version)s, log start time replaces
%(timestamp)s

BUG=none
TEST=manual

Change-Id: I6badc29d81d287a5ba17aca76b97bda9d962222f
Signed-off-by: Amy Zhang <ayzhang@chromium.org>
21 months agoMerge "Class Smaps now tracks memory in executable pages"
Gerrit [Thu, 12 Jul 2012 00:50:06 +0000 (17:50 -0700)]
Merge "Class Smaps now tracks memory in executable pages"

21 months agoMerge "Updated and reformatted references, added meminfo"
Gerrit [Thu, 12 Jul 2012 00:50:05 +0000 (17:50 -0700)]
Merge "Updated and reformatted references, added meminfo"

21 months agoUpdated and reformatted references, added meminfo 09/27209/1
Amy Zhang [Wed, 11 Jul 2012 22:14:13 +0000 (15:14 -0700)]
Updated and reformatted references, added meminfo

Added information on smaps found from Linux's
Documentation/filesystems/proc.txt.

Moved pagemap data into the /proc/<pid>/maps section

Added documentation on fields in /proc/meminfo

BUG=none
TEST=manual

Change-Id: If5af5ad34aba3d472d51fa709d737bd7e899a52f
Signed-off-by: Amy Zhang <ayzhang@chromium.org>
21 months agoClass Smaps now tracks memory in executable pages 48/27048/8
Thiago Goncales [Tue, 10 Jul 2012 17:47:41 +0000 (10:47 -0700)]
Class Smaps now tracks memory in executable pages

BUG=None
TEST=Manual

- Smaps.exec_mem is a dictionary that holds how much memory there are in
executable pages in /proc/<pid>/smaps, per pid and in total.
- ProcSnapshot.timestamp now captured through time.time()
- ProcSnapshot.getProcTypes() and .getSingleProcType() renamed to
  .getChromeTypes and .getSingleChromeType()
- ProcSnapshot.getChromeTypes() now distinguishes between browser and
  sandbox processes

Change-Id: I9718095bb5d5e34612e5fbcd30954739e93adc68
Signed-off-by: Thiago Goncales <thiagog@chromium.org>
21 months agoMerge "Creates unique graph file names, updated docstring, system exit on error"
Gerrit [Wed, 11 Jul 2012 18:35:03 +0000 (11:35 -0700)]
Merge "Creates unique graph file names, updated docstring, system exit on error"

21 months agoMerge "Added data formatting functions for bar and pie graphs"
Gerrit [Wed, 11 Jul 2012 18:35:03 +0000 (11:35 -0700)]
Merge "Added data formatting functions for bar and pie graphs"

21 months agoAdded data formatting functions for bar and pie graphs 78/26978/5
Thiago Goncales [Mon, 9 Jul 2012 22:33:52 +0000 (15:33 -0700)]
Added data formatting functions for bar and pie graphs

BUG=None
TEST=None

- Added option -g/--graph
- cleaned obsolete comments
- renamed setDataTable() to setLineDataTable()
- added setPieDataTable() and setBarDataTable()
- added timestamp field to html_args
- timestamps on linegraph are now referent to first snapshot taken
- values in linegraph are now in mBs
- pid values now have type as well in linegraph

Change-Id: I98439441691c9115dae944ff0d11a7079c01c248
Signed-off-by: Thiago Goncales <thiagog@chromium.org>
21 months agoCreates unique graph file names, updated docstring, system exit on error 81/27081/1
Amy Zhang [Tue, 10 Jul 2012 18:03:33 +0000 (11:03 -0700)]
Creates unique graph file names, updated docstring, system exit on error

Graph file names are made using the type of graph + timestamp.
chooseGraph() docstring now contains details on the format of graphdata.
Instead of returning a string error message, system now exits on user
input error.

BUG=none
TEST=manual

Change-Id: Ifbef935765b6655f0d646061bfb7c42b4ecd81e4
Signed-off-by: Amy Zhang <ayzhang@chromium.org>
21 months agoFixing typo in piegraphtemplate, add vaxis label in bargraphtemplate 45/27045/2
Amy Zhang [Tue, 10 Jul 2012 17:23:01 +0000 (10:23 -0700)]
Fixing typo in piegraphtemplate, add vaxis label in bargraphtemplate

piegraphtemplate now actually makes a pie graph instead of a bar graph.
bargraphtemplate has a fixed vaxis label instead of a variable one.

BUG=none
TEST=manual

Change-Id: I2aff80aca19aae70a344baf1d13fe69de404e082
Signed-off-by: Amy Zhang <ayzhang@chromium.org>
21 months agoModified grapher.py to work with formatted data and new templates. 45/26745/3
Amy Zhang [Wed, 4 Jul 2012 00:20:27 +0000 (17:20 -0700)]
Modified grapher.py to work with formatted data and new templates.

Grapher.py can now create 3 different types of graphs.
Currently only the line graph has been tested using graphlog.py.

Templates are predefined and limited in selection to ensure proper
format and assumed to be in the same directory as the one grapher.py is
run from.

Main function calls testgraph(), allowing for singular testing of this
script. Pre-parsed data is passed in through the commandline.

BUG=none
TEST=manual

Change-Id: I5b200b1811a999d83a30c25d82531887dd68adbc
Signed-off-by: Amy Zhang <ayzhang@chromium.org>
21 months agoMerge "graphlog.py compatible with memreport.py classes, added setDataTable(), getUni...
Gerrit [Mon, 9 Jul 2012 17:27:00 +0000 (10:27 -0700)]
Merge "graphlog.py compatible with memreport.py classes, added setDataTable(), getUniquePidsList(), creates line graphs"

21 months agoAdding bar, pie, and line HTML graph template files. 41/26741/1
Amy Zhang [Wed, 4 Jul 2012 00:06:27 +0000 (17:06 -0700)]
Adding bar, pie, and line HTML graph template files.

BUG=none
TEST=manual

Change-Id: I1b1b786a822930a0079b7171c507a443d6ceb906
Signed-off-by: Amy Zhang <ayzhang@chromium.org>
21 months agographlog.py compatible with memreport.py classes, added setDataTable(), 91/26691/4
Thiago Goncales [Tue, 3 Jul 2012 18:04:04 +0000 (11:04 -0700)]
graphlog.py compatible with memreport.py classes, added setDataTable(),
getUniquePidsList(), creates line graphs

BUG=None
TEST=Manual

- Added custom proc directory option
- Print statements are there in order to verify its functionality
- graphlog.py now can create line graphs using grapher.py
- Docstrings added

Change-Id: I81c9687b14554c38d4e848f3b50bf5c439f99eab
Signed-off-by: Thiago Goncales <thiagog@chromium.org>
21 months agoRemoving pizzatest.html and testtemplate.html 39/26739/1
Amy Zhang [Tue, 3 Jul 2012 23:48:40 +0000 (16:48 -0700)]
Removing pizzatest.html and testtemplate.html

These files are no longer relevant. They are being removed in
preperation for the upload of the actual graph templates.

BUG=none
TEST=manual

Change-Id: Iaf34ff4c2eb457eaf3448e652a93921f7d959909
Signed-off-by: Amy Zhang <ayzhang@chromium.org>
21 months agoMerge "New script grapher() for writing HTML graph producing file + test files"
Gerrit [Tue, 3 Jul 2012 22:16:16 +0000 (15:16 -0700)]
Merge "New script grapher() for writing HTML graph producing file + test files"

21 months agoNew script grapher() for writing HTML graph producing file + test files 59/26159/4
Amy Zhang [Tue, 26 Jun 2012 23:28:42 +0000 (16:28 -0700)]
New script grapher() for writing HTML graph producing file + test files

pizzatest.html consists of the resulting pie graph.
testtemplate.html is the Google Chart Tool template used to create pie graph.

BUG=none
TEST=manual

Change-Id: I39d76f752c406e28b9b76966757b55b4b299cddf
Signed-off-by: Amy Zhang <ayzhang@chromium.org>
21 months agoScript put into classes for easier usage 31/26331/4
Thiago Goncales [Thu, 28 Jun 2012 23:21:42 +0000 (16:21 -0700)]
Script put into classes for easier usage

BUG=None
TEST=Manual

- Functions now turned into methods and grouped inside classes.
- Class ProcSnapshot now gathers all the information required by the
  script and has a way of easy output them
- Information from several forms of memory accounting now can be found
  in Smaps, MemInfo and GPUMem classes
- Added time stamp inside ProcSnapshot()
- Added getGPUMem(), getMemInfo() and getProcTypes inside
  ProcSnapshot.__init__(). Now, this information is captured automatically

Change-Id: I4fdf7b38f6d428b05dda5fd584f0ed743dbd3b36
Signed-off-by: Thiago Goncales <thiagog@chromium.org>
21 months agoAccounting for GPU graphics memory 30/26330/2
Thiago Goncales [Thu, 28 Jun 2012 18:27:21 +0000 (11:27 -0700)]
Accounting for GPU graphics memory
+ renamed file to comply with python guidelines

BUG=None
TEST=Manual

Signed-off-by: Thiago Goncales <thiagog@google.com>
Change-Id: Icbf04661aa35a420ee45dbd380c5bbc5520ec380

21 months agoMerge changes Ibe67598f,I27b21c5b
Gerrit [Wed, 27 Jun 2012 00:02:39 +0000 (17:02 -0700)]
Merge changes Ibe67598f,I27b21c5b

* changes:
  Changed graphlog() docstrings to adhere to Python style guide.
  Renamed mem_log.py to graphlog.py

21 months agoChanged graphlog() docstrings to adhere to Python style guide. 50/26150/1
Amy Zhang [Tue, 26 Jun 2012 22:40:53 +0000 (15:40 -0700)]
Changed graphlog() docstrings to adhere to Python style guide.

BUG=none
TEST=manual

Change-Id: Ibe67598fb83d12d8c24b56e19b38a97a27f682eb
Signed-off-by: Amy Zhang <ayzhang@chromium.org>
21 months agoRenamed mem_log.py to graphlog.py 49/26149/1
Amy Zhang [Tue, 26 Jun 2012 22:33:18 +0000 (15:33 -0700)]
Renamed mem_log.py to graphlog.py

BUG=none
TEST=manual

Change-Id: I27b21c5b5fa518c5689137dc1dbd9b2802c88e3c
Signed-off-by: Amy Zhang <ayzhang@chromium.org>
21 months agoDocumentation referent to getProcMem.py 23/26123/1
Thiago Goncales [Tue, 26 Jun 2012 18:04:53 +0000 (11:04 -0700)]
Documentation referent to getProcMem.py

BUG=None
TEST=None

Change-Id: Ia7c82a029a064f5ca0d5bcd0cf87da5f62ce46cd
Signed-off-by: Thiago Goncales <thiagog@chromium.org>
21 months agoSupport to ChromeOS smaps in getSmapsDict/exception handling in getType() 47/25747/4
Thiago Goncales [Tue, 19 Jun 2012 00:35:43 +0000 (17:35 -0700)]
Support to ChromeOS smaps in getSmapsDict/exception handling in getType()

BUG=None
TEST=Manual

- changed getSmapsDict() to support different smaps
- added exception handling when opening file in getType()
- added exception handling when checking for options.sort content
- improved docstrings
- added meminfo functionality (commented out for the time being and
  currently not being used)
- deleted comparing functions and using key=lambda to sort now
- accounted for empty smaps file in the script (not appending them
  anymore)

Change-Id: Ibc76c8ff537cff93fdd0a9024c0fad4d3c875ea4
Signed-off-by: Thiago Goncales <thiagog@chromium.org>
21 months agoNew script to log smaps data + updated compatibility with getProcMem 16/25816/4
Amy Zhang [Wed, 20 Jun 2012 23:37:58 +0000 (16:37 -0700)]
New script to log smaps data + updated compatibility with getProcMem

This script logs the memory report from getProcMem. Each iteration
getSmaps and getMemInfo run is mapped to a timestamp. User can choose to
how many times getSmaps and getMemInfo are run and the wait time between
each iteration.

Note: Currently it gives all the data from getSmaps, which is more than we
need. In the next commit, it might be a good idea to take a look at part
of this data rather than all of it.

An argument was added to getSmaps in the latest version of getProcMem
and so this integrated into the log script to make it functional.

Parameter source in logger() has default value "/proc". logger() in main
is not called with a source variable at the moment.

BUG=none
TEST=manual

Change-Id: I406977ba852948dcb996839774d2fcb0da2266d9
Signed-off-by: Amy Zhang <ayzhang@chromium.org>
21 months agoMerge "Parsing % bug fixed/Optimize performance with -c"
Gerrit [Wed, 20 Jun 2012 23:17:46 +0000 (16:17 -0700)]
Merge "Parsing % bug fixed/Optimize performance with -c"

21 months agoMerge "Mem_report: references.txt reformat"
Gerrit [Tue, 19 Jun 2012 00:15:37 +0000 (17:15 -0700)]
Merge "Mem_report: references.txt reformat"

21 months agoParsing % bug fixed/Optimize performance with -c 66/25566/1
Thiago Goncales [Mon, 18 Jun 2012 22:25:43 +0000 (15:25 -0700)]
Parsing % bug fixed/Optimize performance with -c

- Fixed % parsing bug
- Algorithm changed to not collect/process non-chrome data when -c is
  enabled
- Divided mainOutput() into detailedOutput() and totalOutput() for more
clarity
- Removed unused lines
- Removed unused procCmp()
- Introduced valid_mem_types in mainOutput(), for more readability in
  checking if sorting option "-s" from user is adequate
- Added docstrings

BUG=None
TEST=Manual

Change-Id: Ibc467c5e89b15db044c020f748a3dcff66e0152d
Signed-off-by: Thiago Goncales <thiagog@chromium.org>
21 months agoMem_report: references.txt reformat 19/25419/2
Amy Zhang [Fri, 15 Jun 2012 20:47:33 +0000 (13:47 -0700)]
Mem_report: references.txt reformat

Got rid of trailing whitespaces and now using 80 column lines.

Signed-off-by: Amy Zhang <ayzhang@chromium.org>
Change-Id: I4ec2ef2b6d10c0d6ebf038aa6cd7b767ec810e63

21 months agoAdded getMemInfo(), added argument to mainOutput() 38/25538/1
Thiago Goncales [Mon, 18 Jun 2012 16:47:55 +0000 (09:47 -0700)]
Added getMemInfo(), added argument to mainOutput()

BUG=None
TEST=Manual

Signed-off-by: Thiago Goncales <thiagog@chromium.org>
Change-Id: I0552c71d3ff3a9368ff2522da0b17b72abe9e5a6

21 months agoAdded license header 37/25537/1
Thiago Goncales [Mon, 18 Jun 2012 15:32:32 +0000 (08:32 -0700)]
Added license header

BUG=None
TEST=manual

Signed-off-by: Thiago Goncales <thiagog@chromium.org>
Change-Id: Ib5ec8d4bbc2a08ba022b52affa7fc4aa6fdb7ec5

21 months agoInitial version of smaps parsing 36/25536/1
Thiago Goncales [Fri, 15 Jun 2012 22:24:52 +0000 (15:24 -0700)]
Initial version of smaps parsing

BUG=None
TEST=manual

Signed-off-by: Thiago Goncales <thiagog@chromium.org>
Change-Id: If4c96ec264e143244fce060d5b7cc513622bbce8

22 months agoMem_report: initial commit of LICENSE, README and references 36/25336/1
Amy Zhang [Wed, 13 Jun 2012 18:45:24 +0000 (11:45 -0700)]
Mem_report: initial commit of LICENSE, README and references

Signed-off-by: Amy Zhang <ayzhang@chromium.org>