OSDN Git Service

android-x86/system-extras.git
4 years agosimpleperf: add periodic callback to flush etm data.
Yabin Cui [Fri, 18 Oct 2019 23:54:47 +0000 (16:54 -0700)]
simpleperf: add periodic callback to flush etm data.

Bug: none
Test: run simpleperf_unit_test.
Test: record etm data manually.
Change-Id: I620bcd0606c5ecf7eb076db503baad7f1a54b1d4

4 years agoMerge "simpleperf: reduce and recover from etm decoding errors."
Yabin Cui [Fri, 18 Oct 2019 23:24:43 +0000 (23:24 +0000)]
Merge "simpleperf: reduce and recover from etm decoding errors."

4 years agosimpleperf: reduce and recover from etm decoding errors.
Yabin Cui [Fri, 18 Oct 2019 21:01:15 +0000 (14:01 -0700)]
simpleperf: reduce and recover from etm decoding errors.

ETM decoding fails when processing some invalid data like invalid packet
headers. Invalid data may be caused by truncated etm data or other
reasons.

Invalid data can be skipped by resetting decoders, which will force
decoders to look for sync points (I_ASYNC packets) in the data stream.

So to fix the problem:
1. Reset decoders when processing a new data block, which avoid invalid
data at the beginning of a block.
2. When having a decoding error, recover from it by resetting decoders.

Bug: none
Test: run simpleperf_unit_test.
Test: record and decode etm data continuously on device.
Change-Id: If44edc04428f22e605afe994aabeb6ff350cffb1

4 years agoMerge "Allow trace files to be zipped or text files."
Christopher Ferris [Fri, 18 Oct 2019 00:54:49 +0000 (00:54 +0000)]
Merge "Allow trace files to be zipped or text files."

4 years agoAllow trace files to be zipped or text files.
Christopher Ferris [Thu, 17 Oct 2019 21:58:57 +0000 (14:58 -0700)]
Allow trace files to be zipped or text files.

Add and update unit tests to verify this behavior.

Test: Ran unit tests.
Test: Ran memory_replay on zipped file and text file.
Test: Ran trace_benchmark.
Change-Id: I296b27902a5a53a130a2c09063efc369830a9d05

4 years agoMerge "simpleperf: update simpleperf prebuilts to build 5933778."
Treehugger Robot [Fri, 11 Oct 2019 21:08:09 +0000 (21:08 +0000)]
Merge "simpleperf: update simpleperf prebuilts to build 5933778."

4 years agosimpleperf: update simpleperf prebuilts to build 5933778.
Yabin Cui [Fri, 11 Oct 2019 17:19:32 +0000 (10:19 -0700)]
simpleperf: update simpleperf prebuilts to build 5933778.

Taken from branch aosp-simpleperf-release.

Bug: none
Test: run test.py on linux.

Change-Id: I79ccb883d484812866e6f11d494ee8c5c6042856

4 years agoMerge "simpleperf: change based on jit debug interface change."
Yabin Cui [Fri, 11 Oct 2019 00:22:16 +0000 (00:22 +0000)]
Merge "simpleperf: change based on jit debug interface change."

4 years agosimpleperf: change based on jit debug interface change.
Yabin Cui [Mon, 7 Oct 2019 22:15:12 +0000 (15:15 -0700)]
simpleperf: change based on jit debug interface change.

1. Change magic field and sizeof_entry check for JITDescriptor.
2. Use seqlock field in JITCodeEntryV2 to check its valid.
3. Allow but skip entry with symfile_size = 0 in V2.

Bug: 141558390
Test: run simpleperf_unit_test.
Change-Id: I30e214597cec78c73492fdfeac1f9766b775f0e3

4 years agoMerge "simpleperf: create one map for each jit symbol."
Yabin Cui [Wed, 9 Oct 2019 17:14:43 +0000 (17:14 +0000)]
Merge "simpleperf: create one map for each jit symbol."

4 years agoMerge "simpleperf: merge jitted and interpreted java methods."
Yabin Cui [Tue, 8 Oct 2019 23:10:18 +0000 (23:10 +0000)]
Merge "simpleperf: merge jitted and interpreted java methods."

4 years agosimpleperf: merge jitted and interpreted java methods.
Yabin Cui [Tue, 8 Oct 2019 00:44:05 +0000 (17:44 -0700)]
simpleperf: merge jitted and interpreted java methods.

Bug: 132370901
Test: run test.py TestReportLib.test_merge_java_methods.

Change-Id: I9e2cc9a0db6a6f94611947c4f146a51aff85d593

4 years agosimpleperf: create one map for each jit symbol.
Yabin Cui [Mon, 7 Oct 2019 22:57:56 +0000 (15:57 -0700)]
simpleperf: create one map for each jit symbol.

JIT debug interface in ART regularly repacks jit symbols, making
overlapped jit symfile maps:
For example, jit symfile A contains many symbols, in addr range [0xa000, 0xb000),
but excluding [0xa100, 0xa110]. And jit symfile B contains only one symbol, in
addr range [0xa100, 0xa108).
So jit symfile A and B have overlapped addr range, while the symbols in
them are all valid.

