1 2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3<html><head><title>Python: module telemetry.internal.platform.mac_platform_backend</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.internal.html"><font color="#ffffff">internal</font></a>.<a href="telemetry.internal.platform.html"><font color="#ffffff">platform</font></a>.mac_platform_backend</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/internal/platform/mac_platform_backend.py">telemetry/internal/platform/mac_platform_backend.py</a></font></td></tr></table> 13 <p><tt># Copyright 2013 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="ctypes.html">ctypes</a><br> 24<a href="telemetry.decorators.html">telemetry.decorators</a><br> 25<a href="os.html">os</a><br> 26</td><td width="25%" valign=top><a href="telemetry.core.os_version.html">telemetry.core.os_version</a><br> 27<a href="platform.html">platform</a><br> 28<a href="telemetry.internal.platform.posix_platform_backend.html">telemetry.internal.platform.posix_platform_backend</a><br> 29</td><td width="25%" valign=top><a href="telemetry.internal.platform.power_monitor.powermetrics_power_monitor.html">telemetry.internal.platform.power_monitor.powermetrics_power_monitor</a><br> 30<a href="telemetry.util.process_statistic_timeline_data.html">telemetry.util.process_statistic_timeline_data</a><br> 31<a href="resource.html">resource</a><br> 32</td><td width="25%" valign=top><a href="subprocess.html">subprocess</a><br> 33<a href="sys.html">sys</a><br> 34<a href="time.html">time</a><br> 35</td></tr></table></td></tr></table><p> 36<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 37<tr bgcolor="#ee77aa"> 38<td colspan=3 valign=bottom> <br> 39<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> 40 41<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> 42<td width="100%"><dl> 43<dt><font face="helvetica, arial"><a href="telemetry.internal.platform.posix_platform_backend.html#PosixPlatformBackend">telemetry.internal.platform.posix_platform_backend.PosixPlatformBackend</a>(<a href="telemetry.internal.platform.desktop_platform_backend.html#DesktopPlatformBackend">telemetry.internal.platform.desktop_platform_backend.DesktopPlatformBackend</a>) 44</font></dt><dd> 45<dl> 46<dt><font face="helvetica, arial"><a href="telemetry.internal.platform.mac_platform_backend.html#MacPlatformBackend">MacPlatformBackend</a> 47</font></dt></dl> 48</dd> 49</dl> 50 <p> 51<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> 52<tr bgcolor="#ffc8d8"> 53<td colspan=3 valign=bottom> <br> 54<font color="#000000" face="helvetica, arial"><a name="MacPlatformBackend">class <strong>MacPlatformBackend</strong></a>(<a href="telemetry.internal.platform.posix_platform_backend.html#PosixPlatformBackend">telemetry.internal.platform.posix_platform_backend.PosixPlatformBackend</a>)</font></td></tr> 55 56<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> 57<td width="100%"><dl><dt>Method resolution order:</dt> 58<dd><a href="telemetry.internal.platform.mac_platform_backend.html#MacPlatformBackend">MacPlatformBackend</a></dd> 59<dd><a href="telemetry.internal.platform.posix_platform_backend.html#PosixPlatformBackend">telemetry.internal.platform.posix_platform_backend.PosixPlatformBackend</a></dd> 60<dd><a href="telemetry.internal.platform.desktop_platform_backend.html#DesktopPlatformBackend">telemetry.internal.platform.desktop_platform_backend.DesktopPlatformBackend</a></dd> 61<dd><a href="telemetry.internal.platform.platform_backend.html#PlatformBackend">telemetry.internal.platform.platform_backend.PlatformBackend</a></dd> 62<dd><a href="__builtin__.html#object">__builtin__.object</a></dd> 63</dl> 64<hr> 65Methods defined here:<br> 66<dl><dt><a name="MacPlatformBackend-CanFlushIndividualFilesFromSystemCache"><strong>CanFlushIndividualFilesFromSystemCache</strong></a>(self)</dt></dl> 67 68<dl><dt><a name="MacPlatformBackend-CanMeasurePerApplicationPower"><strong>CanMeasurePerApplicationPower</strong></a>(self)</dt></dl> 69 70<dl><dt><a name="MacPlatformBackend-CanMonitorPower"><strong>CanMonitorPower</strong></a>(self)</dt></dl> 71 72<dl><dt><a name="MacPlatformBackend-CanTakeScreenshot"><strong>CanTakeScreenshot</strong></a>(self)</dt></dl> 73 74<dl><dt><a name="MacPlatformBackend-FlushEntireSystemCache"><strong>FlushEntireSystemCache</strong></a>(self)</dt></dl> 75 76<dl><dt><a name="MacPlatformBackend-GetArchName"><strong>GetArchName</strong></a>(*args, **kwargs)</dt></dl> 77 78<dl><dt><a name="MacPlatformBackend-GetCpuStats"><strong>GetCpuStats</strong></a>(self, pid)</dt><dd><tt>Returns a dict of cpu statistics for the process represented by |pid|.</tt></dd></dl> 79 80<dl><dt><a name="MacPlatformBackend-GetCpuTimestamp"><strong>GetCpuTimestamp</strong></a>(self)</dt><dd><tt>Return current timestamp in seconds.</tt></dd></dl> 81 82<dl><dt><a name="MacPlatformBackend-GetMemoryStats"><strong>GetMemoryStats</strong></a>(self, pid)</dt></dl> 83 84<dl><dt><a name="MacPlatformBackend-GetOSName"><strong>GetOSName</strong></a>(self)</dt></dl> 85 86<dl><dt><a name="MacPlatformBackend-GetOSVersionName"><strong>GetOSVersionName</strong></a>(*args, **kwargs)</dt></dl> 87 88<dl><dt><a name="MacPlatformBackend-GetSystemCommitCharge"><strong>GetSystemCommitCharge</strong></a>(self)</dt></dl> 89 90<dl><dt><a name="MacPlatformBackend-GetSystemTotalPhysicalMemory"><strong>GetSystemTotalPhysicalMemory</strong></a>(*args, **kwargs)</dt></dl> 91 92<dl><dt><a name="MacPlatformBackend-HasBeenThermallyThrottled"><strong>HasBeenThermallyThrottled</strong></a>(self)</dt></dl> 93 94<dl><dt><a name="MacPlatformBackend-IsThermallyThrottled"><strong>IsThermallyThrottled</strong></a>(self)</dt></dl> 95 96<dl><dt><a name="MacPlatformBackend-PurgeUnpinnedMemory"><strong>PurgeUnpinnedMemory</strong></a>(self)</dt></dl> 97 98<dl><dt><a name="MacPlatformBackend-StartMonitoringPower"><strong>StartMonitoringPower</strong></a>(self, browser)</dt></dl> 99 100<dl><dt><a name="MacPlatformBackend-StopMonitoringPower"><strong>StopMonitoringPower</strong></a>(self)</dt></dl> 101 102<dl><dt><a name="MacPlatformBackend-TakeScreenshot"><strong>TakeScreenshot</strong></a>(self, file_path)</dt></dl> 103 104<dl><dt><a name="MacPlatformBackend-__init__"><strong>__init__</strong></a>(self)</dt></dl> 105 106<hr> 107Class methods defined here:<br> 108<dl><dt><a name="MacPlatformBackend-IsPlatformBackendForHost"><strong>IsPlatformBackendForHost</strong></a>(cls)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt></dl> 109 110<hr> 111Methods inherited from <a href="telemetry.internal.platform.posix_platform_backend.html#PosixPlatformBackend">telemetry.internal.platform.posix_platform_backend.PosixPlatformBackend</a>:<br> 112<dl><dt><a name="MacPlatformBackend-CanLaunchApplication"><strong>CanLaunchApplication</strong></a>(self, application)</dt></dl> 113 114<dl><dt><a name="MacPlatformBackend-GetChildPids"><strong>GetChildPids</strong></a>(self, pid)</dt><dd><tt>Returns a list of child pids of |pid|.</tt></dd></dl> 115 116<dl><dt><a name="MacPlatformBackend-GetCommandLine"><strong>GetCommandLine</strong></a>(self, pid)</dt></dl> 117 118<dl><dt><a name="MacPlatformBackend-GetFileContents"><strong>GetFileContents</strong></a>(self, path)</dt></dl> 119 120<dl><dt><a name="MacPlatformBackend-GetPsOutput"><strong>GetPsOutput</strong></a>(self, columns, pid<font color="#909090">=None</font>)</dt><dd><tt>Returns output of the 'ps' command as a list of lines.<br> 121Subclass should override this function.<br> 122 <br> 123Args:<br> 124 columns: A list of require columns, e.g., ['pid', 'pss'].<br> 125 pid: If not None, returns only the information of the process<br> 126 with the pid.</tt></dd></dl> 127 128<dl><dt><a name="MacPlatformBackend-IsApplicationRunning"><strong>IsApplicationRunning</strong></a>(self, application)</dt></dl> 129 130<dl><dt><a name="MacPlatformBackend-LaunchApplication"><strong>LaunchApplication</strong></a>(self, application, parameters<font color="#909090">=None</font>, elevate_privilege<font color="#909090">=False</font>)</dt></dl> 131 132<dl><dt><a name="MacPlatformBackend-RunCommand"><strong>RunCommand</strong></a>(self, args)</dt></dl> 133 134<hr> 135Methods inherited from <a href="telemetry.internal.platform.desktop_platform_backend.html#DesktopPlatformBackend">telemetry.internal.platform.desktop_platform_backend.DesktopPlatformBackend</a>:<br> 136<dl><dt><a name="MacPlatformBackend-FlushSystemCacheForDirectory"><strong>FlushSystemCacheForDirectory</strong></a>(self, directory)</dt></dl> 137 138<dl><dt><a name="MacPlatformBackend-GetDeviceTypeName"><strong>GetDeviceTypeName</strong></a>(self)</dt></dl> 139 140<hr> 141Methods inherited from <a href="telemetry.internal.platform.platform_backend.html#PlatformBackend">telemetry.internal.platform.platform_backend.PlatformBackend</a>:<br> 142<dl><dt><a name="MacPlatformBackend-CanCaptureVideo"><strong>CanCaptureVideo</strong></a>(self)</dt></dl> 143 144<dl><dt><a name="MacPlatformBackend-CanMonitorNetworkData"><strong>CanMonitorNetworkData</strong></a>(self)</dt></dl> 145 146<dl><dt><a name="MacPlatformBackend-CanMonitorThermalThrottling"><strong>CanMonitorThermalThrottling</strong></a>(self)</dt></dl> 147 148<dl><dt><a name="MacPlatformBackend-CooperativelyShutdown"><strong>CooperativelyShutdown</strong></a>(self, proc, app_name)</dt><dd><tt>Cooperatively shut down the given process from subprocess.Popen.<br> 149 <br> 150Currently this is only implemented on Windows. See<br> 151crbug.com/424024 for background on why it was added.<br> 152 <br> 153Args:<br> 154 proc: a process object returned from subprocess.Popen.<br> 155 app_name: on Windows, is the prefix of the application's window<br> 156 class name that should be searched for. This helps ensure<br> 157 that only the application's windows are closed.<br> 158 <br> 159Returns True if it is believed the attempt succeeded.</tt></dd></dl> 160 161<dl><dt><a name="MacPlatformBackend-DidCreateBrowser"><strong>DidCreateBrowser</strong></a>(self, browser, browser_backend)</dt></dl> 162 163<dl><dt><a name="MacPlatformBackend-DidStartBrowser"><strong>DidStartBrowser</strong></a>(self, browser, browser_backend)</dt></dl> 164 165<dl><dt><a name="MacPlatformBackend-FlushDnsCache"><strong>FlushDnsCache</strong></a>(self)</dt></dl> 166 167<dl><dt><a name="MacPlatformBackend-GetNetworkData"><strong>GetNetworkData</strong></a>(self, browser)</dt></dl> 168 169<dl><dt><a name="MacPlatformBackend-GetRemotePort"><strong>GetRemotePort</strong></a>(self, port)</dt></dl> 170 171<dl><dt><a name="MacPlatformBackend-InitPlatformBackend"><strong>InitPlatformBackend</strong></a>(self)</dt></dl> 172 173<dl><dt><a name="MacPlatformBackend-InstallApplication"><strong>InstallApplication</strong></a>(self, application)</dt></dl> 174 175<dl><dt><a name="MacPlatformBackend-IsCooperativeShutdownSupported"><strong>IsCooperativeShutdownSupported</strong></a>(self)</dt><dd><tt>Indicates whether CooperativelyShutdown, below, is supported.<br> 176It is not necessary to implement it on all platforms.</tt></dd></dl> 177 178<dl><dt><a name="MacPlatformBackend-IsDisplayTracingSupported"><strong>IsDisplayTracingSupported</strong></a>(self)</dt></dl> 179 180<dl><dt><a name="MacPlatformBackend-PathExists"><strong>PathExists</strong></a>(self, path, timeout<font color="#909090">=None</font>, retries<font color="#909090">=None</font>)</dt><dd><tt>Tests whether the given path exists on the target platform.<br> 181Args:<br> 182 path: path in request.<br> 183 timeout: timeout.<br> 184 retries: num of retries.<br> 185Return:<br> 186 Whether the path exists on the target platform.</tt></dd></dl> 187 188<dl><dt><a name="MacPlatformBackend-ReadMsr"><strong>ReadMsr</strong></a>(self, msr_number, start<font color="#909090">=0</font>, length<font color="#909090">=64</font>)</dt><dd><tt>Read a CPU model-specific register (MSR).<br> 189 <br> 190Which MSRs are available depends on the CPU model.<br> 191On systems with multiple CPUs, this function may run on any CPU.<br> 192 <br> 193Args:<br> 194 msr_number: The number of the register to read.<br> 195 start: The least significant bit to read, zero-indexed.<br> 196 (Said another way, the number of bits to right-shift the MSR value.)<br> 197 length: The number of bits to read. MSRs are 64 bits, even on 32-bit CPUs.</tt></dd></dl> 198 199<dl><dt><a name="MacPlatformBackend-SetFullPerformanceModeEnabled"><strong>SetFullPerformanceModeEnabled</strong></a>(self, enabled)</dt></dl> 200 201<dl><dt><a name="MacPlatformBackend-SetPlatform"><strong>SetPlatform</strong></a>(self, platform)</dt></dl> 202 203<dl><dt><a name="MacPlatformBackend-StartDisplayTracing"><strong>StartDisplayTracing</strong></a>(self)</dt><dd><tt>Start gathering a trace with frame timestamps close to physical<br> 204display.</tt></dd></dl> 205 206<dl><dt><a name="MacPlatformBackend-StartVideoCapture"><strong>StartVideoCapture</strong></a>(self, min_bitrate_mbps)</dt></dl> 207 208<dl><dt><a name="MacPlatformBackend-StopDisplayTracing"><strong>StopDisplayTracing</strong></a>(self)</dt><dd><tt>Stop gathering a trace with frame timestamps close to physical display.<br> 209 <br> 210Returns a raw tracing events that contains the timestamps of physical<br> 211display.</tt></dd></dl> 212 213<dl><dt><a name="MacPlatformBackend-StopVideoCapture"><strong>StopVideoCapture</strong></a>(self)</dt></dl> 214 215<dl><dt><a name="MacPlatformBackend-WillCloseBrowser"><strong>WillCloseBrowser</strong></a>(self, browser, browser_backend)</dt></dl> 216 217<hr> 218Class methods inherited from <a href="telemetry.internal.platform.platform_backend.html#PlatformBackend">telemetry.internal.platform.platform_backend.PlatformBackend</a>:<br> 219<dl><dt><a name="MacPlatformBackend-CreatePlatformForDevice"><strong>CreatePlatformForDevice</strong></a>(cls, device, finder_options)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt></dl> 220 221<dl><dt><a name="MacPlatformBackend-SupportsDevice"><strong>SupportsDevice</strong></a>(cls, device)<font color="#909090"><font face="helvetica, arial"> from <a href="__builtin__.html#type">__builtin__.type</a></font></font></dt><dd><tt>Returns whether this platform backend supports intialization from the<br> 222device.</tt></dd></dl> 223 224<hr> 225Data descriptors inherited from <a href="telemetry.internal.platform.platform_backend.html#PlatformBackend">telemetry.internal.platform.platform_backend.PlatformBackend</a>:<br> 226<dl><dt><strong>__dict__</strong></dt> 227<dd><tt>dictionary for instance variables (if defined)</tt></dd> 228</dl> 229<dl><dt><strong>__weakref__</strong></dt> 230<dd><tt>list of weak references to the object (if defined)</tt></dd> 231</dl> 232<dl><dt><strong>forwarder_factory</strong></dt> 233</dl> 234<dl><dt><strong>is_host_platform</strong></dt> 235</dl> 236<dl><dt><strong>is_video_capture_running</strong></dt> 237</dl> 238<dl><dt><strong>network_controller_backend</strong></dt> 239</dl> 240<dl><dt><strong>platform</strong></dt> 241</dl> 242<dl><dt><strong>running_browser_backends</strong></dt> 243</dl> 244<dl><dt><strong>tracing_controller_backend</strong></dt> 245</dl> 246<dl><dt><strong>wpr_ca_cert_path</strong></dt> 247</dl> 248<dl><dt><strong>wpr_http_device_port</strong></dt> 249</dl> 250<dl><dt><strong>wpr_https_device_port</strong></dt> 251</dl> 252</td></tr></table></td></tr></table> 253</body></html>