summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Makoto Onuki <omakoto@google.com> 2024-03-27 13:08:32 -0700
committer Makoto Onuki <omakoto@google.com> 2024-03-28 11:00:33 -0700
commita3fe562c5c09052e05d8e974461348f8992e2c76 (patch)
tree4655b321f961ddc841fa21dfd12540869b605b87
parent59d51e26042526b37bed90c3e25755149224d570 (diff)
Add Script to collect ravenwood stats *.csv files
Also re-organize the f/b/ravenwood directory. Test: ./ravenwood/scripts/run-ravenwood-tests.sh Bug: 292141694 Change-Id: Icf6677c8ab8ead76148ae5278cb54d38fa0b34f2
-rw-r--r--Ravenwood.bp24
-rw-r--r--ravenwood/Android.bp4
-rwxr-xr-xravenwood/ravenwood-stats-checker.sh5
-rw-r--r--ravenwood/scripts/bulk_enable.py (renamed from ravenwood/bulk_enable.py)0
-rwxr-xr-xravenwood/scripts/fix_test_runner.py (renamed from ravenwood/fix_test_runner.py)0
-rwxr-xr-xravenwood/scripts/list-ravenwood-tests.sh (renamed from ravenwood/list-ravenwood-tests.sh)0
-rwxr-xr-xravenwood/scripts/ravenwood-stats-checker.sh18
-rwxr-xr-xravenwood/scripts/ravenwood-stats-collector.sh52
-rwxr-xr-xravenwood/scripts/run-ravenwood-tests.sh (renamed from ravenwood/run-ravenwood-tests.sh)2
-rw-r--r--ravenwood/texts/framework-minus-apex-ravenwood-policies.txt (renamed from ravenwood/framework-minus-apex-ravenwood-policies.txt)0
-rw-r--r--ravenwood/texts/ravenwood-annotation-allowed-classes.txt (renamed from ravenwood/ravenwood-annotation-allowed-classes.txt)0
-rw-r--r--ravenwood/texts/ravenwood-services-jarjar-rules.txt (renamed from ravenwood/ravenwood-services-jarjar-rules.txt)0
-rw-r--r--ravenwood/texts/ravenwood-standard-options.txt (renamed from ravenwood/ravenwood-standard-options.txt)0
-rw-r--r--ravenwood/texts/services.core-ravenwood-policies.txt (renamed from ravenwood/services.core-ravenwood-policies.txt)0
14 files changed, 85 insertions, 20 deletions
diff --git a/Ravenwood.bp b/Ravenwood.bp
index 6237e3ec0f07..c3b22c4f4331 100644
--- a/Ravenwood.bp
+++ b/Ravenwood.bp
@@ -30,7 +30,7 @@ java_genrule {
name: "framework-minus-apex.ravenwood-base",
tools: ["hoststubgen"],
cmd: "$(location hoststubgen) " +
- "@$(location ravenwood/ravenwood-standard-options.txt) " +
+ "@$(location ravenwood/texts/ravenwood-standard-options.txt) " +
"--debug-log $(location hoststubgen_framework-minus-apex.log) " +
"--stats-file $(location hoststubgen_framework-minus-apex_stats.csv) " +
@@ -41,13 +41,13 @@ java_genrule {
"--gen-input-dump-file $(location hoststubgen_dump.txt) " +
"--in-jar $(location :framework-minus-apex-for-hoststubgen) " +
- "--policy-override-file $(location ravenwood/framework-minus-apex-ravenwood-policies.txt) " +
- "--annotation-allowed-classes-file $(location ravenwood/ravenwood-annotation-allowed-classes.txt) ",
+ "--policy-override-file $(location ravenwood/texts/framework-minus-apex-ravenwood-policies.txt) " +
+ "--annotation-allowed-classes-file $(location ravenwood/texts/ravenwood-annotation-allowed-classes.txt) ",
srcs: [
":framework-minus-apex-for-hoststubgen",
- "ravenwood/framework-minus-apex-ravenwood-policies.txt",
- "ravenwood/ravenwood-standard-options.txt",
- "ravenwood/ravenwood-annotation-allowed-classes.txt",
+ "ravenwood/texts/framework-minus-apex-ravenwood-policies.txt",
+ "ravenwood/texts/ravenwood-standard-options.txt",
+ "ravenwood/texts/ravenwood-annotation-allowed-classes.txt",
],
out: [
"ravenwood.jar",
@@ -104,7 +104,7 @@ java_genrule {
name: "services.core.ravenwood-base",
tools: ["hoststubgen"],
cmd: "$(location hoststubgen) " +
- "@$(location ravenwood/ravenwood-standard-options.txt) " +
+ "@$(location ravenwood/texts/ravenwood-standard-options.txt) " +
"--debug-log $(location hoststubgen_services.core.log) " +
"--stats-file $(location hoststubgen_services.core_stats.csv) " +
@@ -115,13 +115,13 @@ java_genrule {
"--gen-input-dump-file $(location hoststubgen_dump.txt) " +
"--in-jar $(location :services.core-for-hoststubgen) " +
- "--policy-override-file $(location ravenwood/services.core-ravenwood-policies.txt) " +
- "--annotation-allowed-classes-file $(location ravenwood/ravenwood-annotation-allowed-classes.txt) ",
+ "--policy-override-file $(location ravenwood/texts/services.core-ravenwood-policies.txt) " +
+ "--annotation-allowed-classes-file $(location ravenwood/texts/ravenwood-annotation-allowed-classes.txt) ",
srcs: [
":services.core-for-hoststubgen",
- "ravenwood/services.core-ravenwood-policies.txt",
- "ravenwood/ravenwood-standard-options.txt",
- "ravenwood/ravenwood-annotation-allowed-classes.txt",
+ "ravenwood/texts/services.core-ravenwood-policies.txt",
+ "ravenwood/texts/ravenwood-standard-options.txt",
+ "ravenwood/texts/ravenwood-annotation-allowed-classes.txt",
],
out: [
"ravenwood.jar",
diff --git a/ravenwood/Android.bp b/ravenwood/Android.bp
index f4337d41aead..8905ad3273d8 100644
--- a/ravenwood/Android.bp
+++ b/ravenwood/Android.bp
@@ -151,7 +151,7 @@ java_device_for_host {
filegroup {
name: "ravenwood-services-jarjar-rules",
- srcs: ["ravenwood-services-jarjar-rules.txt"],
+ srcs: ["texts/ravenwood-services-jarjar-rules.txt"],
visibility: ["//frameworks/base"],
}
@@ -159,7 +159,7 @@ filegroup {
// The "test" just shows the available stats filenames.
sh_test_host {
name: "ravenwood-stats-checker",
- src: "ravenwood-stats-checker.sh",
+ src: "scripts/ravenwood-stats-checker.sh",
test_suites: ["general-tests"],
data: [
":framework-minus-apex.ravenwood.stats",
diff --git a/ravenwood/ravenwood-stats-checker.sh b/ravenwood/ravenwood-stats-checker.sh
deleted file mode 100755
index fb58e7228461..000000000000
--- a/ravenwood/ravenwood-stats-checker.sh
+++ /dev/null
@@ -1,5 +0,0 @@
-#!/bin/bash
-
-# Just print the available *.csv filenames.
-echo '#Stats files:'
-ls *.csv \ No newline at end of file
diff --git a/ravenwood/bulk_enable.py b/ravenwood/scripts/bulk_enable.py
index aafaaff7561a..aafaaff7561a 100644
--- a/ravenwood/bulk_enable.py
+++ b/ravenwood/scripts/bulk_enable.py
diff --git a/ravenwood/fix_test_runner.py b/ravenwood/scripts/fix_test_runner.py
index 99b7a1ff226b..99b7a1ff226b 100755
--- a/ravenwood/fix_test_runner.py
+++ b/ravenwood/scripts/fix_test_runner.py
diff --git a/ravenwood/list-ravenwood-tests.sh b/ravenwood/scripts/list-ravenwood-tests.sh
index fb9b823ee93b..fb9b823ee93b 100755
--- a/ravenwood/list-ravenwood-tests.sh
+++ b/ravenwood/scripts/list-ravenwood-tests.sh
diff --git a/ravenwood/scripts/ravenwood-stats-checker.sh b/ravenwood/scripts/ravenwood-stats-checker.sh
new file mode 100755
index 000000000000..93f4a3fe4333
--- /dev/null
+++ b/ravenwood/scripts/ravenwood-stats-checker.sh
@@ -0,0 +1,18 @@
+#!/bin/bash
+# Copyright (C) 2024 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Just print the available *.csv filenames.
+echo '#Stats files:'
+ls *.csv \ No newline at end of file
diff --git a/ravenwood/scripts/ravenwood-stats-collector.sh b/ravenwood/scripts/ravenwood-stats-collector.sh
new file mode 100755
index 000000000000..4dcaa2be5af3
--- /dev/null
+++ b/ravenwood/scripts/ravenwood-stats-collector.sh
@@ -0,0 +1,52 @@
+#!/bin/bash
+# Copyright (C) 2024 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Script to collect the ravenwood "stats" CVS files and create a single file.
+
+set -e
+
+# Output file
+out=/tmp/ravenwood-stats-all.csv
+
+# Where the input files are.
+path=$ANDROID_BUILD_TOP/out/host/linux-x86/testcases/ravenwood-stats-checker/x86_64/
+
+m() {
+ ${ANDROID_BUILD_TOP}/build/soong/soong_ui.bash --make-mode "$@"
+}
+
+# Building this will generate the files we need.
+m ravenwood-stats-checker
+
+# Start...
+
+cd $path
+
+dump() {
+ local jar=$1
+ local file=$2
+
+ sed -e '1d' -e "s/^/$jar,/" $file
+}
+
+collect() {
+ echo 'Jar,PackageName,ClassName,SupportedMethods,TotalMethods'
+ dump "framework-minus-apex" hoststubgen_framework-minus-apex_stats.csv
+ dump "service.core" hoststubgen_services.core_stats.csv
+}
+
+collect >$out
+
+echo "Full dump CVS created at $out"
diff --git a/ravenwood/run-ravenwood-tests.sh b/ravenwood/scripts/run-ravenwood-tests.sh
index a303626bb445..926c08f4e689 100755
--- a/ravenwood/run-ravenwood-tests.sh
+++ b/ravenwood/scripts/run-ravenwood-tests.sh
@@ -15,7 +15,7 @@
# Run all the ravenwood tests + hoststubgen unit tests.
-all_tests="hoststubgentest tiny-framework-dump-test hoststubgen-invoke-test"
+all_tests="hoststubgentest tiny-framework-dump-test hoststubgen-invoke-test ravenwood-stats-checker"
# "echo" is to remove the newlines
all_tests="$all_tests $(echo $(${0%/*}/list-ravenwood-tests.sh) )"
diff --git a/ravenwood/framework-minus-apex-ravenwood-policies.txt b/ravenwood/texts/framework-minus-apex-ravenwood-policies.txt
index 371c3acab144..371c3acab144 100644
--- a/ravenwood/framework-minus-apex-ravenwood-policies.txt
+++ b/ravenwood/texts/framework-minus-apex-ravenwood-policies.txt
diff --git a/ravenwood/ravenwood-annotation-allowed-classes.txt b/ravenwood/texts/ravenwood-annotation-allowed-classes.txt
index 9b4d378cc7b7..9b4d378cc7b7 100644
--- a/ravenwood/ravenwood-annotation-allowed-classes.txt
+++ b/ravenwood/texts/ravenwood-annotation-allowed-classes.txt
diff --git a/ravenwood/ravenwood-services-jarjar-rules.txt b/ravenwood/texts/ravenwood-services-jarjar-rules.txt
index 8fdd3408f74d..8fdd3408f74d 100644
--- a/ravenwood/ravenwood-services-jarjar-rules.txt
+++ b/ravenwood/texts/ravenwood-services-jarjar-rules.txt
diff --git a/ravenwood/ravenwood-standard-options.txt b/ravenwood/texts/ravenwood-standard-options.txt
index f64f26d7962a..f64f26d7962a 100644
--- a/ravenwood/ravenwood-standard-options.txt
+++ b/ravenwood/texts/ravenwood-standard-options.txt
diff --git a/ravenwood/services.core-ravenwood-policies.txt b/ravenwood/texts/services.core-ravenwood-policies.txt
index d8d563e05435..d8d563e05435 100644
--- a/ravenwood/services.core-ravenwood-policies.txt
+++ b/ravenwood/texts/services.core-ravenwood-policies.txt