OSDN Git Service

android-x86/system-extras.git
6 years agosimpleperf: add run_simpleperf_on_device.py.
Yabin Cui [Fri, 11 Aug 2017 23:22:50 +0000 (16:22 -0700)]
simpleperf: add run_simpleperf_on_device.py.

It is added mainly to show in README.md how to detect whether
trace-offcpu is supported on device, by
 `python run_simpleperf_on_device.py list --show-features`.

Bug: http://b/32834638
Test: run test.py.
Change-Id: I33a6fb81b650293faec233eb6a735bac7cb5e215

6 years agoMerge "simpleperf: use app_profiler.py in inferno."
Yabin Cui [Thu, 10 Aug 2017 17:49:12 +0000 (17:49 +0000)]
Merge "simpleperf: use app_profiler.py in inferno."

6 years agoMerge "simpleperf: fix stat cmd."
Treehugger Robot [Wed, 9 Aug 2017 01:00:49 +0000 (01:00 +0000)]
Merge "simpleperf: fix stat cmd."

6 years agoMerge "simpleperf: add --exit-with-parent option in record cmd."
Yabin Cui [Tue, 8 Aug 2017 23:30:21 +0000 (23:30 +0000)]
Merge "simpleperf: add --exit-with-parent option in record cmd."

6 years agosimpleperf: fix stat cmd.
Yabin Cui [Tue, 8 Aug 2017 22:44:33 +0000 (15:44 -0700)]
simpleperf: fix stat cmd.

Previous CL wrongly makes kernel dump samples for stat cmd.

Bug: http://b/64489160
Test: run simpleperf_unit_test.
Change-Id: I4f5c08839e283b2361e47d61310e5161433824bb

6 years agosimpleperf: add --exit-with-parent option in record cmd.
Yabin Cui [Tue, 8 Aug 2017 19:29:04 +0000 (12:29 -0700)]
simpleperf: add --exit-with-parent option in record cmd.

This makes it optional whether simpleperf stops recording
when the parent dies.

Bug: http://b/64391339
Test: run simpleperf_unit_test.
Change-Id: I0827a17d6fedbb9763347df76da9dc981fea6312

6 years agosimpleperf: use app_profiler.py in inferno.
Yabin Cui [Tue, 8 Aug 2017 00:53:33 +0000 (17:53 -0700)]
simpleperf: use app_profiler.py in inferno.

Also add tests to check if we can run inferno successfully.
More tests will be added to check report results of inferno.

Bug: http://b/64035530
Test: run test.py.
Change-Id: Ie5dd1f5cb47c8c7a2ae68f8614cf81b68e3c7dbf

6 years agoMerge "simpleperf: allow recording events in different speed."
Yabin Cui [Mon, 7 Aug 2017 23:11:34 +0000 (23:11 +0000)]
Merge "simpleperf: allow recording events in different speed."

6 years agoMerge "Fix fd ownership issue in PrintNativeInfo/GetNativeInfo."
Elliott Hughes [Mon, 7 Aug 2017 23:09:48 +0000 (23:09 +0000)]
Merge "Fix fd ownership issue in PrintNativeInfo/GetNativeInfo."

6 years agosimpleperf: allow recording events in different speed.
Yabin Cui [Thu, 3 Aug 2017 22:54:43 +0000 (15:54 -0700)]
simpleperf: allow recording events in different speed.

Currently record command interface only allows one sample freq or sample period
for all events. This is not convenient when recording both non tracepoint events
and tracepoint events. This CL allows setting different sample speed for
different events. For example, for "-f 1000 -e cpu-cycles -c 1 sched:sched_switch",
"-f 1000" applies to cpu-cycles, and "-c 1" applies to sched:sched_switch.

It also fixes a bug about trace-offcpu: if "-f 1000 --trace-offcpu" is used,
the sched:sched_switch is be samples with "-f 1000". But we want to sample it
with "-c 1".

Also change the order of options in the help msg of record cmd to make it more
readable. Remove -F option. Because adding it seems not useful.

Bug: http://b/37572306
Test: run simpleperf_unit_test.

Change-Id: Ifdbd27c8f9fec49aade0e0e6ce624d8114042020

6 years agoFix fd ownership issue in PrintNativeInfo/GetNativeInfo.
Elliott Hughes [Mon, 7 Aug 2017 16:30:37 +0000 (09:30 -0700)]
Fix fd ownership issue in PrintNativeInfo/GetNativeInfo.

Bug: N/A
Test: ran tests
Change-Id: I10bdeeb38404583560685bf47c58f6770fc9050b
Signed-off-by: Ivan Maidanski <i.maidanski@samsung.com>
6 years agoMerge "simpleperf: support profiling native programs in app_profiler.py."
Yabin Cui [Fri, 4 Aug 2017 17:54:42 +0000 (17:54 +0000)]
Merge "simpleperf: support profiling native programs in app_profiler.py."

