Commit Graph

248 Commits

Author SHA1 Message Date
Shibin George
b971e043f7 native_heapdump_viewer_tests: update ParseNativeHeap() to pass 4 arguments
fca3084 introduced an additional argument to ParseNativeHeap().
This CL updates the test to reflect the same.

Test: "python native_heapdump_viewer_tests.py" executes without
      any errors.

Change-Id: I6c196205ead2cb6abd4a646a3ac53e62ae3e5038
2018-10-06 03:54:13 +00:00
Joel Fernandes
ec9ee7f412 Remove ashmem from development repository
This topic removes ashmem from ART. Changes the names in development/
too. It only affects "dalvik-" ashmem regions which are the majority.

Change-Id: I1186eb60087384847892f655bec8174169ffd6c4
Signed-off-by: Joel Fernandes <joelaf@google.com>
2018-08-24 12:37:52 -07:00
Christopher Ferris
6fc7aefbba Handle IOExceptions if addr2line fails.
Bug: 112357697

Test: Verified that this doesn't cause any issues with a stack.
Test: Faked an exception and verified no crash.
Change-Id: I61982dbd44ac4f52b008bc35bbff2d9687f6ae25
2018-08-10 12:17:51 -07:00
Mathieu Chartier
9e068aa334 Merge "Fix GetMappingFromOffset"
am: 0d2f6425ed

Change-Id: Ib743d58a691dbbe517f7cb4cf3ce37f7ce70000d
2018-08-03 16:34:36 -07:00
Mathieu Chartier
e3503620cd Fix GetMappingFromOffset
Fixed backward calculation of mapping offset.

Added logic to page align the data offset for uncompressed shared
objects. This fixes symbolization.

Bug: 111268230
Test: inspect native heap dump for the Camera app
Change-Id: If1af41e7265f017c1a691008309c8a002d5f588e
2018-08-03 13:26:10 -07:00
Mathieu Chartier
79a4d778f6 Merge "Add logic for replacing maps for zip files"
am: a70bf347f7

Change-Id: Icad4d96f4e083e472b59702e8b801d0e0eb4c1ff
2018-07-31 16:36:07 -07:00
Mathieu Chartier
fca30841f3 Add logic for replacing maps for zip files
For zip files, try to open the file in the current directory and
insert the files as mappings. This enables the script to pick up
embedded .so files.

Added a check to look in current directory before the symbol dir.

Added --app-symbols option to specify the directory containing the
app APK and so files.

Test: manual
Bug: 111268230

(cherry picked from commit b284c20247)

Merged-In: Id1b1f13bac78911daa6a72c35ebfadfdc9c1700f
Change-Id: Ia8d3dd64f16e1d06d929b4023292cb98a438ea3e
2018-07-31 14:24:29 -07:00
Josh Gao
3140c7e495 Merge "pid: switch to pgrep."
am: 3aa9457410

Change-Id: Ie2cbb889773651c922095a7fa7ae983c8431b1d8
2018-07-23 19:00:14 -07:00
Josh Gao
f080bf1f76 pid: switch to pgrep.
Fix a bug where processes that didn't have a leading space from right
justification of the pid column would return the process name instead
of the pid, by switching to pgrep.

Bug: http://b/111748205
Test: manual
Change-Id: I3493474540ccfa89f5bb3e66153d9e96ec8bf1d9
2018-07-23 17:01:42 -07:00
Christopher Ferris
9669de4c9e Merge "Refactor native heap viewer to add tests."
am: cd2f1cfed2

Change-Id: I6580a7d9624f27647f727889efb88f6e24ee0075
2018-07-16 14:28:04 -07:00
Christopher Ferris
dfb5368b57 Refactor native heap viewer to add tests.
This only includes a few tests to start with.

Bug: 62492960

Test: Ran new unit tests.
Test: Ran with all different options and verified it produces the same
Test: output as the previous script.
Change-Id: Iad29a5f04f49986139c92030a3259cae512859af
2018-07-13 14:09:43 -07:00
Christopher Ferris
81052a3c85 Merge "Detect if num field is valid on v1.0 version."
am: 1ae3edd54b