Simpleperf can't keep maps with overlapped addr range, thus fails to unwind in
this situation.
Fix it by creating one map for each jit symbol instead of jit symfile.

Bug: none
Test: run simpleperf_unit_test.
Test: run test.py TestRecordingRealApps.test_recording_displaybitmaps.
Change-Id: I8392bb331c98830dc9a98031a08c0567dd66ff4b

4 years agoMerge "libfscrypt: support setting v2 encryption policies"
Eric Biggers [Mon, 7 Oct 2019 19:09:44 +0000 (19:09 +0000)]
Merge "libfscrypt: support setting v2 encryption policies"

4 years agoMerge "Make cppreopts.sh deal with new layout"
Anton Hansson [Fri, 4 Oct 2019 06:30:55 +0000 (06:30 +0000)]
Merge "Make cppreopts.sh deal with new layout"

4 years agoMerge "simpleperf: add app tests in python test."
Yabin Cui [Thu, 3 Oct 2019 20:31:04 +0000 (20:31 +0000)]
Merge "simpleperf: add app tests in python test."

4 years agosimpleperf: add app tests in python test.
Yabin Cui [Thu, 3 Oct 2019 19:06:27 +0000 (12:06 -0700)]
simpleperf: add app tests in python test.

Also fix log overwrite in TestLogger.

Bug: 141882072
Test: run test.py TestRecordingRealApps*.
Change-Id: I0e85224c40a66dbbd1caab5ff0bb48852712a06e

4 years agoMake cppreopts.sh deal with new layout
Anton Hansson [Thu, 3 Oct 2019 13:16:38 +0000 (14:16 +0100)]
Make cppreopts.sh deal with new layout

.odex and .vdex files on system_other are being moved to a subdir
with the name of their source partition. Update cppreopts to
recognize this and pass the right source path to preopt2cachename.

Bug: 141707536
Test: manually verify name of dalvik-cache files post boot
Test: dumpsys package [system-package]; verify reason=prebuilt
Change-Id: Icb5b5307ad42b7c899e11212843ce4b96b015958

4 years agoMerge "simpleperf: add tests recording real apps."
Yabin Cui [Tue, 1 Oct 2019 21:15:16 +0000 (21:15 +0000)]
Merge "simpleperf: add tests recording real apps."

4 years agosimpleperf: add tests recording real apps.
Yabin Cui [Mon, 30 Sep 2019 23:46:26 +0000 (16:46 -0700)]
simpleperf: add tests recording real apps.

This is to test failures more likely to be reproduced when recording real apps.

Bug: 141882072
Test: run simpleperf_unit_test on both arm64 and x86.
Change-Id: I20da128b6721c32c0205341a16f63414510753c9

4 years agolibfscrypt: support setting v2 encryption policies
Eric Biggers [Fri, 13 Sep 2019 18:07:42 +0000 (11:07 -0700)]
libfscrypt: support setting v2 encryption policies

Update libfscrypt to support setting v2 encryption policies.  For this,
the ioctl to use is still FS_IOC_SET_ENCRYPTION_POLICY; we just need to
pass it a slightly different structure.

v2 policies support the same encryption modes and flags as v1 policies,
but internally they use a more standard, secure, and flexible KDF.  Due
to this, some future features will be supported by v2 policies only.

Other notes:

- Use 16 byte filenames padding for all v2 policies.  There's no need to
  use the legacy 4 bytes padding.

- Unlike v1 policies, setting a v2 policy requires CAP_FOWNER if the key
  hasn't been installed.  This isn't an issue for Android, however --
  Android always installs the keys first, and even if it didn't,
  policies are only set by init and vold, which have CAP_FOWNER.

Bug: 140500999
Test: tested as series; see If64028d8580584b2c33c614cabd5d6b93657f608
Change-Id: I325f75fd3e59d6f00a5c66938b99b127981183a5

4 years agoMerge changes from topic "logwrapper-api-update"
Tom Cherry [Fri, 27 Sep 2019 15:31:04 +0000 (15:31 +0000)]
Merge changes from topic "logwrapper-api-update"

* changes:
  Update system/extras for logwrapper
  puncture_fs: convert to C++ and update for logwrapper

4 years agoUpdate system/extras for logwrapper
Tom Cherry [Wed, 25 Sep 2019 23:48:07 +0000 (16:48 -0700)]
Update system/extras for logwrapper

Test: build
Change-Id: I60bd71671ef18b62f3d4152e3061133eafa935f8

4 years agopuncture_fs: convert to C++ and update for logwrapper
Tom Cherry [Wed, 25 Sep 2019 22:31:47 +0000 (15:31 -0700)]
puncture_fs: convert to C++ and update for logwrapper

This was logwrapper's last C dependency to convert it to C++ for the
incoming updates.

Test: builds
Change-Id: I71feb31032b6b4c8c7147d2111f9a685c0351e4b

