| |
| <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> |
| <html><head><title>Python: module telemetry.internal.platform.linux_platform_backend</title> |
| <meta charset="utf-8"> |
| </head><body bgcolor="#f0f0f8"> |
| |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading"> |
| <tr bgcolor="#7799ee"> |
| <td valign=bottom> <br> |
| <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>.linux_platform_backend</strong></big></big></font></td |
| ><td align=right valign=bottom |
| ><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/internal/platform/linux_platform_backend.py">telemetry/internal/platform/linux_platform_backend.py</a></font></td></tr></table> |
| <p><tt># Copyright 2013 The Chromium Authors. All rights reserved.<br> |
| # Use of this source code is governed by a BSD-style license that can be<br> |
| # found in the LICENSE file.</tt></p> |
| <p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#aa55cc"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr> |
| |
| <tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td> |
| <td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.internal.util.binary_manager.html">telemetry.internal.util.binary_manager</a><br> |
| <a href="catapult_base.cloud_storage.html">catapult_base.cloud_storage</a><br> |
| <a href="telemetry.decorators.html">telemetry.decorators</a><br> |
| <a href="telemetry.internal.platform.linux_based_platform_backend.html">telemetry.internal.platform.linux_based_platform_backend</a><br> |
| </td><td width="25%" valign=top><a href="logging.html">logging</a><br> |
| <a href="telemetry.internal.platform.power_monitor.msr_power_monitor.html">telemetry.internal.platform.power_monitor.msr_power_monitor</a><br> |
| <a href="os.html">os</a><br> |
| <a href="telemetry.core.os_version.html">telemetry.core.os_version</a><br> |
| </td><td width="25%" valign=top><a href="platform.html">platform</a><br> |
| <a href="telemetry.internal.platform.posix_platform_backend.html">telemetry.internal.platform.posix_platform_backend</a><br> |
| <a href="subprocess.html">subprocess</a><br> |
| <a href="sys.html">sys</a><br> |
| </td><td width="25%" valign=top><a href="telemetry.core.util.html">telemetry.core.util</a><br> |
| </td></tr></table></td></tr></table><p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#ee77aa"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr> |
| |
| <tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td> |
| <td width="100%"><dl> |
| <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>) |
| </font></dt><dd> |
| <dl> |
| <dt><font face="helvetica, arial"><a href="telemetry.internal.platform.linux_platform_backend.html#LinuxPlatformBackend">LinuxPlatformBackend</a>(<a href="telemetry.internal.platform.posix_platform_backend.html#PosixPlatformBackend">telemetry.internal.platform.posix_platform_backend.PosixPlatformBackend</a>, <a href="telemetry.internal.platform.linux_based_platform_backend.html#LinuxBasedPlatformBackend">telemetry.internal.platform.linux_based_platform_backend.LinuxBasedPlatformBackend</a>) |
| </font></dt></dl> |
| </dd> |
| <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>) |
| </font></dt><dd> |
| <dl> |
| <dt><font face="helvetica, arial"><a href="telemetry.internal.platform.linux_platform_backend.html#LinuxPlatformBackend">LinuxPlatformBackend</a>(<a href="telemetry.internal.platform.posix_platform_backend.html#PosixPlatformBackend">telemetry.internal.platform.posix_platform_backend.PosixPlatformBackend</a>, <a href="telemetry.internal.platform.linux_based_platform_backend.html#LinuxBasedPlatformBackend">telemetry.internal.platform.linux_based_platform_backend.LinuxBasedPlatformBackend</a>) |
| </font></dt></dl> |
| </dd> |
| </dl> |
| <p> |
| <table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section"> |
| <tr bgcolor="#ffc8d8"> |
| <td colspan=3 valign=bottom> <br> |
| <font color="#000000" face="helvetica, arial"><a name="LinuxPlatformBackend">class <strong>LinuxPlatformBackend</strong></a>(<a href="telemetry.internal.platform.posix_platform_backend.html#PosixPlatformBackend">telemetry.internal.platform.posix_platform_backend.PosixPlatformBackend</a>, <a href="telemetry.internal.platform.linux_based_platform_backend.html#LinuxBasedPlatformBackend">telemetry.internal.platform.linux_based_platform_backend.LinuxBasedPlatformBackend</a>)</font></td></tr> |
| |
| <tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td> |
| <td width="100%"><dl><dt>Method resolution order:</dt> |
| <dd><a href="telemetry.internal.platform.linux_platform_backend.html#LinuxPlatformBackend">LinuxPlatformBackend</a></dd> |
| <dd><a href="telemetry.internal.platform.posix_platform_backend.html#PosixPlatformBackend">telemetry.internal.platform.posix_platform_backend.PosixPlatformBackend</a></dd> |
| <dd><a href="telemetry.internal.platform.desktop_platform_backend.html#DesktopPlatformBackend">telemetry.internal.platform.desktop_platform_backend.DesktopPlatformBackend</a></dd> |
| <dd><a href="telemetry.internal.platform.linux_based_platform_backend.html#LinuxBasedPlatformBackend">telemetry.internal.platform.linux_based_platform_backend.LinuxBasedPlatformBackend</a></dd> |
| <dd><a href="telemetry.internal.platform.platform_backend.html#PlatformBackend">telemetry.internal.platform.platform_backend.PlatformBackend</a></dd> |
| <dd><a href="__builtin__.html#object">__builtin__.object</a></dd> |
| </dl> |
| <hr> |
| Methods defined here:<br> |
| <dl><dt><a name="LinuxPlatformBackend-CanFlushIndividualFilesFromSystemCache"><strong>CanFlushIndividualFilesFromSystemCache</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-CanLaunchApplication"><strong>CanLaunchApplication</strong></a>(self, application)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-CanMeasurePerApplicationPower"><strong>CanMeasurePerApplicationPower</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-CanMonitorPower"><strong>CanMonitorPower</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-FlushEntireSystemCache"><strong>FlushEntireSystemCache</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-GetArchName"><strong>GetArchName</strong></a>(*args, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-GetOSName"><strong>GetOSName</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-GetOSVersionName"><strong>GetOSVersionName</strong></a>(*args, **kwargs)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-HasBeenThermallyThrottled"><strong>HasBeenThermallyThrottled</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-InstallApplication"><strong>InstallApplication</strong></a>(self, application)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-IsThermallyThrottled"><strong>IsThermallyThrottled</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-ReadMsr"><strong>ReadMsr</strong></a>(self, msr_number, start<font color="#909090">=0</font>, length<font color="#909090">=64</font>)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-StartMonitoringPower"><strong>StartMonitoringPower</strong></a>(self, browser)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-StopMonitoringPower"><strong>StopMonitoringPower</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-__init__"><strong>__init__</strong></a>(self)</dt></dl> |
| |
| <hr> |
| Class methods defined here:<br> |
| <dl><dt><a name="LinuxPlatformBackend-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> |
| |
| <hr> |
| Methods inherited from <a href="telemetry.internal.platform.posix_platform_backend.html#PosixPlatformBackend">telemetry.internal.platform.posix_platform_backend.PosixPlatformBackend</a>:<br> |
| <dl><dt><a name="LinuxPlatformBackend-GetChildPids"><strong>GetChildPids</strong></a>(self, pid)</dt><dd><tt>Returns a list of child pids of |pid|.</tt></dd></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-GetCommandLine"><strong>GetCommandLine</strong></a>(self, pid)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-GetFileContents"><strong>GetFileContents</strong></a>(self, path)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-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> |
| Subclass should override this function.<br> |
| <br> |
| Args:<br> |
| columns: A list of require columns, e.g., ['pid', 'pss'].<br> |
| pid: If not None, returns only the information of the process<br> |
| with the pid.</tt></dd></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-IsApplicationRunning"><strong>IsApplicationRunning</strong></a>(self, application)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-LaunchApplication"><strong>LaunchApplication</strong></a>(self, application, parameters<font color="#909090">=None</font>, elevate_privilege<font color="#909090">=False</font>)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-RunCommand"><strong>RunCommand</strong></a>(self, args)</dt></dl> |
| |
| <hr> |
| Methods inherited from <a href="telemetry.internal.platform.desktop_platform_backend.html#DesktopPlatformBackend">telemetry.internal.platform.desktop_platform_backend.DesktopPlatformBackend</a>:<br> |
| <dl><dt><a name="LinuxPlatformBackend-FlushSystemCacheForDirectory"><strong>FlushSystemCacheForDirectory</strong></a>(self, directory)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-GetDeviceTypeName"><strong>GetDeviceTypeName</strong></a>(self)</dt></dl> |
| |
| <hr> |
| Methods inherited from <a href="telemetry.internal.platform.linux_based_platform_backend.html#LinuxBasedPlatformBackend">telemetry.internal.platform.linux_based_platform_backend.LinuxBasedPlatformBackend</a>:<br> |
| <dl><dt><a name="LinuxPlatformBackend-GetClockTicks"><strong>GetClockTicks</strong></a>(*args, **kwargs)</dt><dd><tt>Returns the number of clock ticks per second.<br> |
| <br> |
| The proper way is to call os.sysconf('SC_CLK_TCK') but that is not easy to<br> |
| do on Android/CrOS. In practice, nearly all Linux machines have a USER_HZ<br> |
| of 100, so just return that.</tt></dd></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-GetCpuStats"><strong>GetCpuStats</strong></a>(self, pid)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-GetCpuTimestamp"><strong>GetCpuTimestamp</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-GetMemoryStats"><strong>GetMemoryStats</strong></a>(self, pid)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-GetSystemCommitCharge"><strong>GetSystemCommitCharge</strong></a>(self)</dt><dd><tt># Get the commit charge in kB.</tt></dd></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-GetSystemTotalPhysicalMemory"><strong>GetSystemTotalPhysicalMemory</strong></a>(*args, **kwargs)</dt></dl> |
| |
| <hr> |
| Static methods inherited from <a href="telemetry.internal.platform.linux_based_platform_backend.html#LinuxBasedPlatformBackend">telemetry.internal.platform.linux_based_platform_backend.LinuxBasedPlatformBackend</a>:<br> |
| <dl><dt><a name="LinuxPlatformBackend-ParseCStateSample"><strong>ParseCStateSample</strong></a>(sample)</dt><dd><tt>Parse a single c-state residency sample.<br> |
| <br> |
| Args:<br> |
| sample: A sample of c-state residency times to be parsed. Organized as<br> |
| a dictionary mapping CPU name to a string containing all c-state<br> |
| names, the times in each state, the latency of each state, and the<br> |
| time at which the sample was taken all separated by newlines.<br> |
| Ex: {'cpu0': 'C0<br> |
| C1<br> |
| 5000<br> |
| 2000<br> |
| 20<br> |
| 30<br> |
| 1406673171'}<br> |
| <br> |
| Returns:<br> |
| Dictionary associating a c-state with a time.</tt></dd></dl> |
| |
| <hr> |
| Methods inherited from <a href="telemetry.internal.platform.platform_backend.html#PlatformBackend">telemetry.internal.platform.platform_backend.PlatformBackend</a>:<br> |
| <dl><dt><a name="LinuxPlatformBackend-CanCaptureVideo"><strong>CanCaptureVideo</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-CanMonitorNetworkData"><strong>CanMonitorNetworkData</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-CanMonitorThermalThrottling"><strong>CanMonitorThermalThrottling</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-CanTakeScreenshot"><strong>CanTakeScreenshot</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-CooperativelyShutdown"><strong>CooperativelyShutdown</strong></a>(self, proc, app_name)</dt><dd><tt>Cooperatively shut down the given process from subprocess.Popen.<br> |
| <br> |
| Currently this is only implemented on Windows. See<br> |
| crbug.com/424024 for background on why it was added.<br> |
| <br> |
| Args:<br> |
| proc: a process object returned from subprocess.Popen.<br> |
| app_name: on Windows, is the prefix of the application's window<br> |
| class name that should be searched for. This helps ensure<br> |
| that only the application's windows are closed.<br> |
| <br> |
| Returns True if it is believed the attempt succeeded.</tt></dd></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-DidCreateBrowser"><strong>DidCreateBrowser</strong></a>(self, browser, browser_backend)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-DidStartBrowser"><strong>DidStartBrowser</strong></a>(self, browser, browser_backend)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-FlushDnsCache"><strong>FlushDnsCache</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-GetNetworkData"><strong>GetNetworkData</strong></a>(self, browser)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-GetRemotePort"><strong>GetRemotePort</strong></a>(self, port)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-InitPlatformBackend"><strong>InitPlatformBackend</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-IsCooperativeShutdownSupported"><strong>IsCooperativeShutdownSupported</strong></a>(self)</dt><dd><tt>Indicates whether CooperativelyShutdown, below, is supported.<br> |
| It is not necessary to implement it on all platforms.</tt></dd></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-IsDisplayTracingSupported"><strong>IsDisplayTracingSupported</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-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> |
| Args:<br> |
| path: path in request.<br> |
| timeout: timeout.<br> |
| retries: num of retries.<br> |
| Return:<br> |
| Whether the path exists on the target platform.</tt></dd></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-PurgeUnpinnedMemory"><strong>PurgeUnpinnedMemory</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-SetFullPerformanceModeEnabled"><strong>SetFullPerformanceModeEnabled</strong></a>(self, enabled)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-SetPlatform"><strong>SetPlatform</strong></a>(self, platform)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-StartDisplayTracing"><strong>StartDisplayTracing</strong></a>(self)</dt><dd><tt>Start gathering a trace with frame timestamps close to physical<br> |
| display.</tt></dd></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-StartVideoCapture"><strong>StartVideoCapture</strong></a>(self, min_bitrate_mbps)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-StopDisplayTracing"><strong>StopDisplayTracing</strong></a>(self)</dt><dd><tt>Stop gathering a trace with frame timestamps close to physical display.<br> |
| <br> |
| Returns a raw tracing events that contains the timestamps of physical<br> |
| display.</tt></dd></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-StopVideoCapture"><strong>StopVideoCapture</strong></a>(self)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-TakeScreenshot"><strong>TakeScreenshot</strong></a>(self, file_path)</dt></dl> |
| |
| <dl><dt><a name="LinuxPlatformBackend-WillCloseBrowser"><strong>WillCloseBrowser</strong></a>(self, browser, browser_backend)</dt></dl> |
| |
| <hr> |
| Class methods inherited from <a href="telemetry.internal.platform.platform_backend.html#PlatformBackend">telemetry.internal.platform.platform_backend.PlatformBackend</a>:<br> |
| <dl><dt><a name="LinuxPlatformBackend-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> |
| |
| <dl><dt><a name="LinuxPlatformBackend-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> |
| device.</tt></dd></dl> |
| |
| <hr> |
| Data descriptors inherited from <a href="telemetry.internal.platform.platform_backend.html#PlatformBackend">telemetry.internal.platform.platform_backend.PlatformBackend</a>:<br> |
| <dl><dt><strong>__dict__</strong></dt> |
| <dd><tt>dictionary for instance variables (if defined)</tt></dd> |
| </dl> |
| <dl><dt><strong>__weakref__</strong></dt> |
| <dd><tt>list of weak references to the object (if defined)</tt></dd> |
| </dl> |
| <dl><dt><strong>forwarder_factory</strong></dt> |
| </dl> |
| <dl><dt><strong>is_host_platform</strong></dt> |
| </dl> |
| <dl><dt><strong>is_video_capture_running</strong></dt> |
| </dl> |
| <dl><dt><strong>network_controller_backend</strong></dt> |
| </dl> |
| <dl><dt><strong>platform</strong></dt> |
| </dl> |
| <dl><dt><strong>running_browser_backends</strong></dt> |
| </dl> |
| <dl><dt><strong>tracing_controller_backend</strong></dt> |
| </dl> |
| <dl><dt><strong>wpr_ca_cert_path</strong></dt> |
| </dl> |
| <dl><dt><strong>wpr_http_device_port</strong></dt> |
| </dl> |
| <dl><dt><strong>wpr_https_device_port</strong></dt> |
| </dl> |
| </td></tr></table></td></tr></table> |
| </body></html> |