<feed xmlns='http://www.w3.org/2005/Atom'>
<title>replicant/core/libbacktrace/UnwindStackMap.cpp, branch replicant-9</title>
<subtitle>Patches not merged yet, used for building and testing them
</subtitle>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/'/>
<entry>
<title>Add a MemoryOfflineBuffer object.</title>
<updated>2018-04-04T19:29:25+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2018-04-03T23:03:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=f4e3ff6619f34c1b9f1f71fb4050e6bea9f65ead'/>
<id>f4e3ff6619f34c1b9f1f71fb4050e6bea9f65ead</id>
<content type='text'>
Use this for offline stack data so that it's not necessary to
copy any data around.

Add unit tests for the new object.

Bug: 77258731
Bug: 74354410

Test: Ran libunwindstack/libbacktrace unit tests.
Change-Id: I9b0f25d9520c96e64aedef5f295423c60ddb3488
(cherry picked from commit 6633b0ca090dd3da45b8936d587a1316401e46ba)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use this for offline stack data so that it's not necessary to
copy any data around.

Add unit tests for the new object.

Bug: 77258731
Bug: 74354410

Test: Ran libunwindstack/libbacktrace unit tests.
Change-Id: I9b0f25d9520c96e64aedef5f295423c60ddb3488
(cherry picked from commit 6633b0ca090dd3da45b8936d587a1316401e46ba)
</pre>
</div>
</content>
</entry>
<entry>
<title>Modify the offline handling interface.</title>
<updated>2018-02-23T17:14:06+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2018-02-23T03:42:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=432981b9055b411c4f4f1c5d6f60c94f8648c0b7'/>
<id>432981b9055b411c4f4f1c5d6f60c94f8648c0b7</id>
<content type='text'>
- Add a new function Backtrace::UnwindOffline that takes the stack data.
- Modify BacktraceMap::CreateOffline so it doesn't take the stack data.
  This makes it easier to reuse the map object created this way.

Reusing the map object increases simpleperf speed (unwinds per second) by 50%.

Test: backtrace_test libunwindstack_test
Change-Id: I90cfbae9e50d95d8a0e3cd394b33ba36d65d45f7
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
- Add a new function Backtrace::UnwindOffline that takes the stack data.
- Modify BacktraceMap::CreateOffline so it doesn't take the stack data.
  This makes it easier to reuse the map object created this way.

Reusing the map object increases simpleperf speed (unwinds per second) by 50%.

Test: backtrace_test libunwindstack_test
Change-Id: I90cfbae9e50d95d8a0e3cd394b33ba36d65d45f7
</pre>
</div>
</content>
</entry>
<entry>
<title>Load dex files from ART-specific data structure.</title>
<updated>2018-02-02T23:03:00+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2018-02-01T03:05:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=7747b60faa5dcfd43d920c1e60abdab1150aab32'/>
<id>7747b60faa5dcfd43d920c1e60abdab1150aab32</id>
<content type='text'>
Fixes cdex which was recently changed to have shared data section,
which means the DEX PC cannot be used to find the right symbol,
as the bytecode is no longer within the dex file, and in-fact,
we might have to scan multiple dex files to find the method.

Bug: 72520014
Test: testrunner.py --host --cdex-none -t 137
Test: testrunner.py --host --cdex-fast -t 137
Test: All unit tests pass.
Change-Id: I80265d05ad69dd9cefbe3f8a75e4cd349002af5e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes cdex which was recently changed to have shared data section,
which means the DEX PC cannot be used to find the right symbol,
as the bytecode is no longer within the dex file, and in-fact,
we might have to scan multiple dex files to find the method.

Bug: 72520014
Test: testrunner.py --host --cdex-none -t 137
Test: testrunner.py --host --cdex-fast -t 137
Test: All unit tests pass.
Change-Id: I80265d05ad69dd9cefbe3f8a75e4cd349002af5e
</pre>
</div>
</content>
</entry>
<entry>
<title>Move dex pc frame creation into libunwindstack.</title>
<updated>2018-01-31T22:19:42+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2018-01-31T03:47:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=d70ea5ea8511ae9b9ae57b17390e4027d20e3390'/>
<id>d70ea5ea8511ae9b9ae57b17390e4027d20e3390</id>
<content type='text'>
Test: Compiles, all unit tests pass.
Test: Ran 137-cfi art test in interpreter and verified interpreter
Test: frames still show up.

Change-Id: Icea90194986faa733a873e8cf467fc2513eb5573
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Test: Compiles, all unit tests pass.
Test: Ran 137-cfi art test in interpreter and verified interpreter
Test: frames still show up.

