2 <!DOCTYPE html PUBLIC
"-//W3C//DTD HTML 4.0 Transitional//EN">
3 <html><head><title>Python: module telemetry.internal.platform.cros_platform_backend
</title>
5 </head><body bgcolor=
"#f0f0f8">
7 <table width=
"100%" cellspacing=
0 cellpadding=
2 border=
0 summary=
"heading">
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>.cros_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/cros_platform_backend.py">telemetry/internal/platform/cros_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>
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>
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=
"telemetry.internal.platform.cros_device.html">telemetry.internal.platform.cros_device
</a><br>
24 <a href=
"telemetry.internal.forwarders.cros_forwarder.html">telemetry.internal.forwarders.cros_forwarder
</a><br>
25 <a href=
"telemetry.core.cros_interface.html">telemetry.core.cros_interface
</a><br>
26 </td><td width=
"25%" valign=top
><a href=
"telemetry.internal.platform.power_monitor.cros_power_monitor.html">telemetry.internal.platform.power_monitor.cros_power_monitor
</a><br>
27 <a href=
"telemetry.internal.platform.linux_based_platform_backend.html">telemetry.internal.platform.linux_based_platform_backend
</a><br>
28 <a href=
"logging.html">logging
</a><br>
29 </td><td width=
"25%" valign=top
><a href=
"telemetry.core.platform.html">telemetry.core.platform
</a><br>
30 <a href=
"telemetry.internal.util.ps_util.html">telemetry.internal.util.ps_util
</a><br>
31 <a href=
"telemetry.core.util.html">telemetry.core.util
</a><br>
32 </td><td width=
"25%" valign=top
></td></tr></table></td></tr></table><p>
33 <table width=
"100%" cellspacing=
0 cellpadding=
2 border=
0 summary=
"section">
34 <tr bgcolor=
"#ee77aa">
35 <td colspan=
3 valign=bottom
> <br>
36 <font color=
"#ffffff" face=
"helvetica, arial"><big><strong>Classes
</strong></big></font></td></tr>
38 <tr><td bgcolor=
"#ee77aa"><tt> </tt></td><td> </td>
40 <dt><font face=
"helvetica, arial"><a href=
"telemetry.internal.platform.linux_based_platform_backend.html#LinuxBasedPlatformBackend">telemetry.internal.platform.linux_based_platform_backend.LinuxBasedPlatformBackend
</a>(
<a href=
"telemetry.internal.platform.platform_backend.html#PlatformBackend">telemetry.internal.platform.platform_backend.PlatformBackend
</a>)
43 <dt><font face=
"helvetica, arial"><a href=
"telemetry.internal.platform.cros_platform_backend.html#CrosPlatformBackend">CrosPlatformBackend
</a>
48 <table width=
"100%" cellspacing=
0 cellpadding=
2 border=
0 summary=
"section">
49 <tr bgcolor=
"#ffc8d8">
50 <td colspan=
3 valign=bottom
> <br>
51 <font color=
"#000000" face=
"helvetica, arial"><a name=
"CrosPlatformBackend">class
<strong>CrosPlatformBackend
</strong></a>(
<a href=
"telemetry.internal.platform.linux_based_platform_backend.html#LinuxBasedPlatformBackend">telemetry.internal.platform.linux_based_platform_backend.LinuxBasedPlatformBackend
</a>)
</font></td></tr>
53 <tr><td bgcolor=
"#ffc8d8"><tt> </tt></td><td> </td>
54 <td width=
"100%"><dl><dt>Method resolution order:
</dt>
55 <dd><a href=
"telemetry.internal.platform.cros_platform_backend.html#CrosPlatformBackend">CrosPlatformBackend
</a></dd>
56 <dd><a href=
"telemetry.internal.platform.linux_based_platform_backend.html#LinuxBasedPlatformBackend">telemetry.internal.platform.linux_based_platform_backend.LinuxBasedPlatformBackend
</a></dd>
57 <dd><a href=
"telemetry.internal.platform.platform_backend.html#PlatformBackend">telemetry.internal.platform.platform_backend.PlatformBackend
</a></dd>
58 <dd><a href=
"__builtin__.html#object">__builtin__.object
</a></dd>
61 Methods defined here:
<br>
62 <dl><dt><a name=
"CrosPlatformBackend-CanFlushIndividualFilesFromSystemCache"><strong>CanFlushIndividualFilesFromSystemCache
</strong></a>(self)
</dt></dl>
64 <dl><dt><a name=
"CrosPlatformBackend-CanMonitorPower"><strong>CanMonitorPower
</strong></a>(self)
</dt></dl>
66 <dl><dt><a name=
"CrosPlatformBackend-FlushEntireSystemCache"><strong>FlushEntireSystemCache
</strong></a>(self)
</dt></dl>
68 <dl><dt><a name=
"CrosPlatformBackend-FlushSystemCacheForDirectory"><strong>FlushSystemCacheForDirectory
</strong></a>(self, directory)
</dt></dl>
70 <dl><dt><a name=
"CrosPlatformBackend-GetChildPids"><strong>GetChildPids
</strong></a>(self, pid)
</dt><dd><tt>Returns
a
list
of
child
pids
of
|pid|.
</tt></dd></dl>
72 <dl><dt><a name=
"CrosPlatformBackend-GetCommandLine"><strong>GetCommandLine
</strong></a>(self, pid)
</dt></dl>
74 <dl><dt><a name=
"CrosPlatformBackend-GetFileContents"><strong>GetFileContents
</strong></a>(self, filename)
</dt></dl>
76 <dl><dt><a name=
"CrosPlatformBackend-GetOSName"><strong>GetOSName
</strong></a>(self)
</dt></dl>
78 <dl><dt><a name=
"CrosPlatformBackend-GetOSVersionName"><strong>GetOSVersionName
</strong></a>(self)
</dt></dl>
80 <dl><dt><a name=
"CrosPlatformBackend-GetPsOutput"><strong>GetPsOutput
</strong></a>(self, columns, pid
<font color=
"#909090">=None
</font>)
</dt></dl>
82 <dl><dt><a name=
"CrosPlatformBackend-GetRemotePort"><strong>GetRemotePort
</strong></a>(self, port)
</dt></dl>
84 <dl><dt><a name=
"CrosPlatformBackend-HasBeenThermallyThrottled"><strong>HasBeenThermallyThrottled
</strong></a>(self)
</dt></dl>
86 <dl><dt><a name=
"CrosPlatformBackend-IsThermallyThrottled"><strong>IsThermallyThrottled
</strong></a>(self)
</dt></dl>
88 <dl><dt><a name=
"CrosPlatformBackend-PathExists"><strong>PathExists
</strong></a>(self, path, timeout
<font color=
"#909090">=None
</font>, retries
<font color=
"#909090">=None
</font>)
</dt></dl>
90 <dl><dt><a name=
"CrosPlatformBackend-RunCommand"><strong>RunCommand
</strong></a>(self, args)
</dt></dl>
92 <dl><dt><a name=
"CrosPlatformBackend-StartMonitoringPower"><strong>StartMonitoringPower
</strong></a>(self, browser)
</dt></dl>
94 <dl><dt><a name=
"CrosPlatformBackend-StopMonitoringPower"><strong>StopMonitoringPower
</strong></a>(self)
</dt></dl>
96 <dl><dt><a name=
"CrosPlatformBackend-__init__"><strong>__init__
</strong></a>(self, device
<font color=
"#909090">=None
</font>)
</dt></dl>
99 Class methods defined here:
<br>
100 <dl><dt><a name=
"CrosPlatformBackend-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>
102 <dl><dt><a name=
"CrosPlatformBackend-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>
104 <dl><dt><a name=
"CrosPlatformBackend-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></dl>
107 Static methods defined here:
<br>
108 <dl><dt><a name=
"CrosPlatformBackend-ParseCStateSample"><strong>ParseCStateSample
</strong></a>(sample)
</dt></dl>
111 Data descriptors defined here:
<br>
112 <dl><dt><strong>cri
</strong></dt>
114 <dl><dt><strong>forwarder_factory
</strong></dt>
117 Methods inherited from
<a href=
"telemetry.internal.platform.linux_based_platform_backend.html#LinuxBasedPlatformBackend">telemetry.internal.platform.linux_based_platform_backend.LinuxBasedPlatformBackend
</a>:
<br>
118 <dl><dt><a name=
"CrosPlatformBackend-GetClockTicks"><strong>GetClockTicks
</strong></a>(*args, **kwargs)
</dt><dd><tt>Returns
the
number
of
clock
ticks
per
second.
<br>
120 The
proper
way
is
to
call
os.sysconf('SC_CLK_TCK')
but
that
is
not
easy
to
<br>
121 do
on
Android/CrOS.
In
practice,
nearly
all
Linux
machines
have
a
USER_HZ
<br>
122 of
100,
so
just
return
that.
</tt></dd></dl>
124 <dl><dt><a name=
"CrosPlatformBackend-GetCpuStats"><strong>GetCpuStats
</strong></a>(self, pid)
</dt></dl>
126 <dl><dt><a name=
"CrosPlatformBackend-GetCpuTimestamp"><strong>GetCpuTimestamp
</strong></a>(self)
</dt></dl>
128 <dl><dt><a name=
"CrosPlatformBackend-GetMemoryStats"><strong>GetMemoryStats
</strong></a>(self, pid)
</dt></dl>
130 <dl><dt><a name=
"CrosPlatformBackend-GetSystemCommitCharge"><strong>GetSystemCommitCharge
</strong></a>(self)
</dt><dd><tt>#
Get
the
commit
charge
in
kB.
</tt></dd></dl>
132 <dl><dt><a name=
"CrosPlatformBackend-GetSystemTotalPhysicalMemory"><strong>GetSystemTotalPhysicalMemory
</strong></a>(*args, **kwargs)
</dt></dl>
135 Methods inherited from
<a href=
"telemetry.internal.platform.platform_backend.html#PlatformBackend">telemetry.internal.platform.platform_backend.PlatformBackend
</a>:
<br>
136 <dl><dt><a name=
"CrosPlatformBackend-CanCaptureVideo"><strong>CanCaptureVideo
</strong></a>(self)
</dt></dl>
138 <dl><dt><a name=
"CrosPlatformBackend-CanLaunchApplication"><strong>CanLaunchApplication
</strong></a>(self, application)
</dt></dl>
140 <dl><dt><a name=
"CrosPlatformBackend-CanMeasurePerApplicationPower"><strong>CanMeasurePerApplicationPower
</strong></a>(self)
</dt></dl>
142 <dl><dt><a name=
"CrosPlatformBackend-CanMonitorNetworkData"><strong>CanMonitorNetworkData
</strong></a>(self)
</dt></dl>
144 <dl><dt><a name=
"CrosPlatformBackend-CanMonitorThermalThrottling"><strong>CanMonitorThermalThrottling
</strong></a>(self)
</dt></dl>
146 <dl><dt><a name=
"CrosPlatformBackend-CanTakeScreenshot"><strong>CanTakeScreenshot
</strong></a>(self)
</dt></dl>
148 <dl><dt><a name=
"CrosPlatformBackend-CooperativelyShutdown"><strong>CooperativelyShutdown
</strong></a>(self, proc, app_name)
</dt><dd><tt>Cooperatively
shut
down
the
given
process
from
subprocess.Popen.
<br>
150 Currently
this
is
only
implemented
on
Windows.
See
<br>
151 crbug.com/
424024 for
background
on
why
it
was
added.
<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>
159 Returns
True
if
it
is
believed
the
attempt
succeeded.
</tt></dd></dl>
161 <dl><dt><a name=
"CrosPlatformBackend-DidCreateBrowser"><strong>DidCreateBrowser
</strong></a>(self, browser, browser_backend)
</dt></dl>
163 <dl><dt><a name=
"CrosPlatformBackend-DidStartBrowser"><strong>DidStartBrowser
</strong></a>(self, browser, browser_backend)
</dt></dl>
165 <dl><dt><a name=
"CrosPlatformBackend-FlushDnsCache"><strong>FlushDnsCache
</strong></a>(self)
</dt></dl>
167 <dl><dt><a name=
"CrosPlatformBackend-GetArchName"><strong>GetArchName
</strong></a>(self)
</dt></dl>
169 <dl><dt><a name=
"CrosPlatformBackend-GetDeviceTypeName"><strong>GetDeviceTypeName
</strong></a>(self)
</dt></dl>
171 <dl><dt><a name=
"CrosPlatformBackend-GetNetworkData"><strong>GetNetworkData
</strong></a>(self, browser)
</dt></dl>
173 <dl><dt><a name=
"CrosPlatformBackend-InitPlatformBackend"><strong>InitPlatformBackend
</strong></a>(self)
</dt></dl>
175 <dl><dt><a name=
"CrosPlatformBackend-InstallApplication"><strong>InstallApplication
</strong></a>(self, application)
</dt></dl>
177 <dl><dt><a name=
"CrosPlatformBackend-IsApplicationRunning"><strong>IsApplicationRunning
</strong></a>(self, application)
</dt></dl>
179 <dl><dt><a name=
"CrosPlatformBackend-IsCooperativeShutdownSupported"><strong>IsCooperativeShutdownSupported
</strong></a>(self)
</dt><dd><tt>Indicates
whether
CooperativelyShutdown,
below,
is
supported.
<br>
180 It
is
not
necessary
to
implement
it
on
all
platforms.
</tt></dd></dl>
182 <dl><dt><a name=
"CrosPlatformBackend-IsDisplayTracingSupported"><strong>IsDisplayTracingSupported
</strong></a>(self)
</dt></dl>
184 <dl><dt><a name=
"CrosPlatformBackend-LaunchApplication"><strong>LaunchApplication
</strong></a>(self, application, parameters
<font color=
"#909090">=None
</font>, elevate_privilege
<font color=
"#909090">=False
</font>)
</dt></dl>
186 <dl><dt><a name=
"CrosPlatformBackend-PurgeUnpinnedMemory"><strong>PurgeUnpinnedMemory
</strong></a>(self)
</dt></dl>
188 <dl><dt><a name=
"CrosPlatformBackend-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>
190 Which
MSRs
are
available
depends
on
the
CPU
model.
<br>
191 On
systems
with
multiple
CPUs,
this
function
may
run
on
any
CPU.
<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>
199 <dl><dt><a name=
"CrosPlatformBackend-SetFullPerformanceModeEnabled"><strong>SetFullPerformanceModeEnabled
</strong></a>(self, enabled)
</dt></dl>
201 <dl><dt><a name=
"CrosPlatformBackend-SetPlatform"><strong>SetPlatform
</strong></a>(self, platform)
</dt></dl>
203 <dl><dt><a name=
"CrosPlatformBackend-StartDisplayTracing"><strong>StartDisplayTracing
</strong></a>(self)
</dt><dd><tt>Start
gathering
a
trace
with
frame
timestamps
close
to
physical
<br>
204 display.
</tt></dd></dl>
206 <dl><dt><a name=
"CrosPlatformBackend-StartVideoCapture"><strong>StartVideoCapture
</strong></a>(self, min_bitrate_mbps)
</dt></dl>
208 <dl><dt><a name=
"CrosPlatformBackend-StopDisplayTracing"><strong>StopDisplayTracing
</strong></a>(self)
</dt><dd><tt>Stop
gathering
a
trace
with
frame
timestamps
close
to
physical
display.
<br>
210 Returns
a
raw
tracing
events
that
contains
the
timestamps
of
physical
<br>
211 display.
</tt></dd></dl>
213 <dl><dt><a name=
"CrosPlatformBackend-StopVideoCapture"><strong>StopVideoCapture
</strong></a>(self)
</dt></dl>
215 <dl><dt><a name=
"CrosPlatformBackend-TakeScreenshot"><strong>TakeScreenshot
</strong></a>(self, file_path)
</dt></dl>
217 <dl><dt><a name=
"CrosPlatformBackend-WillCloseBrowser"><strong>WillCloseBrowser
</strong></a>(self, browser, browser_backend)
</dt></dl>
220 Data descriptors inherited from
<a href=
"telemetry.internal.platform.platform_backend.html#PlatformBackend">telemetry.internal.platform.platform_backend.PlatformBackend
</a>:
<br>
221 <dl><dt><strong>__dict__
</strong></dt>
222 <dd><tt>dictionary
for
instance
variables
(if
defined)
</tt></dd>
224 <dl><dt><strong>__weakref__
</strong></dt>
225 <dd><tt>list
of
weak
references
to
the
object
(if
defined)
</tt></dd>
227 <dl><dt><strong>is_host_platform
</strong></dt>
229 <dl><dt><strong>is_video_capture_running
</strong></dt>
231 <dl><dt><strong>network_controller_backend
</strong></dt>
233 <dl><dt><strong>platform
</strong></dt>
235 <dl><dt><strong>running_browser_backends
</strong></dt>
237 <dl><dt><strong>tracing_controller_backend
</strong></dt>
239 <dl><dt><strong>wpr_ca_cert_path
</strong></dt>
241 <dl><dt><strong>wpr_http_device_port
</strong></dt>
243 <dl><dt><strong>wpr_https_device_port
</strong></dt>
245 </td></tr></table></td></tr></table>