6 years agoMerge "simpleperf: export meta info in report_sample.proto."
Yabin Cui [Fri, 4 Aug 2017 17:53:53 +0000 (17:53 +0000)]
Merge "simpleperf: export meta info in report_sample.proto."

6 years agosimpleperf: export meta info in report_sample.proto.
Yabin Cui [Mon, 31 Jul 2017 22:08:27 +0000 (15:08 -0700)]
simpleperf: export meta info in report_sample.proto.

To support perf.data generated with --trace-offcpu option,
update interface in report_sample.proto:
1. Add meta info to show all event types.
2. Add event_type_id in each sample to show which even type it belongs to.

Bug: http://b/37572306
Test: run simpleperf_unit_test.
Change-Id: I2878979ec2023904df1006ce353dcf233b6a2642

6 years agoMerge "Fix clang-tidy performance-* warnings in system/extras."
Treehugger Robot [Thu, 3 Aug 2017 23:03:13 +0000 (23:03 +0000)]
Merge "Fix clang-tidy performance-* warnings in system/extras."

6 years agosimpleperf: support profiling native programs in app_profiler.py.
Yabin Cui [Wed, 2 Aug 2017 18:55:04 +0000 (11:55 -0700)]
simpleperf: support profiling native programs in app_profiler.py.

This is a preparation of using app_profiler.py in inferno.

In app_profiler.py:
Add -np option to profile native programs like surfaceflinger.
Add -cmd option to profile command lines.
Add --arch option to set the app arch, because we don't guess the app arch
when profiling command lines.
Add corresponding tests in test.py.

Also improve the way of detecting whether the device supports trace-offcpu.

Bug: http://b/63006886
Test: run test.py.

Change-Id: Id899063d9a94beec67b22fd7710cda7a438557fb

6 years agoFix clang-tidy performance-* warnings in system/extras.
Chih-Hung Hsieh [Thu, 3 Aug 2017 21:04:06 +0000 (14:04 -0700)]
Fix clang-tidy performance-* warnings in system/extras.

* Use const reference parameter type to avoid unnecessary copy.
* Use more efficient overloaded string methods.

Bug: 30407689
Bug: 30411878
Test: build with WITH_TIDY=1
Change-Id: I558d482910c8a53c042d876848e35cdce8b8c15b

6 years agoMerge "simpleperf: fix supporting ctrl-c when using `adb shell simpleperf xxx`."
Treehugger Robot [Thu, 3 Aug 2017 03:20:31 +0000 (03:20 +0000)]
Merge "simpleperf: fix supporting ctrl-c when using `adb shell simpleperf xxx`."

6 years agosimpleperf: fix supporting ctrl-c when using `adb shell simpleperf xxx`.
Yabin Cui [Wed, 2 Aug 2017 21:00:01 +0000 (14:00 -0700)]
simpleperf: fix supporting ctrl-c when using `adb shell simpleperf xxx`.

Also fix a problem that binary_cache_builder.py tries to pull /dev/zero.

Bug: None.
Test: run test.py TestExamplePureJava.test_app_profiler_with_ctrl_c.
Change-Id: Ie99af6795bb1e81ae6e93f8b7a8907d49c048694

6 years agoMerge "simpleperf: update simpleperf prebuilts to build 4237700."
Yabin Cui [Wed, 2 Aug 2017 19:31:46 +0000 (19:31 +0000)]
Merge "simpleperf: update simpleperf prebuilts to build 4237700."

6 years agosimpleperf: update simpleperf prebuilts to build 4237700.
Yabin Cui [Wed, 2 Aug 2017 19:03:55 +0000 (12:03 -0700)]
simpleperf: update simpleperf prebuilts to build 4237700.

Taken from branch aosp-master.
Test: None.

Change-Id: Idcf75340fb9c0d7b8c81f64eeb2cb94a4c432224

6 years agoMerge "simpleperf: split README.md in doc directory."
Yabin Cui [Tue, 1 Aug 2017 04:56:38 +0000 (04:56 +0000)]
Merge "simpleperf: split README.md in doc directory."

6 years agosimpleperf: split README.md in doc directory.
Yabin Cui [Mon, 31 Jul 2017 19:47:11 +0000 (12:47 -0700)]
simpleperf: split README.md in doc directory.

Move README.md to doc directory, split inferno doc into inferno.md,
move pictures from scripts/inferno/ to doc/.
Improve the content about showing flamegraphs in README.md.

Bug: http://b/64123842
Test: No.
Change-Id: Ia3ebd0bbbda21fa816b94cd349c901b5c7713564

6 years agoMerge "simpleperf: add --show-features option in list cmd."
Yabin Cui [Mon, 31 Jul 2017 18:06:36 +0000 (18:06 +0000)]
Merge "simpleperf: add --show-features option in list cmd."

6 years agoMerge "Update for v4.12.3 kernel headers."
Christopher Ferris [Sat, 29 Jul 2017 19:03:09 +0000 (19:03 +0000)]
Merge "Update for v4.12.3 kernel headers."

6 years agosimpleperf: add --show-features option in list cmd.
Yabin Cui [Sat, 29 Jul 2017 00:58:25 +0000 (17:58 -0700)]
simpleperf: add --show-features option in list cmd.

It is used to show features supported on the device.

Bug: http://b/64147273
Test: run simpleperf_unit_test.
Change-Id: Idb7821e74d1a23f8988ef2207696114498713f47

6 years agoMerge "simpleperf add more script tests."
Yabin Cui [Sat, 29 Jul 2017 00:36:20 +0000 (00:36 +0000)]
Merge "simpleperf add more script tests."

6 years agosimpleperf add more script tests.
Yabin Cui [Wed, 26 Jul 2017 19:29:44 +0000 (12:29 -0700)]
simpleperf add more script tests.

Add tests for Trace offcpu.
Add test for jni call.
Build testdata when running test.py.

Bug: http://b/63006886
Test: run test.py.

Change-Id: I5a87b8d2a8f59ead858c1b78a78c7e78847854f4

6 years agoUpdate for v4.12.3 kernel headers.
Christopher Ferris [Fri, 28 Jul 2017 16:10:56 +0000 (09:10 -0700)]
Update for v4.12.3 kernel headers.

Modify the host side linux byteorder.h to set the defines for little
endian. The new kernel headers require the defines, or there will be
compile errors.

Test: Ran all host side unit tests.
Change-Id: I05f0ea0695a56525af3cd808f2ae9a8d6b5c49db

6 years agoMerge "ext4_utils: enable uninit_bg feature for ext4 mke2fs"
Treehugger Robot [Fri, 28 Jul 2017 00:49:42 +0000 (00:49 +0000)]
Merge "ext4_utils: enable uninit_bg feature for ext4 mke2fs"

6 years agoext4_utils: enable uninit_bg feature for ext4 mke2fs
Jin Qian [Thu, 27 Jul 2017 18:33:12 +0000 (11:33 -0700)]
ext4_utils: enable uninit_bg feature for ext4 mke2fs

Some devices have very slow storage media. This feature can speed
up filesystem creation time noticeably.

Bug: 63809106
Bug: 64101366
Change-Id: Id4886822035808bcb279dbf6f81989fee9cc0ace
(cherry picked from commit 794223c633652b714db804729b5f57d3689a1f91)

6 years agoMerge "simpleperf: fix README.md to show inferno pictures correctly."
Yabin Cui [Thu, 27 Jul 2017 19:31:11 +0000 (19:31 +0000)]
Merge "simpleperf: fix README.md to show inferno pictures correctly."

6 years agoMerge "simpleperf: update simpleperf prebuilts to build 4219235."
Yabin Cui [Thu, 27 Jul 2017 00:55:00 +0000 (00:55 +0000)]
Merge "simpleperf: update simpleperf prebuilts to build 4219235."

6 years agosimpleperf: update simpleperf prebuilts to build 4219235.
Yabin Cui [Thu, 27 Jul 2017 00:05:25 +0000 (17:05 -0700)]
simpleperf: update simpleperf prebuilts to build 4219235.

Taken from branch aosp-master.

Test: none.

Change-Id: I64c9a60b4251549a22d44e9444824a439d5f4cc1

6 years agosimpleperf: fix README.md to show inferno pictures correctly.
Yabin Cui [Wed, 26 Jul 2017 18:23:06 +0000 (11:23 -0700)]
simpleperf: fix README.md to show inferno pictures correctly.

Bug: http://b/63006886
Test: none.
Change-Id: If27d2f0d91e2121c3d58c0b5451dee98934f2d40

6 years agoMerge "Fix a memory leak"
Treehugger Robot [Wed, 26 Jul 2017 06:26:13 +0000 (06:26 +0000)]
Merge "Fix a memory leak"

6 years agoFix a memory leak
George Burgess IV [Wed, 26 Jul 2017 01:21:24 +0000 (18:21 -0700)]
Fix a memory leak

This fixes the following memory leak:
system/extras/tests/tcp_nuke_addr/tcp_nuke_addr_test.cpp:146:20:
warning: Potential memory leak [clang-analyzer-cplusplus.NewDeleteLeaks]

Namely, clang was upset that we didn't free the std::threads we new'ed
up. Immediately detach()ing them gets us the same effect.

(Context: We're trying to clean up scary-sounding warnings like this in
Android. I realize that, in this case, a leak is harmless, but...)

Bug: 27101951
Test: mma. Memory leak warning is gone. Ran the test on bullhead for
60s; seemed to work (last line of output is "60s: 246 cps, total 25432")

Change-Id: I4b6b5679430968e01ffea5bc10309a4ced04ba4e