Change-Id: Ie14c18b08b3c8f9079c44645fe1ddb533e439d7b
2018-07-10 14:22:07 -07:00
Christopher Ferris
ad7d5fb378 Detect if num field is valid on v1.0 version.
In Android P, the version field did not get incremented properly in
all places. So if a file with a v1.0 version is found, do a further check
to verify if the num field is really valid.

Test: Verified that a file with v1.0 gets checked and the valid num field
Test: is set correctly.
Test: Verified that a file with v1.1 automatically gets num field set to
Test: valid.
Change-Id: I7f828294c833e334cad76a866bbaa1d78ac02cfb
Merged-In: I7f828294c833e334cad76a866bbaa1d78ac02cfb
(cherry picked from commit b558fe4d53)
2018-07-10 12:25:33 -07:00
Dan Albert
590650db07 Merge "Allow restart in gdbclient."
am: 2e4640f468

Change-Id: I8440c29f0432284a925afa0d6d5748c49bdd4296
2018-06-26 13:22:50 -07:00
Dan Albert
d124bc7562 Allow restart in gdbclient.
Switching from remote to extended-remote allows the program being
debugged to be restarted like a normal non-remote program.

Test: Used gdbclient debugging ICU things for a while, restarted often
Bug: None
Change-Id: Ia295749b9aa86727479d760d7c743f98a06fa6d4
2018-06-26 11:15:16 -07:00
Josh Gao
121c8d9024 Merge changes from topic "stacks_envsetup"
am: 759a6f75ff

Change-Id: I42facf6b00b039e37d62706bde4498117e90ec3f
2018-06-15 08:52:34 -07:00
Josh Gao
3502ceecff Add return code support to pid.
am: 4df6279c71

Change-Id: Ic853345ab244c6848349a99ec732f3b6c9ef87d8
2018-06-15 08:51:58 -07:00
Josh Gao
aa32b1aaa9 Move pid, stacks from envsetup.sh to dedicated scripts.
am: 3dffb8438d

Change-Id: I10024d4978f276286cc6e0e92722c5fc7e62c678
2018-06-15 08:51:21 -07:00
Treehugger Robot
759a6f75ff Merge changes from topic "stacks_envsetup"
* changes:
  stacks: match exactly before matching nonexactly.
  Add return code support to `pid`.
  Move pid, stacks from envsetup.sh to dedicated scripts.
2018-06-15 15:43:37 +00:00
Josh Gao
4df6279c71 Add return code support to pid.
Test: pid nonexistent; echo $?
Test: pid --exact nonexistent; echo $?
Change-Id: If8efb1ca27ae3ed7b5be1c51179fae387c56e305
2018-06-14 16:36:12 -07:00
Josh Gao
3dffb8438d Move pid, stacks from envsetup.sh to dedicated scripts.
Make it so that these can be used in other scripts by moving them from
functions defined in envsetup.sh to standalone scripts.

Test: stacks zygote64
Change-Id: I55ba76b248c54d9193fb019b7f4aca2f4c3a05bd
2018-06-14 16:36:12 -07:00
Josh Gao
91ba53c4b9 stacks: match exactly before matching nonexactly.
`pid zygote` will match zygote64 as well, but someone using `stacks
zygote` clearly wants the 32-bit version. Attempt an exact match before
we try a nonexact one.

Test: stacks zygote
Test: stacks zygote64
Change-Id: I5fd75cdbe4982c7ea831749c9ba823a2451e5490
2018-06-14 16:36:12 -07:00
Andreas Gampe
a5a9763fdb Merge "Script: Fix disassemble_tombstone.py"
am: 9a2f49a71a

Change-Id: I26497e24d245eb0c035b9807bab34c7873abde6b
2018-06-14 08:38:26 -07:00
Andreas Gampe
64676442d4 Script: Fix disassemble_tombstone.py
Update for newer debuggerd output marking the memory dump around
the currently executed code.