4 years agoMerge "lpdump: print partitions in super in order"
Treehugger Robot [Tue, 24 Sep 2019 19:57:20 +0000 (19:57 +0000)]
Merge "lpdump: print partitions in super in order"

4 years agolpdump: print partitions in super in order
Yifan Hong [Tue, 24 Sep 2019 01:01:20 +0000 (18:01 -0700)]
lpdump: print partitions in super in order

Easier to understand where are all the extents.
Test: run it

Change-Id: I88511fe4ed0d23882872c7434422f0a42cd3ee1f

4 years agoMerge "simpleperf: fix location addresses in generated pprof files."
Yabin Cui [Mon, 23 Sep 2019 20:44:23 +0000 (20:44 +0000)]
Merge "simpleperf: fix location addresses in generated pprof files."

4 years agosimpleperf: fix location addresses in generated pprof files.
Yabin Cui [Mon, 23 Sep 2019 19:35:03 +0000 (12:35 -0700)]
simpleperf: fix location addresses in generated pprof files.

The address of a location in pprof proto files should be within memory
range of the corresponding mapping. But in pprof_proto_generator.py,
it is written as the virtual address in elf file.

Bug: 141026312
Test: run test.py TestPprofProtoGenerator*
Change-Id: I3bc13548477b6b6069f712035b7177cc4bd60c80

4 years agoMerge "mkuserimg_mke2fs.py: Package mke2fs.conf"
Daniel Mentz [Fri, 20 Sep 2019 17:12:12 +0000 (17:12 +0000)]
Merge "mkuserimg_mke2fs.py: Package mke2fs.conf"

4 years agoMerge "simpleperf: output text format for autofdo in inject cmd."
Yabin Cui [Thu, 19 Sep 2019 23:15:42 +0000 (23:15 +0000)]
Merge "simpleperf: output text format for autofdo in inject cmd."

4 years agoMerge "simpleperf: split test progress and log of test.py."
Yabin Cui [Thu, 19 Sep 2019 23:15:13 +0000 (23:15 +0000)]
Merge "simpleperf: split test progress and log of test.py."

4 years agosimpleperf: split test progress and log of test.py.
Yabin Cui [Mon, 16 Sep 2019 23:34:29 +0000 (16:34 -0700)]
simpleperf: split test progress and log of test.py.

Currently test.py outputs both test progress and log in stderr,
making output hard to parse. So only keep test progress in
stderr, and move verbose log to test_python_{2,3}.log.

Since we keep test logs, continue testing even when some tests fail.

Also move deprecated assertEquals to assertEqual.

Bug: 140958894
Test: run test.py.
Change-Id: I11c168cbc934055b47a3df44fc6d568824282702

4 years agosimpleperf: output text format for autofdo in inject cmd.
Yabin Cui [Wed, 18 Sep 2019 23:05:51 +0000 (16:05 -0700)]
simpleperf: output text format for autofdo in inject cmd.

Also add --binary option to selected binaries for generating data.
Because AutoFDO only accepts one binary input.

Test it manually with a simple example as below:
1. on device, run `./simpleperf record -e cs-etm:u ./etm_test_multi_thread`.
2. on device, run `./simpleperf inject --binary test_loop_b`.
3. on host, run `adb pull /data/local/tmp/perf_inject.data`.
4. on host, run `./create_llvm_prof -binary=libetm_test_loop_b.so
-profile=perf_inject.data -profiler=text -out=a`.

And create_llvm_prof can generate output successfully.

Bug: 141013987
Test: run simpleperf_unit_test.
Change-Id: Iacc0e3ed4cc47c91d5764e7b0394718436211514

4 years agoMerge "Add support for scudo native allocator."
Christopher Ferris [Thu, 19 Sep 2019 14:42:26 +0000 (14:42 +0000)]
Merge "Add support for scudo native allocator."

4 years agoMerge "Add vbmake to build super_vbmeta.img"
Treehugger Robot [Thu, 19 Sep 2019 10:21:53 +0000 (10:21 +0000)]
Merge "Add vbmake to build super_vbmeta.img"

4 years agomkuserimg_mke2fs.py: Package mke2fs.conf
Daniel Mentz [Tue, 10 Sep 2019 23:31:53 +0000 (16:31 -0700)]
mkuserimg_mke2fs.py: Package mke2fs.conf

Depending on the environment where mkuserimg_mke2fs.py is used, it's
difficult to locate the configuration file mke2fs.conf.  To avoid
potential issues, let's just package mke2fs.conf with
mkuserimg_mke2fs.py.

Bug: 112937752
Change-Id: I9eb911fc9357e65a666bafd3089461cac8289008

4 years agoAdd support for scudo native allocator.
Christopher Ferris [Wed, 18 Sep 2019 17:31:40 +0000 (10:31 -0700)]
Add support for scudo native allocator.

Bug: 137795072

Test: Unit tests pass.
Test: Ran memory_replay and verified that RSS is non-zero.
Change-Id: I266b9d4e4d1c1a3011acc47f9891a2b65979d870

