blob: fb94c25065b0279a8abe0c7f6386e0347adcef94 [file] [log] [blame]
Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
This package provides tools to parse through a process's smaps, a system's
/proc/meminfo and graphics memory file. It is currently designed to be run on
a ChromeOS system to gather memory usage data, and present that data using a
graphical representation.
[TODO: Add table of contents?]
================================================================================
Data Collection: graphlog.py
================================================================================
This is the topmost script, a rough UI of sorts. Through graphlog, the user can
specify how many iterations of data to be collected, the wait time between
these snapshots, and the type of graph to be created. Graphlog also formats the
data to be graph ready.
================================================================================
Memory Snapshots: memreport.py
================================================================================
Memreport creates a ProcSnapshot object that holds memory consumption data for
one instance in time on a single system. It gathers its information from the
/proc/meminfo, /proc/<pid>/smaps, and i915_gem_gtt files.
[TODO: thiagog anything to add?]
================================================================================
Graphing: grapher.py
================================================================================
This script creates the graphs. Currently, it assumes the input is already
formatted correctly and only creates graphs from 3 predetermined templates whose
file names are stored in a dictionary global to the script. Grapher also assumes
that the user has the correct templates stored in the directory which he/she is
running the script from.
================================================================================
Graph Types and Templates
================================================================================
This package uses 3 types of graphs/templates:
1. time log (line graph)
2. single snapshot (pie graph)
3. rss report (bar graph)
all of which are generated using the Google Chart Tools API.
1. Time Log
The time log template is a line graph. It shows, for one memory type, the
various process's memory usage over a given period of time. Each line represents
one PID and the process type of the PID is given in the legend.
2. Single Snapshot
The single snapshot template is a pie graph. For one memory type and one
instance, this graph shows what percentage a process's memory consumtpion is
compared to the total amount of memory used.
3. RSS (Resident Set Size) Report
The RSS report template is a bar graph. For a single snapshot, this graph will
show each process's RSS usage. Each process's RSS bar is divided into its
private clean, dirty and shared clean, dirty memory.
[TODO: add timelog version]
================================================================================
Notes: references.txt
================================================================================
Contains information gathered from various sources about the /proc file,
specifically relating to smaps, maps, and meminfo.
There is a lot of information out there, but it is mostly scattered. This file
is our attempt at creating a central location for documentation and reference.
Also, any notes regarding how we plan on viewing memory usage will be in here.