Add a hack for ARM assembly: override the assembler-emitted $d
symbol marking all our .byte data, so that objdump will disassemble
as instructions.

Test: manual
Change-Id: I100ed9e0ce39c073d5885cc430d78c24fef38882
2018-06-13 14:32:54 -07:00
Christopher Ferris
7b021e8a83 Merge "Add descriptive text describing html interaction." am: fa6b514d71
am: fb5b466040

Change-Id: I80337ca8d8ab35994d7cb7afbb3f3c4ace8c8851
2018-06-05 12:48:58 -07:00
Christopher Ferris
fbd84e9255 Add descriptive text describing html interaction.
Test: Ran and verified html output is viewable.
Change-Id: I54771bc9b536ff8fbc62dc7e5aac2caa22765e30
2018-06-05 08:46:23 -07:00
Christopher Ferris
ffc868ba1f Merge "Handle num fields that aren't one." am: 51fdbb627f
am: 7b291a7108

Change-Id: I3536bde51bbe798b23b3800d5ab890c60a9df553
2018-05-24 13:18:23 -07:00
Christopher Ferris
bede9f3b3c Handle num fields that aren't one.
The new version of malloc debug supports using a num field that is more
than one. Modify the parser to handle this case.

Bug: 74361929

Test: Ran on a file that contained non-one numbers and verified the output.
Change-Id: I158922e51ce99afff88f20a80df414d653f95e65
2018-05-22 19:02:41 -07:00
Andreas Gampe
07c15fd539 Merge "Scripts: Export symbol.py" am: 4c5c36987a
am: 2f5dcfe651

Change-Id: I358cb6e1e4bff27f4b3c0437bb313f9c491034e1
2018-05-10 14:35:29 -07:00
Andreas Gampe
5bec21433e Scripts: Export symbol.py
Export symbol.py in a python host library called python-symbol.

Bug: 73175642
Test: m
Change-Id: I9503efd339b69f0655db6a3a5cf04a94dac72489
2018-05-09 15:11:06 -07:00
Makoto Onuki
0ffeba64ad Add battery level test script.
Bug: 74120126
Test: manual
Change-Id: I1c05c873642ea4f61771e0c4ea44c70f6214d73b
2018-03-21 15:44:48 -07:00
Elliott Hughes
70b4c54934 Add scripts OWNERS.
Bug: N/A
Test: N/A
Change-Id: I54cfaff7b8f94475692b62394e8da3d866308509
2017-12-14 13:19:30 -08:00
Dan Willemsen
d3fc8faff6 Switch to new soong_ui dumpvar-mode
Stop using make directly.

Test: manual tests
Test: development/scripts/symbol.py
Change-Id: I9f75776251b693dbe979989942d2db49768224d2
2017-10-17 14:10:51 -07:00
Josh Gao
bc82e81e21 Merge "gdbclient.py: don't use make to dump target info."
am: c57aaaf57c

Change-Id: I15177dbcb47333fd2b9b8a713bc3a5a2c1991f09
2017-08-09 21:33:11 +00:00
Treehugger Robot
c57aaaf57c Merge "gdbclient.py: don't use make to dump target info." 2017-08-09 21:18:04 +00:00
Greg Hartman
8697036e17 Merge "Provide a way to disassemble code in a tombstone."
am: d98a584a6d

Change-Id: Ia8c1ae3cb29bab9a147f5d05aa54d50e745eb96a
2017-07-21 02:04:08 +00:00
Greg Hartman
a6e5520bce Provide a way to disassemble code in a tombstone.
Test: ran disassemble_test.py

Change-Id: Id6beb23ff40d72b89b4d8400d645f7f868fd87d2
2017-07-20 16:57:51 -07:00
Josh Gao
466e289dc8 gdbclient.py: don't use make to dump target info.
make dumpvar takes forever (~0.45s per variable on my machine), and the
information we want from it is already available in the environment.
Construct the paths we need ourselves, instead of relying on make to do
it for us, shaving off about a second from a gdbclient.py invocation.