6 years agoMerge "simpleperf: move inferno to scripts directory."
Treehugger Robot [Wed, 26 Jul 2017 00:48:35 +0000 (00:48 +0000)]
Merge "simpleperf: move inferno to scripts directory."

6 years agoMerge "simpleperf: support reporting trace offcpu data in simpleperf_report_lib."
Treehugger Robot [Tue, 25 Jul 2017 23:53:19 +0000 (23:53 +0000)]
Merge "simpleperf: support reporting trace offcpu data in simpleperf_report_lib."

6 years agosimpleperf: move inferno to scripts directory.
Yabin Cui [Tue, 25 Jul 2017 22:26:22 +0000 (15:26 -0700)]
simpleperf: move inferno to scripts directory.

This is a preparation for integrating inferno with python scripts under scripts/.

Bug: http://b/64035530
Test: run inferno.py.
Change-Id: I60ee1c30f650307aa58a038448cddb4eef43acb5

6 years agoMerge "Remove LOCAL_CLANG and clang: true"
Treehugger Robot [Tue, 25 Jul 2017 22:09:48 +0000 (22:09 +0000)]
Merge "Remove LOCAL_CLANG and clang: true"

6 years agosimpleperf: support reporting trace offcpu data in simpleperf_report_lib.
Yabin Cui [Tue, 25 Jul 2017 22:08:05 +0000 (15:08 -0700)]
simpleperf: support reporting trace offcpu data in simpleperf_report_lib.

Export python interface for reading meta info.
Change sample.period to sample time difference when trace_offcpu is true.
Add unit tests.

Bug: http://b/37572306
Test: run python test.py.
Change-Id: Ic144314184d115cc55630d3c69b66a0d8594721a

6 years agoMerge "simpleperf: use --app option in python scripts and README.md."
Yabin Cui [Tue, 25 Jul 2017 18:07:02 +0000 (18:07 +0000)]
Merge "simpleperf: use --app option in python scripts and README.md."

6 years agoRemove LOCAL_CLANG and clang: true
Lennart Wieboldt [Mon, 24 Jul 2017 23:18:06 +0000 (01:18 +0200)]
Remove LOCAL_CLANG and clang: true

clang is the default compiler since Android nougat

Test: mma & verified it´s still build with clang
Change-Id: Ie41a98a7d72940e8169996a7081ccec9b94aa61c
Signed-off-by: Lennart Wieboldt <lennart.1997@gmx.de>
6 years agoMerge "simpleperf: exclude kernel callchains when needed."
Treehugger Robot [Tue, 25 Jul 2017 01:06:26 +0000 (01:06 +0000)]
Merge "simpleperf: exclude kernel callchains when needed."

6 years agosimpleperf: exclude kernel callchains when needed.
Yabin Cui [Mon, 24 Jul 2017 21:59:46 +0000 (14:59 -0700)]
simpleperf: exclude kernel callchains when needed.

Exclude kernel callchains when users only monitor events in user space.
After this change, when users use `record -e cpu-cycles:u --trace-offcpu`,
the samples of the implicitly added sched:sched_switch event won't contain
any kernel callchain.

Bug: http://b/37572306
Test: run simpleperf_unit_test.
Change-Id: Iffcb61bac796e734825e68f847f24b4006b44360

6 years agosimpleperf: use --app option in python scripts and README.md.
Yabin Cui [Mon, 24 Jul 2017 18:45:10 +0000 (11:45 -0700)]
simpleperf: use --app option in python scripts and README.md.

Also remove app_profiler.config.

Bug: http://b/34108866
Test: run test.py.
Change-Id: If19f2249ff646b6f5266dc12ed2b9ae13f5b67e2

6 years agoMerge "Track google-benchmark API change."
Treehugger Robot [Sat, 22 Jul 2017 01:14:59 +0000 (01:14 +0000)]
Merge "Track google-benchmark API change."

6 years agoMerge "simpleperf: adjust sample freq instead of checking it."
Treehugger Robot [Sat, 22 Jul 2017 01:12:16 +0000 (01:12 +0000)]
Merge "simpleperf: adjust sample freq instead of checking it."

6 years agoMerge "simpleperf: add tests for scripts."
Treehugger Robot [Sat, 22 Jul 2017 00:52:19 +0000 (00:52 +0000)]
Merge "simpleperf: add tests for scripts."

6 years agoMerge "simpleperf: support tracing offcpu time."
Treehugger Robot [Sat, 22 Jul 2017 00:25:56 +0000 (00:25 +0000)]
Merge "simpleperf: support tracing offcpu time."

6 years agoTrack google-benchmark API change.
Elliott Hughes [Fri, 21 Jul 2017 23:19:55 +0000 (16:19 -0700)]
Track google-benchmark API change.

Bug: N/A
Test: builds
Change-Id: I55e43db662c834da52dbc8de522ee6ccbd3f8b5e

6 years agosimpleperf: adjust sample freq instead of checking it.
Yabin Cui [Fri, 21 Jul 2017 22:52:26 +0000 (15:52 -0700)]
simpleperf: adjust sample freq instead of checking it.

Linux kernel introduces methods to adjust max sample rate
based on load with patch "perf: Drop sample rate when sampling is too slow".
It is annoying if the first time recording with -f xxx option successes,
but following runs fail because the max sample rate is decreased.
So instead of checking if sample_freq <= max_sample_rate, I prefer to
change it to adjust sample_freq in range of [1, max_sample_rate].

Test: run simpleperf_unit_test.
Change-Id: Ic2e93b7fb861c704a4aa8199d08b5b0650db2c23

6 years agosimpleperf: support tracing offcpu time.
Yabin Cui [Thu, 20 Jul 2017 00:54:57 +0000 (17:54 -0700)]
simpleperf: support tracing offcpu time.

1. Add --trace-offcpu option in record command, to record the callstack
when a thread is scheduled off cpu.
2. Change the report command to report time spent not running on cpu
when --trace-offcpu option is used for recording.
3. Add related unittests and runtests.

Bug: http://b/37572306
Test: run simpleperf_unit_test.

Change-Id: Ia50cc39c8dde0c8fb1b1facbcb26bbd0a7ab1351

6 years agoMerge "Add swapPSS support to showmap"
Treehugger Robot [Fri, 21 Jul 2017 22:14:54 +0000 (22:14 +0000)]
Merge "Add swapPSS support to showmap"

6 years agosimpleperf: add tests for scripts.
Yabin Cui [Tue, 18 Jul 2017 01:08:57 +0000 (18:08 -0700)]
simpleperf: add tests for scripts.

Also adjust scripts based on test results:
1. Use `pidof` in app_profiler.py.
2. Improve the way finding source files in annotate.py.
3. Change report.py to be a python wrapper of simpleperf report command,
   so users don't need to find different simpleperf binaries for different platforms.
4. Change README.md accordingly.

Bug: http://b/63006886
Test: run test.py on all platforms.

Change-Id: I00b098a1c72824226e509d7b1e5405c7cc43b856

6 years agoAdd swapPSS support to showmap
Mathieu Chartier [Fri, 21 Jul 2017 19:08:14 +0000 (12:08 -0700)]
Add swapPSS support to showmap

The swap column in showmap is sometimes misleading since it is total
swap and not proportional. Shared dirty RAM is often shared swap with
the zygote and other processes.

Added a swapPSS column to the showmap output that shows the swapPss
which is proportional swap usage (from smaps).

Test: looked at showmap for a device that is swapping
Bug: 36457259

Change-Id: If43d39354d53f6cfc2c7681ce294e2729c638876

6 years agoMerge changes from topic 'mke2fs_2'
Treehugger Robot [Fri, 21 Jul 2017 19:00:46 +0000 (19:00 +0000)]
Merge changes from topic 'mke2fs_2'

* changes:
  ext4_utils: copy mke2fs.conf to /etc
  ext4_utils: copy mke2fs.conf to recovery /etc

6 years agoext4_utils: copy mke2fs.conf to /etc
Jin Qian [Wed, 7 Jun 2017 18:32:16 +0000 (11:32 -0700)]
ext4_utils: copy mke2fs.conf to /etc

mke2fs tool reads /etc/mke2fs.conf for filesystem configurations

Bug: 35219933
Change-Id: I2af633ffd3b37f9f5ad287375ea40b212bf61a01
(cherry picked from commit a5950e562e89ac2c110070993a93ae3f8503fe37)

6 years agoext4_utils: copy mke2fs.conf to recovery /etc
Jin Qian [Thu, 8 Jun 2017 00:52:27 +0000 (17:52 -0700)]
ext4_utils: copy mke2fs.conf to recovery /etc

Bug: 35219933
Change-Id: I9af35a32adde24d751e5b11f9efcf6eca252db74
(cherry picked from commit 4fb76ecad69f85921f0c0ffb03f4559db898aba2)

6 years agoMerge "simpleperf: update simpleperf prebuilts to build 4194070."
Yabin Cui [Thu, 20 Jul 2017 00:58:44 +0000 (00:58 +0000)]
Merge "simpleperf: update simpleperf prebuilts to build 4194070."

6 years agosimpleperf: update simpleperf prebuilts to build 4194070.
Yabin Cui [Wed, 19 Jul 2017 17:11:45 +0000 (10:11 -0700)]
simpleperf: update simpleperf prebuilts to build 4194070.

Taken from branch aosp-master.

Test: None.

Change-Id: Ie060ccd602cec70a1bae1c6bbca85f0d045606ac

7 years agoMerge "simpleperf: add test for dumping regs for tracepoint events."
Treehugger Robot [Tue, 18 Jul 2017 02:44:41 +0000 (02:44 +0000)]
Merge "simpleperf: add test for dumping regs for tracepoint events."

