1 2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3<html><head><title>Python: module telemetry.timeline.memory_dump_event</title> 4<meta charset="utf-8"> 5</head><body bgcolor="#f0f0f8"> 6 7<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> 8<tr bgcolor="#7799ee"> 9<td valign=bottom> <br> 10<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.timeline.html"><font color="#ffffff">timeline</font></a>.memory_dump_event</strong></big></big></font></td 11><td align=right valign=bottom 12><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/timeline/memory_dump_event.py">telemetry/timeline/memory_dump_event.py</a></font></td></tr></table> 13 <p><tt># Copyright 2015 The Chromium Authors. All rights reserved.<br> 14# Use of this source code is governed by a BSD-style license that can be<br> 15# found in the LICENSE file.</tt></p> 16<p> 17<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 18<tr bgcolor="#aa55cc"> 19<td colspan=3 valign=bottom> <br> 20<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> 21 22<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> 23<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="posixpath.html">posixpath</a><br> 24</td><td width="25%" valign=top><a href="re.html">re</a><br> 25</td><td width="25%" valign=top><a href="telemetry.timeline.event.html">telemetry.timeline.event</a><br> 26</td><td width="25%" valign=top></td></tr></table></td></tr></table><p> 27<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 28<tr bgcolor="#ee77aa"> 29<td colspan=3 valign=bottom> <br> 30<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 31 32<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 33<td width="100%"><dl> 34<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a> 35</font></dt><dd> 36<dl> 37<dt><font face="helvetica, arial"><a href="telemetry.timeline.memory_dump_event.html#GlobalMemoryDump">GlobalMemoryDump</a> 38</font></dt><dt><font face="helvetica, arial"><a href="telemetry.timeline.memory_dump_event.html#MemoryBucket">MemoryBucket</a> 39</font></dt><dt><font face="helvetica, arial"><a href="telemetry.timeline.memory_dump_event.html#MmapCategory">MmapCategory</a> 40</font></dt></dl> 41</dd> 42<dt><font face="helvetica, arial"><a href="telemetry.timeline.event.html#TimelineEvent">telemetry.timeline.event.TimelineEvent</a>(<a href="__builtin__.html#object">__builtin__.object</a>) 43</font></dt><dd> 44<dl> 45<dt><font face="helvetica, arial"><a href="telemetry.timeline.memory_dump_event.html#ProcessMemoryDumpEvent">ProcessMemoryDumpEvent</a> 46</font></dt></dl> 47</dd> 48</dl> 49 <p> 50<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 51<tr bgcolor="#ffc8d8"> 52<td colspan=3 valign=bottom> <br> 53<font color="#000000" face="helvetica, arial"><a name="GlobalMemoryDump">class <strong>GlobalMemoryDump</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 54 55<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 56<td colspan=2><tt>Object to aggregate individual process dumps with the same dump id.<br> 57 <br> 58Args:<br> 59 process_dumps: A sequence of <a href="#ProcessMemoryDumpEvent">ProcessMemoryDumpEvent</a> objects, all sharing<br> 60 the same global dump id.<br> 61 <br> 62Attributes:<br> 63 dump_id: A string identifying this dump.<br> 64 has_mmaps: True if the memory dump has mmaps information. If False then<br> 65 GetMemoryUsage will report all zeros.<br> </tt></td></tr> 66<tr><td> </td> 67<td width="100%">Methods defined here:<br> 68<dl><dt><a name="GlobalMemoryDump-GetMemoryUsage"><strong>GetMemoryUsage</strong></a>(self)</dt><dd><tt>Get the aggregated memory usage over all processes in this dump.</tt></dd></dl> 69 70<dl><dt><a name="GlobalMemoryDump-IterProcessMemoryDumps"><strong>IterProcessMemoryDumps</strong></a>(self)</dt></dl> 71 72<dl><dt><a name="GlobalMemoryDump-__init__"><strong>__init__</strong></a>(self, process_dumps)</dt></dl> 73 74<dl><dt><a name="GlobalMemoryDump-__repr__"><strong>__repr__</strong></a>(self)</dt></dl> 75 76<hr> 77Data descriptors defined here:<br> 78<dl><dt><strong>__dict__</strong></dt> 79<dd><tt>dictionary for instance variables (if defined)</tt></dd> 80</dl> 81<dl><dt><strong>__weakref__</strong></dt> 82<dd><tt>list of weak references to the object (if defined)</tt></dd> 83</dl> 84<dl><dt><strong>duration</strong></dt> 85</dl> 86<dl><dt><strong>end</strong></dt> 87</dl> 88<dl><dt><strong>start</strong></dt> 89</dl> 90</td></tr></table> <p> 91<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 92<tr bgcolor="#ffc8d8"> 93<td colspan=3 valign=bottom> <br> 94<font color="#000000" face="helvetica, arial"><a name="MemoryBucket">class <strong>MemoryBucket</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 95 96<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 97<td colspan=2><tt>Simple <a href="__builtin__.html#object">object</a> to hold and aggregate memory values.<br> </tt></td></tr> 98<tr><td> </td> 99<td width="100%">Methods defined here:<br> 100<dl><dt><a name="MemoryBucket-AddRegion"><strong>AddRegion</strong></a>(self, byte_stats)</dt></dl> 101 102<dl><dt><a name="MemoryBucket-GetValue"><strong>GetValue</strong></a>(self, name)</dt></dl> 103 104<dl><dt><a name="MemoryBucket-__init__"><strong>__init__</strong></a>(self)</dt></dl> 105 106<dl><dt><a name="MemoryBucket-__repr__"><strong>__repr__</strong></a>(self)</dt></dl> 107 108<hr> 109Data descriptors defined here:<br> 110<dl><dt><strong>__dict__</strong></dt> 111<dd><tt>dictionary for instance variables (if defined)</tt></dd> 112</dl> 113<dl><dt><strong>__weakref__</strong></dt> 114<dd><tt>list of weak references to the object (if defined)</tt></dd> 115</dl> 116</td></tr></table> <p> 117<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 118<tr bgcolor="#ffc8d8"> 119<td colspan=3 valign=bottom> <br> 120<font color="#000000" face="helvetica, arial"><a name="MmapCategory">class <strong>MmapCategory</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr> 121 122<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 123<td width="100%">Methods defined here:<br> 124<dl><dt><a name="MmapCategory-GetMatchingChild"><strong>GetMatchingChild</strong></a>(self, mapped_file)</dt><dd><tt>Get the first matching sub-category for a given mapped file.<br> 125 <br> 126Returns None if the category has no children, or the DefaultCategory if<br> 127it does have children but none of them match.</tt></dd></dl> 128 129<dl><dt><a name="MmapCategory-Match"><strong>Match</strong></a>(self, mapped_file)</dt><dd><tt>Test whether a mapped file matches this category.</tt></dd></dl> 130 131<dl><dt><a name="MmapCategory-__init__"><strong>__init__</strong></a>(self, name, file_pattern, children<font color="#909090">=None</font>)</dt><dd><tt>A (sub)category for classifying memory maps.<br> 132 <br> 133Args:<br> 134 name: A string to identify the category.<br> 135 file_pattern: A regex pattern, the category will aggregate memory usage<br> 136 for all mapped files matching this pattern.<br> 137 children: A list of <a href="#MmapCategory">MmapCategory</a> objects, used to sub-categorize memory<br> 138 usage.</tt></dd></dl> 139 140<hr> 141Class methods defined here:<br> 142<dl><dt><a name="MmapCategory-DefaultCategory"><strong>DefaultCategory</strong></a>(cls)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>An implicit 'Others' match-all category with no children.</tt></dd></dl> 143 144<hr> 145Data descriptors defined here:<br> 146<dl><dt><strong>__dict__</strong></dt> 147<dd><tt>dictionary for instance variables (if defined)</tt></dd> 148</dl> 149<dl><dt><strong>__weakref__</strong></dt> 150<dd><tt>list of weak references to the object (if defined)</tt></dd> 151</dl> 152</td></tr></table> <p> 153<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 154<tr bgcolor="#ffc8d8"> 155<td colspan=3 valign=bottom> <br> 156<font color="#000000" face="helvetica, arial"><a name="ProcessMemoryDumpEvent">class <strong>ProcessMemoryDumpEvent</strong></a>(<a href="telemetry.timeline.event.html#TimelineEvent">telemetry.timeline.event.TimelineEvent</a>)</font></td></tr> 157 158<tr bgcolor="#ffc8d8"><td rowspan=2><tt> </tt></td> 159<td colspan=2><tt>A memory dump event belonging to a single timeline.Process <a href="__builtin__.html#object">object</a>.<br> 160 <br> 161It's a subclass of telemetry's <a href="telemetry.timeline.event.html#TimelineEvent">TimelineEvent</a> so it can be included in<br> 162the stream of events contained in timeline.model objects, and have its<br> 163timing correlated with that of other events in the model.<br> 164 <br> 165Properties:<br> 166 dump_id: A string to identify events belonging to the same global dump.<br> 167 process: The timeline.Process <a href="__builtin__.html#object">object</a> that owns this memory dump event.<br> 168 has_mmaps: True if the memory dump has mmaps information. If False then<br> 169 GetMemoryUsage will report all zeros.<br> </tt></td></tr> 170<tr><td> </td> 171<td width="100%"><dl><dt>Method resolution order:</dt> 172<dd><a href="telemetry.timeline.memory_dump_event.html#ProcessMemoryDumpEvent">ProcessMemoryDumpEvent</a></dd> 173<dd><a href="telemetry.timeline.event.html#TimelineEvent">telemetry.timeline.event.TimelineEvent</a></dd> 174<dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 175</dl> 176<hr> 177Methods defined here:<br> 178<dl><dt><a name="ProcessMemoryDumpEvent-GetMemoryBucket"><strong>GetMemoryBucket</strong></a>(self, path)</dt><dd><tt>Return the <a href="#MemoryBucket">MemoryBucket</a> associated with a category path.<br> 179 <br> 180An empty bucket will be created if the path does not already exist.<br> 181 <br> 182path: A string with path in the classification tree, e.g.<br> 183 '/Android/Java runtime/Cache'. Note: no trailing slash, except for<br> 184 the root path '/'.</tt></dd></dl> 185 186<dl><dt><a name="ProcessMemoryDumpEvent-GetMemoryUsage"><strong>GetMemoryUsage</strong></a>(self)</dt><dd><tt>Get a dictionary with the memory usage of this process.</tt></dd></dl> 187 188<dl><dt><a name="ProcessMemoryDumpEvent-GetMemoryValue"><strong>GetMemoryValue</strong></a>(self, category_path, discount_tracing<font color="#909090">=False</font>)</dt><dd><tt>Return a specific value from within a <a href="#MemoryBucket">MemoryBucket</a>.<br> 189 <br> 190category_path: A string composed of a path in the classification tree,<br> 191 followed by a '.', followed by a specific bucket value, e.g.<br> 192 '/Android/Java runtime/Cache.private_dirty_resident'.<br> 193discount_tracing: A boolean indicating whether the returned value should<br> 194 be discounted by the resident size of the tracing allocator.</tt></dd></dl> 195 196<dl><dt><a name="ProcessMemoryDumpEvent-__init__"><strong>__init__</strong></a>(self, process, event)</dt></dl> 197 198<dl><dt><a name="ProcessMemoryDumpEvent-__repr__"><strong>__repr__</strong></a>(self)</dt></dl> 199 200<hr> 201Data descriptors defined here:<br> 202<dl><dt><strong>process_name</strong></dt> 203</dl> 204<hr> 205Data descriptors inherited from <a href="telemetry.timeline.event.html#TimelineEvent">telemetry.timeline.event.TimelineEvent</a>:<br> 206<dl><dt><strong>__dict__</strong></dt> 207<dd><tt>dictionary for instance variables (if defined)</tt></dd> 208</dl> 209<dl><dt><strong>__weakref__</strong></dt> 210<dd><tt>list of weak references to the object (if defined)</tt></dd> 211</dl> 212<dl><dt><strong>end</strong></dt> 213</dl> 214<dl><dt><strong>has_thread_timestamps</strong></dt> 215</dl> 216<dl><dt><strong>thread_end</strong></dt> 217<dd><tt>Thread-specific CPU time when this event ended.<br> 218 <br> 219May be None if the trace event didn't have thread time data.</tt></dd> 220</dl> 221</td></tr></table></td></tr></table><p> 222<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 223<tr bgcolor="#55aa55"> 224<td colspan=3 valign=bottom> <br> 225<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr> 226 227<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td> 228<td width="100%"><strong>BUCKET_ATTRS</strong> = {'private_clean_resident': 'pc', 'private_dirty_resident': 'pd', 'proportional_resident': 'pss', 'shared_clean_resident': 'sc', 'shared_dirty_resident': 'sd', 'swapped': 'sw'}<br> 229<strong>MMAPS_METRICS</strong> = {'mmaps_ashmem': ('/Android/Ashmem.proportional_resident', False), 'mmaps_java_heap': ('/Android/Java runtime/Spaces.proportional_resident', False), 'mmaps_native_heap': ('/Native heap.proportional_resident', True), 'mmaps_overall_pss': ('/.proportional_resident', True), 'mmaps_private_dirty': ('/.private_dirty_resident', True)}<br> 230<strong>ROOT_CATEGORY</strong> = <telemetry.timeline.memory_dump_event.MmapCategory object></td></tr></table> 231</body></html>