4 years agoMerge "simpleperf: use path in binary_cache in pprof_proto_generator.py."
Yabin Cui [Wed, 18 Sep 2019 00:31:37 +0000 (00:31 +0000)]
Merge "simpleperf: use path in binary_cache in pprof_proto_generator.py."

4 years agosimpleperf: use path in binary_cache in pprof_proto_generator.py.
Yabin Cui [Tue, 17 Sep 2019 23:01:01 +0000 (16:01 -0700)]
simpleperf: use path in binary_cache in pprof_proto_generator.py.

Pprof needs to know binary paths to show their disassembly code.
So support it by generating path in binary_cache instead of
path on Android device.

Bug: 141026312
Test: run test.py.
Change-Id: Ied2913b99d884bfa57ab9440ae1684b1d9d6a31d

4 years agoMerge "simpleperf: fix build id in pprof_proto_generator.py."
Yabin Cui [Tue, 17 Sep 2019 21:55:25 +0000 (21:55 +0000)]
Merge "simpleperf: fix build id in pprof_proto_generator.py."

4 years agosimpleperf: fix build id in pprof_proto_generator.py.
Yabin Cui [Tue, 17 Sep 2019 19:25:43 +0000 (12:25 -0700)]
simpleperf: fix build id in pprof_proto_generator.py.

Simpleperf stores padded build id in perf.data, but pprof needs
real build ids in proto file. So we need to convert from padded
build ids to real build ids.

Bug: 141026312
Test: run test.py.
Change-Id: I7f4454343fd80f77364b67ec729cfba478925029

4 years agoMerge "Add a per-boot-key policy reference"
Paul Crowley [Tue, 17 Sep 2019 05:40:05 +0000 (05:40 +0000)]
Merge "Add a per-boot-key policy reference"

4 years agoAdd a per-boot-key policy reference
Paul Crowley [Wed, 11 Sep 2019 21:57:45 +0000 (14:57 -0700)]
Add a per-boot-key policy reference

Bug: 140882488
Test: Booted twice, checked logs to ensure encryption
    is different each time, adb created files in directory.
Change-Id: I5c962edb316d160dd09c0df893912c6b257d7810

4 years agoMerge "lpdump: Fix slot handling on retrofit devices."
David Anderson [Thu, 12 Sep 2019 20:54:34 +0000 (20:54 +0000)]
Merge "lpdump: Fix slot handling on retrofit devices."

4 years agoMerge "verity: Do not increment data when it is nullptr."
Tianjie Xu [Wed, 11 Sep 2019 19:11:34 +0000 (19:11 +0000)]
Merge "verity: Do not increment data when it is nullptr."

4 years agoMerge changes from topic "protobuf-3.9.1"
Colin Cross [Wed, 11 Sep 2019 18:00:16 +0000 (18:00 +0000)]
Merge changes from topic "protobuf-3.9.1"

* changes:
  libjsonpb: fix tests for new protobuf version
  Adapt to google::protobuf::int64 type change and scoped_ptr removal

4 years agoMerge "Create per-uid GCOV_PREFIX dir in the getenv wrapper"
Treehugger Robot [Wed, 11 Sep 2019 03:54:13 +0000 (03:54 +0000)]
Merge "Create per-uid GCOV_PREFIX dir in the getenv wrapper"

4 years agoCreate per-uid GCOV_PREFIX dir in the getenv wrapper
Pirama Arumuga Nainar [Fri, 26 Jul 2019 21:49:58 +0000 (14:49 -0700)]
Create per-uid GCOV_PREFIX dir in the getenv wrapper

Bug: http://b/116873221

With https://reviews.llvm.org/D65245, the profile runtime assumes that
the directory ${GCOV_PREFIX} is already created.  Before returning from
the getenv wrapper, create the per-uid ${GCOV_PREFIX}.

Test: cuttlefish builds and boots with new Clang.
Change-Id: I276e1a92b3cb18ee85bb4451159b131d8ebca4a2

4 years agoMerge changes from topics "lpdump-all", "lpdump-bugreport"
David Anderson [Tue, 10 Sep 2019 21:36:39 +0000 (21:36 +0000)]
Merge changes from topics "lpdump-all", "lpdump-bugreport"

* changes:
  lpdump: Add an --all command to dump all metadata slots.
  lpdump: Refactor how lpdump reads metadata.

4 years agolpdump: Fix slot handling on retrofit devices.
David Anderson [Fri, 6 Sep 2019 01:53:21 +0000 (18:53 -0700)]
lpdump: Fix slot handling on retrofit devices.

On retrofit devices, use the correct super partition when none is
explicitly specified.

Bug: 140204341
Test: manual test
Change-Id: I2753024bd2e7dfdf9d19916f30c1b2bd6b5ee289

4 years agolpdump: Add an --all command to dump all metadata slots.
David Anderson [Fri, 6 Sep 2019 01:31:12 +0000 (18:31 -0700)]
lpdump: Add an --all command to dump all metadata slots.

Note that this will not correctly dump all slots on retrofit devices.

Bug: 140204341
Test: lpdump --all
Change-Id: Icb8d8619202221f0c5fc8848abc7172d0b4dafd3

4 years agoverity: Do not increment data when it is nullptr.
MarijnS95 [Mon, 9 Sep 2019 13:50:43 +0000 (15:50 +0200)]
verity: Do not increment data when it is nullptr.

Address a segfault introduced in
d6dc877032c65768b3c6737156d3142f32cc9984

As soon as leftover_ becomes non-empty, the data pointer is incremented
and will now be an invalid pointer in case it was null previously.
The subsequent check in HashBlocks() will now encounter a non-null data
ptr and pass it to HashBlock(), triggering a segfault.

Test: Manually build and boot an image on which this crashed before.
Test: build_verity_tree_test
Change-Id: I324ff6103c9d35fb290c4e96fb5009ee365a0249
Signed-off-by: MarijnS95 <marijns95@gmail.com>
(cherry picked from commit c82514bd034f214b16d273b10c676dd63a9e603b)

4 years agoAdd vbmake to build super_vbmeta.img
Kaiwen Szu [Thu, 5 Sep 2019 08:24:25 +0000 (16:24 +0800)]
Add vbmake to build super_vbmeta.img

vbmake constructs the super_vbmeta.img with given vbmeta images.

Bug: 137054296
Test: m libvbmeta_test
Test: ./out/host/linux-x86/nativetest/libvbmeta_test/libvbmeta_test
Change-Id: Ic76baa6daa1e58a22b62bdc4f25eb12c8d9004e4

4 years agoMerge "Remove libhwbinder/libhidltransport deps"
Steven Moreland [Fri, 6 Sep 2019 19:33:29 +0000 (19:33 +0000)]
Merge "Remove libhwbinder/libhidltransport deps"

4 years agolpdump: Refactor how lpdump reads metadata.
David Anderson [Fri, 6 Sep 2019 00:57:20 +0000 (17:57 -0700)]
lpdump: Refactor how lpdump reads metadata.

This patch prepares lpdump for the addition of an "--all" option to dump
all metadata slots.

 - The slot and super partition name are now determined ahead of time,
   rather than as part of reading metadata.
 - The custom IPartitionOpener has been removed as it served no purpose.
 - The -e option has been removed in favor of IsEmptySuperImage().
 - Metadata spew has been factored into a separate function.

Bug: 140204341
Test: manual test
Change-Id: I810a5f042870f7e072a8939bebe99b8707235f43

4 years agoMerge changes I51ee7070,I499a70a9
Eric Biggers [Thu, 5 Sep 2019 22:51:17 +0000 (22:51 +0000)]
Merge changes I51ee7070,I499a70a9

* changes:
  libfscrypt: simplify fscrypt_policy_ensure()
  libfscrypt: remove some hardcoded definitions

4 years agolibjsonpb: fix tests for new protobuf version
Yifan Hong [Tue, 27 Aug 2019 20:51:42 +0000 (13:51 -0700)]
libjsonpb: fix tests for new protobuf version

Bug: 117607748
Test: atest --host libjsonpbverify_test
Change-Id: I5ce89c330d769fac10d8092734a37c26694587a2
Merged-In: I5ce89c330d769fac10d8092734a37c26694587a2

4 years agoAdapt to google::protobuf::int64 type change and scoped_ptr removal
Colin Cross [Wed, 14 Aug 2019 00:03:15 +0000 (17:03 -0700)]
Adapt to google::protobuf::int64 type change and scoped_ptr removal

Protobuf 3.9.1 redefines google::protobuf::int64 from long long to
int64_t, which is sometimes long and sometimes long long.  Use
PRId64 to print it.

scoped_ptr has been removed, use std::unique_ptr instead.

Bug: 117607748
Test: m checkbuild
Change-Id: Idfcaba262c27cf2b895a0a6ded8394c8465547e8
Merged-In: Idfcaba262c27cf2b895a0a6ded8394c8465547e8

4 years agoRemove libhwbinder/libhidltransport deps
Steven Moreland [Thu, 5 Sep 2019 21:17:28 +0000 (14:17 -0700)]
Remove libhwbinder/libhidltransport deps

Since these were combined into libhidlbase.

Bug: 135686713
Test: build only (libhwbinder/libhidltransport are empty)
Change-Id: Iea42841e537a16a302b6d425faf2c6bd511c6bad

4 years agolibfscrypt: simplify fscrypt_policy_ensure()
Eric Biggers [Thu, 5 Sep 2019 19:18:30 +0000 (12:18 -0700)]
libfscrypt: simplify fscrypt_policy_ensure()

fscrypt_policy_ensure() sets an encryption policy if the directory is
empty, otherwise it verifies the existing encryption policy.

However, it's unnecessary to actually implement this logic in userspace,
because this is the behavior of the FS_IOC_SET_ENCRYPTION_POLICY ioctl
already.  See the documentation:
https://www.kernel.org/doc/html/latest/filesystems/fscrypt.html#setting-an-encryption-policy

Therefore, just call FS_IOC_SET_ENCRYPTION_POLICY and handle errors
appropriately.

This makes the code shorter and less racy, and it also fixes the issue
where if files were created in the directory before an encryption policy
is set, the error message was confusing:

    Failed to get encryption policy for $dir: No data available

Now it's:

    Failed to set encryption policy of $dir to ...: Directory not empty

Test: booted after factory reset, checked log, rebooted, checked log
      again.
Change-Id: I51ee70706bc9ccb216ccefd7bdfbbfc57faae14d

4 years agolibfscrypt: remove some hardcoded definitions
Eric Biggers [Thu, 5 Sep 2019 19:18:29 +0000 (12:18 -0700)]
libfscrypt: remove some hardcoded definitions

FS_ENCRYPTION_MODE_ADIANTUM and FS_POLICY_FLAG_DIRECT_KEY are in
Bionic's <linux/fs.h> now, so there's no need to define them in
libfscrypt anymore.

Test: compiled
Change-Id: I499a70a9f8fd3445098a1dd799b1aefe0fa374ce

4 years agoMerge "DO NOT MERGE - Merge Android 10 into master"
Xin Li [Thu, 5 Sep 2019 16:53:33 +0000 (16:53 +0000)]
Merge "DO NOT MERGE - Merge Android 10 into master"

4 years agoMerge "simpleperf: support profiling art interpreter on linux host."
Treehugger Robot [Thu, 5 Sep 2019 16:45:38 +0000 (16:45 +0000)]
Merge "simpleperf: support profiling art interpreter on linux host."

4 years agosimpleperf: support profiling art interpreter on linux host.
Yabin Cui [Wed, 4 Sep 2019 22:49:19 +0000 (15:49 -0700)]
simpleperf: support profiling art interpreter on linux host.

Bug: 140300587
Test: run simpleperf_unit_test.
Test: run simpleperf on host.
Change-Id: Ia2e21cabf2661c82bb611c525d5277b1e4d13a23

4 years agoDO NOT MERGE - Merge Android 10 into master
Xin Li [Wed, 4 Sep 2019 20:35:27 +0000 (13:35 -0700)]
DO NOT MERGE - Merge Android 10 into master

Bug: 139893257
Change-Id: I35ce2edc54690d76c26efed846e232ff223ebb4e

4 years agoMerge "Add support for new taskstats v9 functionality"
Peter Enderborg [Tue, 3 Sep 2019 20:56:38 +0000 (13:56 -0700)]
Merge "Add support for new taskstats v9 functionality"
am: 9229017530

Change-Id: Ifc4601aa55c3475e726470189c3b56613fdc47c8

4 years agoMerge "Add support for new taskstats v9 functionality"
Treehugger Robot [Tue, 3 Sep 2019 20:37:06 +0000 (20:37 +0000)]
Merge "Add support for new taskstats v9 functionality"

4 years agoMerge "simpleperf: switch to llvm-symbolizer."
Yabin Cui [Tue, 3 Sep 2019 17:41:15 +0000 (10:41 -0700)]
Merge "simpleperf: switch to llvm-symbolizer."
am: f626973b9a

Change-Id: Iba347945d89f95967815e58809b90d667e0df8d5

4 years agoMerge "simpleperf: switch to llvm-symbolizer."
Yabin Cui [Tue, 3 Sep 2019 17:21:54 +0000 (17:21 +0000)]
Merge "simpleperf: switch to llvm-symbolizer."

4 years agosimpleperf: switch to llvm-symbolizer.
Yabin Cui [Fri, 30 Aug 2019 22:51:33 +0000 (15:51 -0700)]
simpleperf: switch to llvm-symbolizer.

Bug: 74395415
Test: run test.py.
Change-Id: I4cc0013735bedcfd18813428e4892049277c38ff

4 years agoMerge "Refactor code with single trace parser."
Christopher Ferris [Fri, 30 Aug 2019 18:17:55 +0000 (11:17 -0700)]
Merge "Refactor code with single trace parser."
am: 7ac993ce67

Change-Id: Iff4618349bce7e22456bf004b861daafcc0328f6

4 years agoMerge "Refactor code with single trace parser."
Christopher Ferris [Fri, 30 Aug 2019 17:47:00 +0000 (17:47 +0000)]
Merge "Refactor code with single trace parser."

4 years agoRefactor code with single trace parser.
Christopher Ferris [Tue, 27 Aug 2019 00:51:19 +0000 (17:51 -0700)]
Refactor code with single trace parser.

This is the first step towards adding a new way to benchmark the
traces. This new way would be a way to add all threads running at once.

Also to try and make it possible to do the faster runs that jmgao had
done a while ago.

Modified the code so that it's possible for memory_replay to play
the zip file, no need to unzip the trace files.

Add a single parser for the trace files.

Remove as many possible allocation points in the system. This allows
the traces to be run as pure as possible.

Added new unit tests to cover new code.

Bug: 137795072

Test: All unit tests pass.
Test: Ran select traces using the old version and the new version.
Test: Both get nearlyt he same RSS, but slightly different VA space
Test: due to the new version avoiding allocations at all costs.
Test: Ran the trace benchmarks and verified that the old version and the
Test: new version produce nearly the same numbers.
Change-Id: I8e8a28436f23b09eba57772c62bb0b866d874437

4 years agoMerge "simpleperf: add --include-filter in record cmd."
Yabin Cui [Thu, 29 Aug 2019 23:47:02 +0000 (16:47 -0700)]
Merge "simpleperf: add --include-filter in record cmd."
am: 178d1d48bf

Change-Id: Ib04498c4d08229a815bb24d65048fde1f6d97b42

4 years agoMerge "simpleperf: add --include-filter in record cmd."
Yabin Cui [Thu, 29 Aug 2019 23:37:14 +0000 (23:37 +0000)]
Merge "simpleperf: add --include-filter in record cmd."

4 years agosimpleperf: add --include-filter in record cmd.
Yabin Cui [Tue, 6 Aug 2019 17:29:45 +0000 (10:29 -0700)]
simpleperf: add --include-filter in record cmd.

It is to only record selected binaries in cs-etm tracing.

Bug: 135204414
Test: run simpleperf_unit_test.

Change-Id: I5dae729aee1642d9384ee9bb88ee8cb25950131a

4 years agoMerge "Update lpdump to recognize LP_PARTITION_ATTR_UPDATED."
David Anderson [Wed, 28 Aug 2019 03:00:49 +0000 (20:00 -0700)]
Merge "Update lpdump to recognize LP_PARTITION_ATTR_UPDATED."
am: 3562ed57ed

Change-Id: I193a78d01e2066a2f07b8d83906cd0a839957a8c

4 years agoMerge "Update lpdump to recognize LP_PARTITION_ATTR_UPDATED."
David Anderson [Wed, 28 Aug 2019 02:51:43 +0000 (02:51 +0000)]
Merge "Update lpdump to recognize LP_PARTITION_ATTR_UPDATED."

4 years agoUpdate lpdump to recognize LP_PARTITION_ATTR_UPDATED.
David Anderson [Tue, 27 Aug 2019 20:44:48 +0000 (13:44 -0700)]
Update lpdump to recognize LP_PARTITION_ATTR_UPDATED.

Bug: 139154795
Test: lpdump after update
Change-Id: I4cbfe80c15cfa0afe3e9d37e3f8818016e57daa2

4 years agoMerge "Move fscrypt_init_extensions into system/core"
Paul Crowley [Tue, 27 Aug 2019 01:03:14 +0000 (18:03 -0700)]
Merge "Move fscrypt_init_extensions into system/core"
am: 39e92468ad

Change-Id: I14922f2abc8ca1644fdedcdb51a3d5409df54f58

4 years agoMerge "If the rollback directories won't encrypt, wipe them"
Paul Crowley [Tue, 27 Aug 2019 00:50:56 +0000 (17:50 -0700)]
Merge "If the rollback directories won't encrypt, wipe them"
am: 43ce86f084

Change-Id: Ib592f2e3fc0215dea881df16adf85569354edc30

4 years agoMerge "Move fscrypt_init_extensions into system/core"
Treehugger Robot [Mon, 26 Aug 2019 23:24:54 +0000 (23:24 +0000)]
Merge "Move fscrypt_init_extensions into system/core"

4 years agoMerge "If the rollback directories won't encrypt, wipe them"
Treehugger Robot [Mon, 26 Aug 2019 23:24:49 +0000 (23:24 +0000)]
Merge "If the rollback directories won't encrypt, wipe them"

4 years agoMove fscrypt_init_extensions into system/core
Paul Crowley [Mon, 26 Aug 2019 17:30:54 +0000 (10:30 -0700)]
Move fscrypt_init_extensions into system/core

Bug: 140027478
Test: treehugger
Change-Id: I296ce6d1272816c237e1ad213fbdef9f6fafb44f

4 years agoIf the rollback directories won't encrypt, wipe them
Paul Crowley [Fri, 9 Aug 2019 21:19:11 +0000 (14:19 -0700)]
If the rollback directories won't encrypt, wipe them

/data/rollback and /data/rollback-observer used to be created
unencrypted by system-server. If they are unencrypted and have
content, force them to be encrypted by wiping their contents.

Bug: b/139193659
Test: Put content in these directories, then reboot and see it wiped.
Cherrypicked-from: 58a49c3ae59d250cc1db49ce5a2678bf19bb92c3
Change-Id: I0320eb645ebe86965928acbacc8ad01dae2d5ba5
Merged-In: I0320eb645ebe86965928acbacc8ad01dae2d5ba5

4 years agoMerge "simpleperf: fix is_elf_file."
Yabin Cui [Thu, 22 Aug 2019 21:23:47 +0000 (14:23 -0700)]
Merge "simpleperf: fix is_elf_file."
am: abde21870e

Change-Id: Ie8001786fec5cb09e2ce76d9fe4b882b2ff18b0a

4 years agoMerge "simpleperf: add inject cmd."
Yabin Cui [Thu, 22 Aug 2019 21:22:46 +0000 (14:22 -0700)]
Merge "simpleperf: add inject cmd."
am: 93dac5f6ac

Change-Id: I471c37642d76de90af2c4938a6b6e1e93db2737a

4 years agoMerge "simpleperf: fix is_elf_file."
Yabin Cui [Thu, 22 Aug 2019 20:56:08 +0000 (20:56 +0000)]
Merge "simpleperf: fix is_elf_file."

4 years agoMerge "simpleperf: add inject cmd."
Yabin Cui [Thu, 22 Aug 2019 20:55:46 +0000 (20:55 +0000)]
Merge "simpleperf: add inject cmd."

4 years agosimpleperf: fix is_elf_file.
Yabin Cui [Thu, 22 Aug 2019 17:50:19 +0000 (10:50 -0700)]
simpleperf: fix is_elf_file.

When running by python3, is_elf_file() decodes first 4 bytes of
a file, which may cause UnicodeDecodeError.

Bug: none
Test: run test.py TestTools.test_is_elf_file.
Change-Id: Ie19e4869f876bb92155d849c814c8f39989c443b

4 years agosimpleperf: add inject cmd.
Yabin Cui [Wed, 21 Aug 2019 23:05:07 +0000 (16:05 -0700)]
simpleperf: add inject cmd.

Add inject cmd to convert etm data into executed instr ranges.

Bug: 135204414
Test: run simpleperf_unit_test.
Change-Id: I46acf7b24ddb4865d0925f70e09b861b7f6748b6

4 years agoMerge "simpleperf: add --use-devfreq-counters option."
Yabin Cui [Wed, 21 Aug 2019 00:18:49 +0000 (17:18 -0700)]
Merge "simpleperf: add --use-devfreq-counters option."
am: 5ff5b91fdc

Change-Id: I6f741f3981256dafb9713684bda6a3d8ec2f6182

4 years agoMerge "simpleperf: add --use-devfreq-counters option."
Yabin Cui [Tue, 20 Aug 2019 23:45:11 +0000 (23:45 +0000)]
Merge "simpleperf: add --use-devfreq-counters option."

4 years agoMerge "simpleperf: Add ETMDecoder."
Yabin Cui [Tue, 20 Aug 2019 23:27:02 +0000 (16:27 -0700)]
Merge "simpleperf: Add ETMDecoder."
am: 0441e116a8

Change-Id: I14f7f4fa991785bc03036ce7b046723342223491

4 years agoMerge "simpleperf: Add ETMDecoder."
Yabin Cui [Tue, 20 Aug 2019 23:08:37 +0000 (23:08 +0000)]
Merge "simpleperf: Add ETMDecoder."

4 years agosimpleperf: add --use-devfreq-counters option.
Yabin Cui [Mon, 12 Aug 2019 23:53:46 +0000 (16:53 -0700)]
simpleperf: add --use-devfreq-counters option.

On devices like pixel 3, there are 7 hardware counters in cpu pmu.
But 4 of them are used by devfreq to monitor memory latency.
In case we need more than 3 counters, add an option to let devfreq
release counters.

Also add a warning of using this option if it seems we need more
counters.

Bug: none
Test: run simpleperf_unit_test.
Change-Id: I9a13716a8b64c8e0fc03a79b0c11dd29da169c56

4 years agoMerge "simpleperf: update building prebuilts."
Yabin Cui [Tue, 20 Aug 2019 21:02:17 +0000 (14:02 -0700)]
Merge "simpleperf: update building prebuilts."
am: d1df579357

Change-Id: Ic38640eccc732b298b94ab4f6b5a49a307f441bf

4 years agosimpleperf: Add ETMDecoder.
Yabin Cui [Fri, 9 Aug 2019 01:15:14 +0000 (18:15 -0700)]
simpleperf: Add ETMDecoder.

It contains below changes:
1. Add ETMDecoder, which uses OpenCSD library to decode etm data.
2. Fix trace ids in AuxTraceInfoRecord to match those in etm data.
3. Dump build ids for all binaries in record cmd, to find them in
   etm decoding.
4. Add options in dump cmd to dump etm data.
5. Add a test line in dump cmd test to check that instruction range
elements are decoded and dumped.

Bug: 135204414
Test: run simpleperf_unit_test.

Change-Id: Iad1a1dac3dd9aaed4416ff2c19029c676d610783

4 years agoMerge "simpleperf: update building prebuilts."
Yabin Cui [Tue, 20 Aug 2019 20:23:09 +0000 (20:23 +0000)]
Merge "simpleperf: update building prebuilts."

4 years agosimpleperf: update building prebuilts.
Yabin Cui [Tue, 20 Aug 2019 17:32:56 +0000 (10:32 -0700)]
simpleperf: update building prebuilts.

1. add simpleperf_scripts in simpleperf dist build.
2. remove simpleperf in sdk,win_sdk dist build.

Bug: none
Test: run build/soong/soong_ui.bash --make-mode
Test: MODULES-IN-system-extras-simpleperf dist
Test: TARGET_PRODUCT=aosp_arm64 simpleperf
Change-Id: Ica63c106b67d3ec7400c0f7148fd78f65d6d16c3