Commit 95f711c1 authored by primiano's avatar primiano Committed by Commit bot

[memory-inspector] Add prebuilts for Android x86/x86_64

This change also:
 - adds x86/x86_64 in the list of supported ABIs.
 - adjusts the regexp of the REST endpoints to support the emulator:
   the old regex was using \w+ to match the device serial, which
   doesn't work with the cases such as "emulator-1234".

TBR=primiano@chromium.org
BUG=

Review URL: https://codereview.chromium.org/887583004

Cr-Commit-Position: refs/heads/master@{#314396}
parent 34477f12
{ {
"name": "Memory Inspector", "name": "Memory Inspector",
"description": "Memory inspector tool for Android", "description": "Memory inspector tool for Android",
"version": "0.1.2", "version": "0.1.3",
"manifest_version": 2, "manifest_version": 2,
"icons": { "icons": {
"16": "images/icon_16.png", "16": "images/icon_16.png",
......
...@@ -27,8 +27,8 @@ from memory_inspector.core import native_heap ...@@ -27,8 +27,8 @@ from memory_inspector.core import native_heap
from memory_inspector.core import symbol from memory_inspector.core import symbol
_SUPPORTED_32BIT_ABIS = {'armeabi': 'arm', 'armeabi-v7a': 'arm'} _SUPPORTED_32BIT_ABIS = {'armeabi': 'arm', 'armeabi-v7a': 'arm', 'x86': 'x86'}
_SUPPORTED_64BIT_ABIS = {'arm64-v8a': 'arm64'} _SUPPORTED_64BIT_ABIS = {'arm64-v8a': 'arm64', 'x86_64': 'x86_64'}
_MEMDUMP_PREBUILT_PATH = os.path.join(constants.PREBUILTS_PATH, _MEMDUMP_PREBUILT_PATH = os.path.join(constants.PREBUILTS_PATH,
'memdump-android-%(arch)s') 'memdump-android-%(arch)s')
_MEMDUMP_PATH_ON_DEVICE = '/data/local/tmp/memdump' _MEMDUMP_PATH_ON_DEVICE = '/data/local/tmp/memdump'
......
...@@ -141,7 +141,7 @@ def _ListDevices(args, req_vars): # pylint: disable=W0613 ...@@ -141,7 +141,7 @@ def _ListDevices(args, req_vars): # pylint: disable=W0613
return _HTTP_OK, [], resp return _HTTP_OK, [], resp
@AjaxHandler(r'/ajax/dump/mmap/(\w+)/(\w+)/(\d+)') @AjaxHandler(r'/ajax/dump/mmap/([^/]+)/([^/]+)/(\d+)')
def _DumpMmapsForProcess(args, req_vars): # pylint: disable=W0613 def _DumpMmapsForProcess(args, req_vars): # pylint: disable=W0613
"""Dumps memory maps for a process. """Dumps memory maps for a process.
...@@ -158,7 +158,7 @@ def _DumpMmapsForProcess(args, req_vars): # pylint: disable=W0613 ...@@ -158,7 +158,7 @@ def _DumpMmapsForProcess(args, req_vars): # pylint: disable=W0613
return _HTTP_OK, [], {'table': table, 'id': cache_id} return _HTTP_OK, [], {'table': table, 'id': cache_id}
@AjaxHandler('/ajax/initialize/(\w+)/(\w+)$', 'POST') @AjaxHandler('/ajax/initialize/([^/]+)/([^/]+)$', 'POST')
def _InitializeDevice(args, req_vars): # pylint: disable=W0613 def _InitializeDevice(args, req_vars): # pylint: disable=W0613
device = _GetDevice(args) device = _GetDevice(args)
if not device: if not device:
...@@ -258,7 +258,7 @@ def _CreateProfile(args, req_vars): # pylint: disable=W0613 ...@@ -258,7 +258,7 @@ def _CreateProfile(args, req_vars): # pylint: disable=W0613
'rootBucket': first_snapshot.total.name + '/'} 'rootBucket': first_snapshot.total.name + '/'}
@AjaxHandler(r'/ajax/profile/(\w+)/tree/(\d+)/(\d+)') @AjaxHandler(r'/ajax/profile/([^/]+)/tree/(\d+)/(\d+)')
def _GetProfileTreeDataForSnapshot(args, req_vars): # pylint: disable=W0613 def _GetProfileTreeDataForSnapshot(args, req_vars): # pylint: disable=W0613
"""Gets the data for the tree chart for a given time and metric. """Gets the data for the tree chart for a given time and metric.
...@@ -296,7 +296,7 @@ def _GetProfileTreeDataForSnapshot(args, req_vars): # pylint: disable=W0613 ...@@ -296,7 +296,7 @@ def _GetProfileTreeDataForSnapshot(args, req_vars): # pylint: disable=W0613
return _HTTP_OK, [], resp return _HTTP_OK, [], resp
@AjaxHandler(r'/ajax/profile/(\w+)/time_serie/(\d+)/(.*)$') @AjaxHandler(r'/ajax/profile/([^/]+)/time_serie/(\d+)/(.*)$')
def _GetTimeSerieForSnapshot(args, req_vars): # pylint: disable=W0613 def _GetTimeSerieForSnapshot(args, req_vars): # pylint: disable=W0613
"""Gets the data for the area chart for a given metric and bucket. """Gets the data for the area chart for a given metric and bucket.
...@@ -362,7 +362,7 @@ def _ListProfilingRules(args, req_vars): # pylint: disable=W0613 ...@@ -362,7 +362,7 @@ def _ListProfilingRules(args, req_vars): # pylint: disable=W0613
return _HTTP_OK, [], resp return _HTTP_OK, [], resp
@AjaxHandler(r'/ajax/ps/(\w+)/(\w+)$') # /ajax/ps/Android/a0b1c2[?all=1] @AjaxHandler(r'/ajax/ps/([^/]+)/([^/]+)$') # /ajax/ps/Android/a0b1c2[?all=1]
def _ListProcesses(args, req_vars): # pylint: disable=W0613 def _ListProcesses(args, req_vars): # pylint: disable=W0613
"""Lists processes and their CPU / mem stats. """Lists processes and their CPU / mem stats.
...@@ -395,7 +395,7 @@ def _ListProcesses(args, req_vars): # pylint: disable=W0613 ...@@ -395,7 +395,7 @@ def _ListProcesses(args, req_vars): # pylint: disable=W0613
return _HTTP_OK, [], resp return _HTTP_OK, [], resp
@AjaxHandler(r'/ajax/stats/(\w+)/(\w+)$') # /ajax/stats/Android/a0b1c2 @AjaxHandler(r'/ajax/stats/([^/]+)/([^/]+)$') # /ajax/stats/Android/a0b1c2
def _GetDeviceStats(args, req_vars): # pylint: disable=W0613 def _GetDeviceStats(args, req_vars): # pylint: disable=W0613
"""Lists device CPU / mem stats. """Lists device CPU / mem stats.
...@@ -440,7 +440,7 @@ def _GetDeviceStats(args, req_vars): # pylint: disable=W0613 ...@@ -440,7 +440,7 @@ def _GetDeviceStats(args, req_vars): # pylint: disable=W0613
return _HTTP_OK, [], {'cpu': cpu_stats, 'mem': mem_stats} return _HTTP_OK, [], {'cpu': cpu_stats, 'mem': mem_stats}
@AjaxHandler(r'/ajax/stats/(\w+)/(\w+)/(\d+)$') # /ajax/stats/Android/a0b1c2/42 @AjaxHandler(r'/ajax/stats/([^/]+)/([^/]+)/(\d+)$') # /ajax/stats/Android/a0/3
def _GetProcessStats(args, req_vars): # pylint: disable=W0613 def _GetProcessStats(args, req_vars): # pylint: disable=W0613
"""Lists CPU / mem stats for a given process (and keeps history). """Lists CPU / mem stats for a given process (and keeps history).
...@@ -490,7 +490,7 @@ def _GetProcessStats(args, req_vars): # pylint: disable=W0613 ...@@ -490,7 +490,7 @@ def _GetProcessStats(args, req_vars): # pylint: disable=W0613
return _HTTP_OK, [], {'cpu': cpu_stats, 'mem': mem_stats} return _HTTP_OK, [], {'cpu': cpu_stats, 'mem': mem_stats}
@AjaxHandler(r'/ajax/settings/(\w+)/?(\w+)?$') # /ajax/settings/Android[/id] @AjaxHandler(r'/ajax/settings/([^/]+)/?(\w+)?$') # /ajax/settings/Android[/id]
def _GetDeviceOrBackendSettings(args, req_vars): # pylint: disable=W0613 def _GetDeviceOrBackendSettings(args, req_vars): # pylint: disable=W0613
backend = backends.GetBackend(args[0]) backend = backends.GetBackend(args[0])
if not backend: if not backend:
...@@ -511,7 +511,7 @@ def _GetDeviceOrBackendSettings(args, req_vars): # pylint: disable=W0613 ...@@ -511,7 +511,7 @@ def _GetDeviceOrBackendSettings(args, req_vars): # pylint: disable=W0613
return _HTTP_OK, [], resp return _HTTP_OK, [], resp
@AjaxHandler(r'/ajax/settings/(\w+)/?(\w+)?$', 'POST') @AjaxHandler(r'/ajax/settings/([^/]+)/?(\w+)?$', 'POST')
def _SetDeviceOrBackendSettings(args, req_vars): # pylint: disable=W0613 def _SetDeviceOrBackendSettings(args, req_vars): # pylint: disable=W0613
backend = backends.GetBackend(args[0]) backend = backends.GetBackend(args[0])
if not backend: if not backend:
...@@ -617,7 +617,7 @@ def _LoadNheapFromStorage(args, req_vars): ...@@ -617,7 +617,7 @@ def _LoadNheapFromStorage(args, req_vars):
# /ajax/tracer/start/Android/device-id/pid # /ajax/tracer/start/Android/device-id/pid
@AjaxHandler(r'/ajax/tracer/start/(\w+)/(\w+)/(\d+)', 'POST') @AjaxHandler(r'/ajax/tracer/start/([^/]+)/([^/]+)/(\d+)', 'POST')
def _StartTracer(args, req_vars): def _StartTracer(args, req_vars):
for arg in 'interval', 'count', 'traceNativeHeap': for arg in 'interval', 'count', 'traceNativeHeap':
assert(arg in req_vars), 'Expecting %s argument in POST data' % arg assert(arg in req_vars), 'Expecting %s argument in POST data' % arg
......
13cfc6bf8d706c2faba9d38b0fb38e98a059d1e3
\ No newline at end of file
56847334a1a2433ae42a31bcbb0d5f962f2d5a34
\ No newline at end of file
efa81d9b76f78e01936e760f3c6627361791e485
\ No newline at end of file
28c7fc4438a22086f1fb62e214b459ae2e7406a8
\ No newline at end of file
d286590ab11556d044bb1c82b960ef590b427fec
\ No newline at end of file
a8bd66274b5a8e0dc486a3ce554804dbf331e791
\ No newline at end of file
9ba72bd7ebb8626bf4dc130a4a777141ba204358
\ No newline at end of file
d328cded2aae293c9faf1d87599dbbadcc415dd2
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment