summaryrefslogtreecommitdiff
path: root/simpleperf/demo/SimpleperfExampleOfKotlin
diff options
context:
space:
mode:
authorYabin Cui <yabinc@google.com>2018-04-09 14:06:08 -0700
committerYabin Cui <yabinc@google.com>2018-04-10 17:19:36 -0700
commit40b70ffb58d830edefad2c82a9d33e1c7ce91138 (patch)
treed71c951e6f27018db90a0b0edafdb1632e039aab /simpleperf/demo/SimpleperfExampleOfKotlin
parent5eb57e19b83b467784d0bcae4f7ff1fe14ce4a7b (diff)
downloadextras-40b70ffb58d830edefad2c82a9d33e1c7ce91138.tar.gz
simpleperf: Improve the way downloading native libs on device.
Apks are usually built with stripped native libs, so app_profiler.py supports downloading native libs on device, and pass the native lib directory to simpleperf via --symfs option. However, it has below problems: 1. It needs to download native libs each time profiling. 2. It needs to wait until the app starts and read the /proc/pid/maps to know which native libs are needed. This patch solves the problems as below: 1. When app_profiler.py downloads native libs, it will write a build_id_list file in the native lib directory, which is a map from build_id to debug library path. 2. Simpleperf searchs build_id_list in the native lib directory, and uses build_id to find the debug files it needs. 3. Before downloading libs, app_profiler.py checks build_id_list to find libs available on device, thus avoids downloading libs more than once. Add tests in simpleperf_unit_test and test.py. Update demos to Android Studio 3.2. In profiling.gradle, remove the logic preventing stripping native libs in apk to test this patch. Another reason to remove it is because I found it affects release builds. Bug: http://b/69165587 Test: run simpleperf_unit_test && python test.py. Change-Id: I8ecf7ba2c0f58c131c261c1b4546f4916aea1f82
Diffstat (limited to 'simpleperf/demo/SimpleperfExampleOfKotlin')
-rw-r--r--simpleperf/demo/SimpleperfExampleOfKotlin/.idea/caches/build_file_checksums.serbin0 -> 552 bytes
-rw-r--r--simpleperf/demo/SimpleperfExampleOfKotlin/.idea/codeStyles/Project.xml29
-rw-r--r--simpleperf/demo/SimpleperfExampleOfKotlin/.idea/kotlinc.xml8
-rw-r--r--simpleperf/demo/SimpleperfExampleOfKotlin/.idea/misc.xml7
-rw-r--r--simpleperf/demo/SimpleperfExampleOfKotlin/app/build/outputs/apk/profiling/app-profiling.apkbin1975972 -> 1963814 bytes
-rw-r--r--simpleperf/demo/SimpleperfExampleOfKotlin/app/profiling.gradle2
-rw-r--r--simpleperf/demo/SimpleperfExampleOfKotlin/build.gradle2
-rw-r--r--simpleperf/demo/SimpleperfExampleOfKotlin/gradle/wrapper/gradle-wrapper.properties4
8 files changed, 44 insertions, 8 deletions
diff --git a/simpleperf/demo/SimpleperfExampleOfKotlin/.idea/caches/build_file_checksums.ser b/simpleperf/demo/SimpleperfExampleOfKotlin/.idea/caches/build_file_checksums.ser
new file mode 100644
index 00000000..3da69c6b
--- /dev/null
+++ b/simpleperf/demo/SimpleperfExampleOfKotlin/.idea/caches/build_file_checksums.ser
Binary files differ
diff --git a/simpleperf/demo/SimpleperfExampleOfKotlin/.idea/codeStyles/Project.xml b/simpleperf/demo/SimpleperfExampleOfKotlin/.idea/codeStyles/Project.xml
new file mode 100644
index 00000000..30aa626c
--- /dev/null
+++ b/simpleperf/demo/SimpleperfExampleOfKotlin/.idea/codeStyles/Project.xml
@@ -0,0 +1,29 @@
+<component name="ProjectCodeStyleConfiguration">
+ <code_scheme name="Project" version="173">
+ <Objective-C-extensions>
+ <file>
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Import" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Macro" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Typedef" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Enum" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Constant" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Global" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Struct" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="FunctionPredecl" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Function" />
+ </file>
+ <class>
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Property" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="Synthesize" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InitMethod" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="StaticMethod" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="InstanceMethod" />
+ <option name="com.jetbrains.cidr.lang.util.OCDeclarationKind" value="DeallocMethod" />
+ </class>
+ <extensions>
+ <pair source="cpp" header="h" fileNamingConvention="NONE" />
+ <pair source="c" header="h" fileNamingConvention="NONE" />
+ </extensions>
+ </Objective-C-extensions>
+ </code_scheme>
+</component> \ No newline at end of file
diff --git a/simpleperf/demo/SimpleperfExampleOfKotlin/.idea/kotlinc.xml b/simpleperf/demo/SimpleperfExampleOfKotlin/.idea/kotlinc.xml
new file mode 100644
index 00000000..1d2cf4e1
--- /dev/null
+++ b/simpleperf/demo/SimpleperfExampleOfKotlin/.idea/kotlinc.xml
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+ <component name="KotlinCommonCompilerArguments">
+ <option name="errors">
+ <ArgumentParseErrors />
+ </option>
+ </component>
+</project> \ No newline at end of file
diff --git a/simpleperf/demo/SimpleperfExampleOfKotlin/.idea/misc.xml b/simpleperf/demo/SimpleperfExampleOfKotlin/.idea/misc.xml
index 39638799..99202cc2 100644
--- a/simpleperf/demo/SimpleperfExampleOfKotlin/.idea/misc.xml
+++ b/simpleperf/demo/SimpleperfExampleOfKotlin/.idea/misc.xml
@@ -5,11 +5,12 @@
<option name="myDefaultNotNull" value="android.support.annotation.NonNull" />
<option name="myNullables">
<value>
- <list size="4">
+ <list size="5">
<item index="0" class="java.lang.String" itemvalue="org.jetbrains.annotations.Nullable" />
<item index="1" class="java.lang.String" itemvalue="javax.annotation.Nullable" />
- <item index="2" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
- <item index="3" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
+ <item index="2" class="java.lang.String" itemvalue="javax.annotation.CheckForNull" />
+ <item index="3" class="java.lang.String" itemvalue="edu.umd.cs.findbugs.annotations.Nullable" />
+ <item index="4" class="java.lang.String" itemvalue="android.support.annotation.Nullable" />
</list>
</value>
</option>
diff --git a/simpleperf/demo/SimpleperfExampleOfKotlin/app/build/outputs/apk/profiling/app-profiling.apk b/simpleperf/demo/SimpleperfExampleOfKotlin/app/build/outputs/apk/profiling/app-profiling.apk
index 50b88caf..414fd6e6 100644
--- a/simpleperf/demo/SimpleperfExampleOfKotlin/app/build/outputs/apk/profiling/app-profiling.apk
+++ b/simpleperf/demo/SimpleperfExampleOfKotlin/app/build/outputs/apk/profiling/app-profiling.apk
Binary files differ
diff --git a/simpleperf/demo/SimpleperfExampleOfKotlin/app/profiling.gradle b/simpleperf/demo/SimpleperfExampleOfKotlin/app/profiling.gradle
index 257adbaf..aa23c8d2 100644
--- a/simpleperf/demo/SimpleperfExampleOfKotlin/app/profiling.gradle
+++ b/simpleperf/demo/SimpleperfExampleOfKotlin/app/profiling.gradle
@@ -13,8 +13,6 @@ android {
}
}
packagingOptions {
- // Contain debug info in the libraries.
- doNotStrip "**.so"
// Exclude wrap.sh for architectures not built.
if (abiFiltersForWrapScript) {
diff --git a/simpleperf/demo/SimpleperfExampleOfKotlin/build.gradle b/simpleperf/demo/SimpleperfExampleOfKotlin/build.gradle
index 65872e75..ba06bb9f 100644
--- a/simpleperf/demo/SimpleperfExampleOfKotlin/build.gradle
+++ b/simpleperf/demo/SimpleperfExampleOfKotlin/build.gradle
@@ -7,7 +7,7 @@ buildscript {
jcenter()
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.0.0'
+ classpath 'com.android.tools.build:gradle:3.2.0-alpha09'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
diff --git a/simpleperf/demo/SimpleperfExampleOfKotlin/gradle/wrapper/gradle-wrapper.properties b/simpleperf/demo/SimpleperfExampleOfKotlin/gradle/wrapper/gradle-wrapper.properties
index 8727af9b..be54b8d6 100644
--- a/simpleperf/demo/SimpleperfExampleOfKotlin/gradle/wrapper/gradle-wrapper.properties
+++ b/simpleperf/demo/SimpleperfExampleOfKotlin/gradle/wrapper/gradle-wrapper.properties
@@ -1,6 +1,6 @@
-#Fri Oct 27 18:12:06 PDT 2017
+#Tue Apr 10 15:23:21 PDT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip