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>&nbsp;<br>
10<font color="#ffffff" face="helvetica, arial">&nbsp;<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>#&nbsp;Copyright&nbsp;2013&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
14#&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
15#&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;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>&nbsp;<br>
20<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
21
22<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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>&nbsp;<br>
39<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
40
41<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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>&nbsp;<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>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</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&nbsp;a&nbsp;dict&nbsp;of&nbsp;cpu&nbsp;statistics&nbsp;for&nbsp;the&nbsp;process&nbsp;represented&nbsp;by&nbsp;|pid|.</tt></dd></dl>
79
80<dl><dt><a name="MacPlatformBackend-GetCpuTimestamp"><strong>GetCpuTimestamp</strong></a>(self)</dt><dd><tt>Return&nbsp;current&nbsp;timestamp&nbsp;in&nbsp;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&nbsp;a&nbsp;list&nbsp;of&nbsp;child&nbsp;pids&nbsp;of&nbsp;|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&nbsp;output&nbsp;of&nbsp;the&nbsp;'ps'&nbsp;command&nbsp;as&nbsp;a&nbsp;list&nbsp;of&nbsp;lines.<br>
121Subclass&nbsp;should&nbsp;override&nbsp;this&nbsp;function.<br>
122&nbsp;<br>
123Args:<br>
124&nbsp;&nbsp;columns:&nbsp;A&nbsp;list&nbsp;of&nbsp;require&nbsp;columns,&nbsp;e.g.,&nbsp;['pid',&nbsp;'pss'].<br>
125&nbsp;&nbsp;pid:&nbsp;If&nbsp;not&nbsp;None,&nbsp;returns&nbsp;only&nbsp;the&nbsp;information&nbsp;of&nbsp;the&nbsp;process<br>
126&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;with&nbsp;the&nbsp;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&nbsp;shut&nbsp;down&nbsp;the&nbsp;given&nbsp;process&nbsp;from&nbsp;subprocess.Popen.<br>
149&nbsp;<br>
150Currently&nbsp;this&nbsp;is&nbsp;only&nbsp;implemented&nbsp;on&nbsp;Windows.&nbsp;See<br>
151crbug.com/424024&nbsp;for&nbsp;background&nbsp;on&nbsp;why&nbsp;it&nbsp;was&nbsp;added.<br>
152&nbsp;<br>
153Args:<br>
154&nbsp;&nbsp;proc:&nbsp;a&nbsp;process&nbsp;object&nbsp;returned&nbsp;from&nbsp;subprocess.Popen.<br>
155&nbsp;&nbsp;app_name:&nbsp;on&nbsp;Windows,&nbsp;is&nbsp;the&nbsp;prefix&nbsp;of&nbsp;the&nbsp;application's&nbsp;window<br>
156&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class&nbsp;name&nbsp;that&nbsp;should&nbsp;be&nbsp;searched&nbsp;for.&nbsp;This&nbsp;helps&nbsp;ensure<br>
157&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;that&nbsp;only&nbsp;the&nbsp;application's&nbsp;windows&nbsp;are&nbsp;closed.<br>
158&nbsp;<br>
159Returns&nbsp;True&nbsp;if&nbsp;it&nbsp;is&nbsp;believed&nbsp;the&nbsp;attempt&nbsp;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&nbsp;whether&nbsp;CooperativelyShutdown,&nbsp;below,&nbsp;is&nbsp;supported.<br>
176It&nbsp;is&nbsp;not&nbsp;necessary&nbsp;to&nbsp;implement&nbsp;it&nbsp;on&nbsp;all&nbsp;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&nbsp;whether&nbsp;the&nbsp;given&nbsp;path&nbsp;exists&nbsp;on&nbsp;the&nbsp;target&nbsp;platform.<br>
181Args:<br>
182&nbsp;&nbsp;path:&nbsp;path&nbsp;in&nbsp;request.<br>
183&nbsp;&nbsp;timeout:&nbsp;timeout.<br>
184&nbsp;&nbsp;retries:&nbsp;num&nbsp;of&nbsp;retries.<br>
185Return:<br>
186&nbsp;&nbsp;Whether&nbsp;the&nbsp;path&nbsp;exists&nbsp;on&nbsp;the&nbsp;target&nbsp;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&nbsp;a&nbsp;CPU&nbsp;model-specific&nbsp;register&nbsp;(MSR).<br>
189&nbsp;<br>
190Which&nbsp;MSRs&nbsp;are&nbsp;available&nbsp;depends&nbsp;on&nbsp;the&nbsp;CPU&nbsp;model.<br>
191On&nbsp;systems&nbsp;with&nbsp;multiple&nbsp;CPUs,&nbsp;this&nbsp;function&nbsp;may&nbsp;run&nbsp;on&nbsp;any&nbsp;CPU.<br>
192&nbsp;<br>
193Args:<br>
194&nbsp;&nbsp;msr_number:&nbsp;The&nbsp;number&nbsp;of&nbsp;the&nbsp;register&nbsp;to&nbsp;read.<br>
195&nbsp;&nbsp;start:&nbsp;The&nbsp;least&nbsp;significant&nbsp;bit&nbsp;to&nbsp;read,&nbsp;zero-indexed.<br>
196&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;(Said&nbsp;another&nbsp;way,&nbsp;the&nbsp;number&nbsp;of&nbsp;bits&nbsp;to&nbsp;right-shift&nbsp;the&nbsp;MSR&nbsp;value.)<br>
197&nbsp;&nbsp;length:&nbsp;The&nbsp;number&nbsp;of&nbsp;bits&nbsp;to&nbsp;read.&nbsp;MSRs&nbsp;are&nbsp;64&nbsp;bits,&nbsp;even&nbsp;on&nbsp;32-bit&nbsp;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&nbsp;gathering&nbsp;a&nbsp;trace&nbsp;with&nbsp;frame&nbsp;timestamps&nbsp;close&nbsp;to&nbsp;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&nbsp;gathering&nbsp;a&nbsp;trace&nbsp;with&nbsp;frame&nbsp;timestamps&nbsp;close&nbsp;to&nbsp;physical&nbsp;display.<br>
209&nbsp;<br>
210Returns&nbsp;a&nbsp;raw&nbsp;tracing&nbsp;events&nbsp;that&nbsp;contains&nbsp;the&nbsp;timestamps&nbsp;of&nbsp;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&nbsp;whether&nbsp;this&nbsp;platform&nbsp;backend&nbsp;supports&nbsp;intialization&nbsp;from&nbsp;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&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
228</dl>
229<dl><dt><strong>__weakref__</strong></dt>
230<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;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>