7 years agosimpleperf: add test for dumping regs for tracepoint events.
Yabin Cui [Mon, 17 Jul 2017 21:36:37 +0000 (14:36 -0700)]
simpleperf: add test for dumping regs for tracepoint events.

If the test fails, probably a kernel patch is missing:
5b09a094f2 arm64: perf: Fix callchain parse error with kernel tracepoint events

To support the test, also enable recording tracepoint events in
app's context.

Bug: http://b/29520177
Test: run CtsSimpleperfTestCases64 on devices.

Change-Id: I085114113732366305e92f6a1e6c3b6efc6ff5ff

7 years agoMerge "Add event monitoring to Inferno."
Treehugger Robot [Mon, 17 Jul 2017 18:35:22 +0000 (18:35 +0000)]
Merge "Add event monitoring to Inferno."

7 years agoMerge "simpleperf: replace config file with cmdline options."
Yabin Cui [Mon, 17 Jul 2017 18:13:28 +0000 (18:13 +0000)]
Merge "simpleperf: replace config file with cmdline options."

7 years agoMerge "simpleperf: change the way running cts tests."
Treehugger Robot [Sat, 15 Jul 2017 05:18:31 +0000 (05:18 +0000)]
Merge "simpleperf: change the way running cts tests."

7 years agosimpleperf: change the way running cts tests.
Yabin Cui [Fri, 14 Jul 2017 22:59:56 +0000 (15:59 -0700)]
simpleperf: change the way running cts tests.

Before this CL, CtsSimpleperfTestCases copies itself to the app's
directory, then run it using run-as.

With this CL, CtsSimpleperfTestCases keeps itself in /data/local/tmp,
but forces stat/record cmd to run with --app option. This gives
more freedom to tests:
1. They can stay in shell's context with --in-app option.
2. The stat/record cmds are started in the shell's context, so
they can collect information no available in app's context (like
data in /sys/kernel/debug/tracing/events).

This is a preparation to add tests for recording tracepoint events.
It also matches the way we want users to use simpleperf (with --app option).

Bug: http://b/29520177
Test: run CtsSimpleperfTestCases.

Change-Id: I1709adfb1ff7169df87560226c197e473fdf8516

7 years agosimpleperf: replace config file with cmdline options.
Yabin Cui [Thu, 13 Jul 2017 21:49:42 +0000 (14:49 -0700)]
simpleperf: replace config file with cmdline options.

1. For binary_cache_builder.py, annoate.py and pprof_proto_generator.py,
there are only a few options, use a config file seems overkill, so
replace them with cmdline options.

2. Add cmdline interface for app_profiler.py. It is to simplify usage,
and can be called from tests (will be added).

3. Simplify the way to find tools (including adb,readelf,addr2line),
try to find them in default install location of sdk and ndk. And output
error/warning msg if not found.

4. Raise exception in python are not always helpful for users to find
problems, because the error msg is hidden by exception stack dump. So
replace some log_fatal() with log_exit().

5. Change README.md accordingly.

Bug: http://b/32834638
Test: run scripts manually.

Change-Id: Ic60e496edbe748b801d35144da29f40c3db3e250

7 years agoMerge "simpleperf: support "--app" option in record/stat command."
Treehugger Robot [Fri, 14 Jul 2017 23:32:35 +0000 (23:32 +0000)]
Merge "simpleperf: support "--app" option in record/stat command."

7 years agoMerge changes from topic 'ext4_encryption_flag'
Tom Cherry [Fri, 14 Jul 2017 23:06:30 +0000 (23:06 +0000)]
Merge changes from topic 'ext4_encryption_flag'

* changes:
  ext4_sb.h: make feature flags in fs_info 32-bit
  ext4.h: add EXT4_FEATURE_INCOMPAT_ENCRYPT

7 years agosimpleperf: support "--app" option in record/stat command.
Yabin Cui [Wed, 12 Jul 2017 22:50:20 +0000 (15:50 -0700)]
simpleperf: support "--app" option in record/stat command.

By using --app [package_name] option, users don't need to
manually run run-as or look for the app's process.
It is also good for profiling app startup time.

For simpleperf, it now can start in the shell's context,
and be able to get tracing events information, which can
support profiling tracepoint events for apps. This is
useful for monitoring thread sleep time.

This CL is tested manually, but I will change the
way of running simpleperf cts test to test this.

Bug: http://b/34108866
Test: test manually.

Change-Id: I8db0390af8e49c56dc4860374153f753bbcf9b11

7 years agoAdd event monitoring to Inferno.
Fabien Sanglard [Thu, 13 Jul 2017 17:56:24 +0000 (10:56 -0700)]
Add event monitoring to Inferno.

Change-Id: Ifd695d3b13b0da74c1e87e05c89ceee1101fa22a

7 years agoMerge "Inferno: A framegrapher based on simpleperf"
Fabien Sanglard [Thu, 13 Jul 2017 16:46:21 +0000 (16:46 +0000)]
Merge "Inferno: A framegrapher based on simpleperf"

7 years agoMerge "os-release.d: set the default version to four numbers."
Treehugger Robot [Thu, 13 Jul 2017 05:46:38 +0000 (05:46 +0000)]
Merge "os-release.d: set the default version to four numbers."

7 years agoMerge "simpleperf: add test for recording cpu-clock."
Treehugger Robot [Thu, 13 Jul 2017 01:30:30 +0000 (01:30 +0000)]
Merge "simpleperf: add test for recording cpu-clock."

7 years agoos-release.d: set the default version to four numbers.
Sen Jiang [Tue, 4 Apr 2017 20:24:56 +0000 (13:24 -0700)]
os-release.d: set the default version to four numbers.

We will report system_version and product_version separately to Omaha,
so revert back to using four numbers for version.

Test: cat $OUT/system/etc/os-release.d/system_version
Change-Id: Ife69a7a17d1a06cc9127540cb39f27ce4fd0c944
(cherry picked from commit d454042d764713ead2b87b78f4d2292d2d422d45)

7 years agoInferno: A framegrapher based on simpleperf
Fabien Sanglard [Wed, 28 Jun 2017 20:18:52 +0000 (13:18 -0700)]
Inferno: A framegrapher based on simpleperf

Inferno generates flamegraph for an entire process in one click.
The HTML report is automatically opened in the machine browser.

To run it on surfaceflinger, start UIBench to generate load and:
 - ./inferno.sh (Linux/MacOS)
 - ./inferno.bat (Windows)

See report.html for a sample report.

Change-Id: I35a20fcfe4b385dbf45832bef0ff69b80a44e1d6

7 years agoMerge "simpleperf: enforce support of dwarf based callgraph."
Yabin Cui [Thu, 13 Jul 2017 00:42:36 +0000 (00:42 +0000)]
Merge "simpleperf: enforce support of dwarf based callgraph."

7 years agosimpleperf: enforce support of dwarf based callgraph.
Yabin Cui [Wed, 12 Jul 2017 21:50:07 +0000 (14:50 -0700)]
simpleperf: enforce support of dwarf based callgraph.

If it is not supported by the kernel, it may be because
a kernel patch "perf: Fix arch_perf_out_copy_user default",
or a configuration HAVE_PERF_USER_STACK_DUMP is missing.

Bug: http://b/63634097
Test: run simpleperf_unit_tests.
Change-Id: I4d3b2de72925c3566bcb0ebe41872919b7312687

7 years agosimpleperf: add test for recording cpu-clock.
Yabin Cui [Wed, 12 Jul 2017 21:25:46 +0000 (14:25 -0700)]
simpleperf: add test for recording cpu-clock.

Bug: http://b/63135835
Test: run the test on marlin.
Change-Id: I5b51eaafb596dc7df886b59b5ea208ae9c2c739a

7 years agoext4_sb.h: make feature flags in fs_info 32-bit
Eric Biggers [Thu, 6 Jul 2017 19:44:40 +0000 (12:44 -0700)]
ext4_sb.h: make feature flags in fs_info 32-bit

The feature flag fields in the ext4 superblock are 32-bit, so they
should be 32-bit in fs_info too.

Bug: 36231741
Change-Id: I719953ac389d1c7f503db0b669c2815c44807f9f

7 years agoext4.h: add EXT4_FEATURE_INCOMPAT_ENCRYPT
Eric Biggers [Mon, 15 May 2017 21:19:24 +0000 (14:19 -0700)]
ext4.h: add EXT4_FEATURE_INCOMPAT_ENCRYPT

fs_mgr needs to know the value of the encrypt feature flag (added to
ext4 in upstream kernel v4.1) so it can enable it.

Bug: 36231741
Change-Id: I7475ea8424fa5a2c4712634eada3095e938e97e3

7 years agoMerge "kernel.config: check console-ramoops-0"
Treehugger Robot [Wed, 28 Jun 2017 14:19:03 +0000 (14:19 +0000)]
Merge "kernel.config: check console-ramoops-0"

7 years agokernel.config: check console-ramoops-0
Mark Salyzyn [Tue, 27 Jun 2017 16:36:52 +0000 (09:36 -0700)]
kernel.config: check console-ramoops-0

On later kernels /sys/fs/pstore/console-ramoops becomes
/sys/fs/pstore/console-ramoops-0. One or the other is
present, but not both.

Test: none
Bug: 63058217
Change-Id: I4b54cfdd9f347735ccd2debd08a1baa167c9a24f

7 years agoMerge "simpleperf: add demo for kotlin."
Yabin Cui [Tue, 27 Jun 2017 21:20:39 +0000 (21:20 +0000)]
Merge "simpleperf: add demo for kotlin."

7 years agosimpleperf: add demo for kotlin.
Yabin Cui [Tue, 27 Jun 2017 01:40:36 +0000 (18:40 -0700)]
simpleperf: add demo for kotlin.