Test: gdbclient.py -r ls
Change-Id: I8c563da726c8f61a23e2eb701f2f272a4c71d713
2017-07-13 15:42:48 -07:00
Kevin Rocard
aef6b1d246 Merge "Resolve gdbclient.py -r executable from target"
am: f45395cec0

Change-Id: I7f38016c99f748f4641cedbbaa045a547db7f8f4
2017-07-13 18:44:42 +00:00
Kevin Rocard
258c89e9e4 Resolve gdbclient.py -r executable from target
gdbclient.py -r allows to provide an executable to be run on the target.
Before this patch the absolute path of the executable had to be
provided. This was inconvenient as the user has to first look up for the
exe on the target before debuging it.

With this patch, gdbclient.py will look for the executable on the
target if an absolute path is not provided.

Test: gdbserver -r ls
Change-Id: I610fd0a57b034ba8864874eeb1f7345d4a7daad9
Signed-off-by: Kevin Rocard <krocard@google.com>
2017-07-12 18:48:16 -07:00
Elliott Hughes
82a266c27b Merge "Fix gdbclient.py -p."
am: 37c32c3162

Change-Id: I051679423bdff53539c4455faa5d73fed2d4c0a8
2017-06-30 23:29:09 +00:00
Elliott Hughes
89e1ecf9a1 Fix gdbclient.py -p.
Bug: http://b/26413900
Test: manually ran gdbserver on device, connected with -p
Change-Id: If58b95e52167c38263e77fe85bea14e0d7401bf4
2017-06-30 14:03:32 -07:00
Kevin Rocard
cd0f76d772 Merge "Warn that gdbclient is deprecated in favor of gdbclient.py" am: 4a419534fe
am: b23457b4be

Change-Id: Ie7c06875fb8edd37c8a11c14a11bff63f3c28511
2017-06-22 17:19:03 +00:00
Kevin Rocard
75b24f1270 Warn that gdbclient is deprecated in favor of gdbclient.py
Users of gdbclient might not know that a new and improved version exist
in the form of gdbclient.py.

Change-Id: I65243a8d25a1ecbe8ff734d0be4dbe40b50db4b2
Signed-off-by: Kevin Rocard <krocard@google.com>
2017-06-21 18:49:50 -07:00
Mathieu Chartier
acf1fb1c63 Merge "Fix potential divide by zero in display_html" am: 524311b26d
am: 41e721028a

Change-Id: Iac24401f1c8370f80824b56d63dffebd36081f13
2017-06-13 20:06:45 +00:00
Mathieu Chartier
9ae5ff4895 Fix potential divide by zero in display_html
When using logwrapper, there is only a zygote heap. This caused
a divide by zero for the app heap.

Test: native_heapdump_viewer.py --html art/native_heap.txt > test.html

Change-Id: I7defd94935d72ee9c4cb6e53d7a1a308a1030eb3
2017-06-13 11:00:26 -07:00
Christopher Ferris
14a8c9175b Merge "Fix potential divide by zero." am: 8d3f61724d
am: 4642158940

Change-Id: Ie3fe2c70a0cc3713cb47c78a10c020e29c42e42f
2017-06-09 22:24:29 +00:00
Christopher Ferris
8d3f61724d Merge "Fix potential divide by zero." 2017-06-09 22:12:22 +00:00
Elliott Hughes
c739b9e711 Merge "Move away from device.get_props." am: 904e475fbd am: 4d8dffffa6
am: 8c19ebd28d

Change-Id: I328be35af1e211412b105345b3d1ca78d24b7528
2017-06-03 01:43:58 +00:00
Elliott Hughes
1a2f12d23e Move away from device.get_props.
Properties can include \n so get_props isn't sound, and it's not obvious how
to fix it (without adding something like cat's -v to getprop, which wouldn't
help the intended use case of working with arbitrary old devices).

Bug: https://issuetracker.google.com/37093233
Test: gdbclient -r /system/bin/date
Change-Id: I96042fd44f1de17974968954fab6c916a9d13b61
2017-06-02 13:15:59 -07:00