• 大小: 2.29MB
    文件类型: .zip
    金币: 1
    下载: 0 次
    发布日期: 2023-10-27
  • 语言: Java
  • 标签: android  SDK  Platform  tools  

资源简介

安卓 Platform-tools 23.01 版本,对于平台工具级别低的小伙伴有很大帮助

资源截图

代码片段和文件信息

#!/usr/bin/env python

# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.

“““Android system-wide tracing utility.

This is a tool for capturing a trace that includes data from both userland and
the kernel.  It creates an HTML file for visualizing the trace.
“““

import errno optparse os select subprocess sys time zlib

# This list is based on the tags in frameworks/native/include/utils/Trace.h.
trace_tag_bits = {
  ‘gfx‘:      1<<1
  ‘input‘:    1<<2
  ‘view‘:     1<<3
  ‘webview‘:  1<<4
  ‘wm‘:       1<<5
  ‘am‘:       1<<6
  ‘sync‘:     1<<7
  ‘audio‘:    1<<8
  ‘video‘:    1<<9
  ‘camera‘:   1<<10
}

flattened_html_file = ‘systrace_trace_viewer.html‘

def add_adb_serial(command serial):
  if serial != None:
    command.insert(1 serial)
    command.insert(1 ‘-s‘)

def main():
  parser = optparse.OptionParser()
  parser.add_option(‘-o‘ dest=‘output_file‘ help=‘write HTML to FILE‘
                    default=‘trace.html‘ metavar=‘FILE‘)
  parser.add_option(‘-t‘ ‘--time‘ dest=‘trace_time‘ type=‘int‘
                    help=‘trace for N seconds‘ metavar=‘N‘)
  parser.add_option(‘-b‘ ‘--buf-size‘ dest=‘trace_buf_size‘ type=‘int‘
                    help=‘use a trace buffer size of N KB‘ metavar=‘N‘)
  parser.add_option(‘-d‘ ‘--disk‘ dest=‘trace_disk‘ default=False
                    action=‘store_true‘ help=‘trace disk I/O (requires root)‘)
  parser.add_option(‘-f‘ ‘--cpu-freq‘ dest=‘trace_cpu_freq‘ default=False
                    action=‘store_true‘ help=‘trace CPU frequency changes‘)
  parser.add_option(‘-i‘ ‘--cpu-idle‘ dest=‘trace_cpu_idle‘ default=False
                    action=‘store_true‘ help=‘trace CPU idle events‘)
  parser.add_option(‘-l‘ ‘--cpu-load‘ dest=‘trace_cpu_load‘ default=False
                    action=‘store_true‘ help=‘trace CPU load‘)
  parser.add_option(‘-s‘ ‘--no-cpu-sched‘ dest=‘trace_cpu_sched‘ default=True
                    action=‘store_false‘ help=‘inhibit tracing CPU ‘ +
                    ‘scheduler (allows longer trace times by reducing data ‘ +
                    ‘rate into buffer)‘)
  parser.add_option(‘-u‘ ‘--bus-utilization‘ dest=‘trace_bus_utilization‘
                    default=False action=‘store_true‘
                    help=‘trace bus utilization (requires root)‘)
  parser.add_option(‘-w‘ ‘--workqueue‘ dest=‘trace_workqueue‘ default=False
                    action=‘store_true‘ help=‘trace the kernel workqueues ‘ +
                    ‘(requires root)‘)
  parser.add_option(‘--set-tags‘ dest=‘set_tags‘ action=‘store‘
                    help=‘set the enabled trace tags and exit; set to a ‘ +
                    ‘comma separated list of: ‘ +
                    ‘ ‘.join(trace_tag_bits.iterkeys()))
  parser.add_option(‘--link-assets‘ dest=‘link_assets‘ default=False
                    action=‘store_true‘ he

 属性            大小     日期    时间   名称
----------- ---------  ---------- -----  ----
     文件      944128  2015-09-09 20:24  platform-tools\adb.exe
     文件       96256  2015-09-09 20:24  platform-tools\AdbWinApi.dll
     文件       60928  2015-09-09 20:24  platform-tools\AdbWinUsbApi.dll
     目录           0  2015-09-09 20:23  platform-tools\api\
     文件     3109346  2015-09-09 20:23  platform-tools\api\api-versions.xml
     文件     1397102  2015-09-09 20:23  platform-tools\api\annotations.zip
     文件       73728  2015-09-09 20:24  platform-tools\dmtracedump.exe
     文件      338944  2015-09-09 20:24  platform-tools\etc1tool.exe
     文件      318464  2015-09-09 20:24  platform-tools\fastboot.exe
     文件       43008  2015-09-09 20:24  platform-tools\hprof-conv.exe
     目录           0  2015-09-09 20:23  platform-tools\lib\
     文件     1121134  2015-09-09 20:23  platform-tools\lib\libc++.so
     文件      220534  2015-09-09 20:23  platform-tools\NOTICE.txt
     文件          38  2015-09-09 20:23  platform-tools\source.properties
     文件      718848  2015-09-09 20:24  platform-tools\sqlite3.exe
     目录           0  2015-09-09 20:23  platform-tools\systrace\
     文件         292  2015-09-09 20:23  platform-tools\systrace\AUTHORS
     文件        1647  2015-09-09 20:23  platform-tools\systrace\systrace_agent.py
     文件        1746  2015-09-09 20:23  platform-tools\systrace\prefix.html
     目录           0  2015-09-09 20:23  platform-tools\systrace\agents\
     文件         161  2015-09-09 20:23  platform-tools\systrace\agents\__init__.py
     文件       18705  2015-09-09 20:23  platform-tools\systrace\agents\atrace_agent.py
     文件     1178662  2015-09-09 20:23  platform-tools\systrace\systrace_trace_viewer.html
     文件          41  2015-09-09 20:23  platform-tools\systrace\UPSTREAM_REVISION
     文件        8263  2015-09-09 20:23  platform-tools\systrace\systrace-legacy.py
     文件          16  2015-09-09 20:23  platform-tools\systrace\suffix.html
     文件       11738  2015-09-09 20:23  platform-tools\systrace\NOTICE
     文件        7283  2015-09-09 20:23  platform-tools\systrace\systrace.py
     文件        3627  2015-09-09 20:23  platform-tools\systrace\util.py
     文件        1563  2015-09-09 20:23  platform-tools\systrace\LICENSE

评论

共有 条评论