And fix annotate.py to include kotlin source code.

Bug: http://b/32834638
Test: profile the app on bullhead and marlin using scripts manually.
Change-Id: Ic812cd2f8db7d047ceac58e3f5ae6a3f19e1879f

7 years agoMerge "use f2fs upstream host to generate image"
Jin Qian [Mon, 26 Jun 2017 19:07:49 +0000 (19:07 +0000)]
Merge "use f2fs upstream host to generate image"

7 years agouse f2fs upstream host to generate image
Yang Jin [Thu, 22 Jun 2017 18:20:51 +0000 (11:20 -0700)]
use f2fs upstream host to generate image

calls make_f2fs -S <size> <filename>

Test: ./mkf2fsuserimg.sh ~/android/userdata.img 2000000000
Bug: 62493641
Change-Id: I4d3631a631fbdfbfc680eeba5f2a1dde204cba25
Merged-In: I4d3631a631fbdfbfc680eeba5f2a1dde204cba25

7 years agoMerge "simpleperf: fix the way to pull perf.data on windows."
Yabin Cui [Fri, 23 Jun 2017 21:38:34 +0000 (21:38 +0000)]
Merge "simpleperf: fix the way to pull perf.data on windows."

7 years agosimpleperf: fix the way to pull perf.data on windows.
Yabin Cui [Wed, 21 Jun 2017 22:57:31 +0000 (15:57 -0700)]
simpleperf: fix the way to pull perf.data on windows.

Bug: http://b/32834638
Test: run app_profiler.py on linux/darwin/windows.
Change-Id: Id932ad7d0a21598eae7d844e6c33c6e64df22c5a

7 years agoMerge "simpleperf: fix x86 register dump on x86_64."
Yabin Cui [Thu, 22 Jun 2017 21:58:47 +0000 (21:58 +0000)]
Merge "simpleperf: fix x86 register dump on x86_64."

7 years agosimpleperf: fix x86 register dump on x86_64.
Yabin Cui [Thu, 22 Jun 2017 20:02:29 +0000 (13:02 -0700)]
simpleperf: fix x86 register dump on x86_64.

x86_64 linux kernel doesn't support dumping registers like DS.
If simpleperf32 requests dumping these registers, it will fail.
So don't request them to avoid failure.

Bug: None.
Test: run simpleperf32 manually on x86_64.
Change-Id: I220ce5378bad8f0c3c9deb2ef32128fd3262b96d

7 years agoMerge "simpleperf: Support Ctrl-C in app_profiler.py."
Yabin Cui [Thu, 22 Jun 2017 19:05:06 +0000 (19:05 +0000)]
Merge "simpleperf: Support Ctrl-C in app_profiler.py."

7 years agoMerge "simpleperf: fix importing tkinter in report.py."
Yabin Cui [Thu, 22 Jun 2017 02:46:46 +0000 (02:46 +0000)]
Merge "simpleperf: fix importing tkinter in report.py."

7 years agosimpleperf: Support Ctrl-C in app_profiler.py.
Yabin Cui [Wed, 21 Jun 2017 19:19:36 +0000 (12:19 -0700)]
simpleperf: Support Ctrl-C in app_profiler.py.

Bug: http://b/32834638
Test: kill app_profiler.py with Ctrl-C manually.

Change-Id: I03b8813080b45e324c66ce3de27e5dd1f8849446

7 years agosimpleperf: fix importing tkinter in report.py.
Yabin Cui [Wed, 21 Jun 2017 23:50:09 +0000 (16:50 -0700)]
simpleperf: fix importing tkinter in report.py.

On darwin/windows, python2.7 doesn't have tkinter.
So we need to try both tkinter and Tkinter.

Also make the font size larger. Because the old size
is too small on darwin.

Bug: http://b/32834638
Test: run report.py on linux/darwin/windows.
Change-Id: I8bb0b51fcdd99f70b01d4ca2ee2e9e9a6447870a

7 years agoMerge "simpleperf: update simpleperf prebuilts to build 4120823."
Yabin Cui [Wed, 21 Jun 2017 19:13:38 +0000 (19:13 +0000)]
Merge "simpleperf: update simpleperf prebuilts to build 4120823."

7 years agosimpleperf: update simpleperf prebuilts to build 4120823.
Yabin Cui [Wed, 21 Jun 2017 18:43:53 +0000 (11:43 -0700)]
simpleperf: update simpleperf prebuilts to build 4120823.

Taken from branch aosp-master.

Bug: None
Test: None

Change-Id: Ifa518c6af1f1f9201e324092f82e8b97407aa85e

7 years agoMerge "simpleperf: create libsimpleperf_record library."
Treehugger Robot [Tue, 20 Jun 2017 02:14:56 +0000 (02:14 +0000)]
Merge "simpleperf: create libsimpleperf_record library."