Change-Id: Icea90194986faa733a873e8cf467fc2513eb5573
</pre>
</div>
</content>
</entry>
<entry>
<title>Use new unwinder for offline in libbacktrace.</title>
<updated>2018-01-29T18:41:11+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2017-12-12T01:44:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=c8bec5aa91b20b0173bf6bf5f73f9e6daa40519d'/>
<id>c8bec5aa91b20b0173bf6bf5f73f9e6daa40519d</id>
<content type='text'>
libbbacktrace changes:
- Completely rewrite the BacktraceOffline class to use the new unwinder.
- Modify the test data to save ucontext_t data instead of unw_context data.
- Convert the previous tests from unw_context data to ucontext_t data.

Bug: 65682279

Test: New unit tests pass in libunwindstack.
Test: All offline tests continue to pass.
Change-Id: I540345c304b20199d46deeb0349a0638a0f3ab2f
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
libbbacktrace changes:
- Completely rewrite the BacktraceOffline class to use the new unwinder.
- Modify the test data to save ucontext_t data instead of unw_context data.
- Convert the previous tests from unw_context data to ucontext_t data.

Bug: 65682279

Test: New unit tests pass in libunwindstack.
Test: All offline tests continue to pass.
Change-Id: I540345c304b20199d46deeb0349a0638a0f3ab2f
</pre>
</div>
</content>
</entry>
<entry>
<title>Add extra frame when dex_pc is non-zero.</title>
<updated>2018-01-23T21:17:48+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2018-01-19T18:26:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=0b06a590d9d949b9738266488d7fd2bc2d0b0557'/>
<id>0b06a590d9d949b9738266488d7fd2bc2d0b0557</id>
<content type='text'>
Use the art dex file library to read the dex data.

Add unit tests for the UnwindDexFile code.

Bug: 72070049

Test: All unit tests continue to pass.
Test: Dumped the backtrace of the 137-cfi test while running in interpreter
Test: mode and verified that the stack trace is correct. Did this on host
Test: and for arm/arm64.

Change-Id: Ia6f343318c5dd6968a954015a7d59fdf101575b0
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use the art dex file library to read the dex data.

Add unit tests for the UnwindDexFile code.

Bug: 72070049

Test: All unit tests continue to pass.
Test: Dumped the backtrace of the 137-cfi test while running in interpreter
Test: mode and verified that the stack trace is correct. Did this on host
Test: and for arm/arm64.

Change-Id: Ia6f343318c5dd6968a954015a7d59fdf101575b0
</pre>
</div>
</content>
</entry>
<entry>
<title>Change all uintptr_t to uint64_t in API.</title>
<updated>2018-01-19T01:26:20+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2018-01-18T19:15:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=7937a36c8e24ef2dc5105a2a6b67f395934b2e2f'/>
<id>7937a36c8e24ef2dc5105a2a6b67f395934b2e2f</id>
<content type='text'>
In order to support the offline unwinding properly, get rid of the
usage of non-fixed type uintptr_t from all API calls.

In addition, completely remove the old local and remote unwinding code
that used libunwind.

The next step will be to move the offline unwinding to the new unwinder.

Bug: 65682279

Test: Ran unit tests for libbacktrace/debuggerd.
Test: Ran debuggerd -b on a few arm and arm64 processes.
Test: Ran crasher and crasher64 and verified tombstones look correct.
Change-Id: Ib0c6cee3ad6785a102b74908a3d8e5e93e5c6b33
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In order to support the offline unwinding properly, get rid of the
usage of non-fixed type uintptr_t from all API calls.

In addition, completely remove the old local and remote unwinding code
that used libunwind.

The next step will be to move the offline unwinding to the new unwinder.

Bug: 65682279

Test: Ran unit tests for libbacktrace/debuggerd.
Test: Ran debuggerd -b on a few arm and arm64 processes.
Test: Ran crasher and crasher64 and verified tombstones look correct.
Change-Id: Ib0c6cee3ad6785a102b74908a3d8e5e93e5c6b33
</pre>
</div>
</content>
</entry>
<entry>
<title>Add ability to read jit gdb data.</title>
<updated>2018-01-12T19:18:42+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2017-12-21T02:49:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=150db124f3f3c0f8e1c341fd33c6c64310e0ac39'/>
<id>150db124f3f3c0f8e1c341fd33c6c64310e0ac39</id>
<content type='text'>
Changes:
- New JitDebug class to handle all of the jit gdb interface.
- Add unit tests for all, along with new offline test using debug data.
- Add new Memory type called MemoryOfflineParts that has multiple
  MemoryOffline objects to support the offline test.
- Update the tools to use the JitDebug object.
- Modify libbacktrace to use the JitDebug, but only looking in libart.so
  and libartd.so.
- Change the Format32Bits to Is32Bit since it's more accurate and I use
  it in a different context where original name didn't make sense.
- Add a new function to find global variables in an elf file
  (GetGlobalVariable).
- Add a new function to determine if a pc is valid for this elf (IsValidPc).

Bug: 68396769

Test: Ran new unit tests. Added new offline test that uses jit debug data.
Test: Ran art test that generates jit data and verified a crash unwinds
Test: through the jit data.
Change-Id: I6e7ee2f5bab2242028a06feece156dff21c0a974
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Changes:
- New JitDebug class to handle all of the jit gdb interface.
- Add unit tests for all, along with new offline test using debug data.
- Add new Memory type called MemoryOfflineParts that has multiple
  MemoryOffline objects to support the offline test.
- Update the tools to use the JitDebug object.
- Modify libbacktrace to use the JitDebug, but only looking in libart.so
  and libartd.so.
- Change the Format32Bits to Is32Bit since it's more accurate and I use
  it in a different context where original name didn't make sense.
- Add a new function to find global variables in an elf file
  (GetGlobalVariable).
- Add a new function to determine if a pc is valid for this elf (IsValidPc).

Bug: 68396769

Test: Ran new unit tests. Added new offline test that uses jit debug data.
Test: Ran art test that generates jit data and verified a crash unwinds
Test: through the jit data.
Change-Id: I6e7ee2f5bab2242028a06feece156dff21c0a974
</pre>
</div>
</content>
</entry>
<entry>
<title>Demand read load bias for a map.</title>
<updated>2017-12-05T21:12:47+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2017-12-02T05:37:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=b7de5f542925216dbb8b7124260d2915570598d1'/>
<id>b7de5f542925216dbb8b7124260d2915570598d1</id>
<content type='text'>
Add a static GetLoadBias method to the Elf object that only reads just
enough to get the load bias.

Add a method to MapInfo that gets the load bias. First attempt to get
it if the elf object already exists. If no elf object was created, use
the new static method to get the load bias.

In BacktraceMap, add a custom iterator so that when code dereferences
a map element, that's when the load bias will be retrieved if it hasn't
already been set.

Bug: 69871050

Test: New unit tests, verify tombstones have non-zero load bias values for
Test: libraries with a non-zero load bias.
Change-Id: I125f4abc827589957fce2f0df24b0f25d037d732
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a static GetLoadBias method to the Elf object that only reads just
enough to get the load bias.

Add a method to MapInfo that gets the load bias. First attempt to get
it if the elf object already exists. If no elf object was created, use
the new static method to get the load bias.

In BacktraceMap, add a custom iterator so that when code dereferences
a map element, that's when the load bias will be retrieved if it hasn't
already been set.

Bug: 69871050

Test: New unit tests, verify tombstones have non-zero load bias values for
Test: libraries with a non-zero load bias.
Change-Id: I125f4abc827589957fce2f0df24b0f25d037d732
</pre>
</div>
</content>
</entry>
<entry>
<title>Allow multiple threads sharing a map to unwind.</title>
<updated>2017-11-28T23:20:38+00:00</updated>
<author>
<name>Christopher Ferris</name>
<email>cferris@google.com</email>
</author>
<published>2017-11-27T22:50:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.replicant.us/contrib/GNUtoo/replicant/core/commit/?id=be788d891da26943b1ad6abe0f07a8745fa676d5'/>
<id>be788d891da26943b1ad6abe0f07a8745fa676d5</id>
<content type='text'>
Add a mutex in MapInfo, and a mutex in Elf. Lock the creation of an Elf
file using the MapInfo mutex, and lock when calling Step, GetFunctionName,
or GetSoname since they can modify information in the object. It might
be beneficial to use a fine grained lock in the future.

Change the Maps object to contain a vector of MapInfo pointers rather
than the total objects. This avoids copying this data around.

Add a test to libbacktrace to verify that sharing a map while doing
unwinds in different threads works.

Add concurrency tests in libunwindstack to verify the locking works.

Add always inline to the RegsGetLocal arm and aarch64 functions. I had
a case where clang did not inline the code, so make sure this is specified.

Bug: 68813077

Test: New unit tests to cover the case. Passes all unit tests.
Test: Ran a monkey test while dumping bugreports and verified that
Test: no crashes in libunwind.
Test: Remove the locking and verified that all of the concurrenty tests fail.
Change-Id: I769e728c676f6bdae9e64ce4cdc03b6749beae03
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Add a mutex in MapInfo, and a mutex in Elf. Lock the creation of an Elf
file using the MapInfo mutex, and lock when calling Step, GetFunctionName,
or GetSoname since they can modify information in the object. It might
be beneficial to use a fine grained lock in the future.

Change the Maps object to contain a vector of MapInfo pointers rather
than the total objects. This avoids copying this data around.

Add a test to libbacktrace to verify that sharing a map while doing
unwinds in different threads works.

Add concurrency tests in libunwindstack to verify the locking works.

Add always inline to the RegsGetLocal arm and aarch64 functions. I had
a case where clang did not inline the code, so make sure this is specified.

Bug: 68813077

Test: New unit tests to cover the case. Passes all unit tests.
Test: Ran a monkey test while dumping bugreports and verified that
Test: no crashes in libunwind.
Test: Remove the locking and verified that all of the concurrenty tests fail.
Change-Id: I769e728c676f6bdae9e64ce4cdc03b6749beae03
</pre>
</div>
</content>
</entry>
</feed>
