Add android package list proto
Bug: 137228176
Change-Id: I72739342f4be018c20a44a2bd93544fd97e88aeb
diff --git a/Android.bp b/Android.bp
index 37f4a13..b255f00 100644
--- a/Android.bp
+++ b/Android.bp
@@ -24,6 +24,7 @@
"src/trace_processor/metrics/android/android_lmk.sql",
"src/trace_processor/metrics/android/android_mem.sql",
"src/trace_processor/metrics/android/android_mem_unagg.sql",
+ "src/trace_processor/metrics/android/android_package_list.sql",
"src/trace_processor/metrics/android/android_powrails.sql",
"src/trace_processor/metrics/android/android_process_growth.sql",
"src/trace_processor/metrics/android/android_startup.sql",
@@ -1315,6 +1316,7 @@
"protos/perfetto/metrics/android/lmk_metric.proto",
"protos/perfetto/metrics/android/mem_metric.proto",
"protos/perfetto/metrics/android/mem_unagg_metric.proto",
+ "protos/perfetto/metrics/android/package_list.proto",
"protos/perfetto/metrics/android/powrails_metric.proto",
"protos/perfetto/metrics/android/process_growth.proto",
"protos/perfetto/metrics/android/startup_metric.proto",
@@ -1332,6 +1334,7 @@
"external/perfetto/protos/perfetto/metrics/android/lmk_metric.pbzero.cc",
"external/perfetto/protos/perfetto/metrics/android/mem_metric.pbzero.cc",
"external/perfetto/protos/perfetto/metrics/android/mem_unagg_metric.pbzero.cc",
+ "external/perfetto/protos/perfetto/metrics/android/package_list.pbzero.cc",
"external/perfetto/protos/perfetto/metrics/android/powrails_metric.pbzero.cc",
"external/perfetto/protos/perfetto/metrics/android/process_growth.pbzero.cc",
"external/perfetto/protos/perfetto/metrics/android/startup_metric.pbzero.cc",
@@ -1349,6 +1352,7 @@
"protos/perfetto/metrics/android/lmk_metric.proto",
"protos/perfetto/metrics/android/mem_metric.proto",
"protos/perfetto/metrics/android/mem_unagg_metric.proto",
+ "protos/perfetto/metrics/android/package_list.proto",
"protos/perfetto/metrics/android/powrails_metric.proto",
"protos/perfetto/metrics/android/process_growth.proto",
"protos/perfetto/metrics/android/startup_metric.proto",
@@ -1366,6 +1370,7 @@
"external/perfetto/protos/perfetto/metrics/android/lmk_metric.pbzero.h",
"external/perfetto/protos/perfetto/metrics/android/mem_metric.pbzero.h",
"external/perfetto/protos/perfetto/metrics/android/mem_unagg_metric.pbzero.h",
+ "external/perfetto/protos/perfetto/metrics/android/package_list.pbzero.h",
"external/perfetto/protos/perfetto/metrics/android/powrails_metric.pbzero.h",
"external/perfetto/protos/perfetto/metrics/android/process_growth.pbzero.h",
"external/perfetto/protos/perfetto/metrics/android/startup_metric.pbzero.h",
diff --git a/BUILD b/BUILD
index c8267a2..177caca 100644
--- a/BUILD
+++ b/BUILD
@@ -31,6 +31,7 @@
"src/trace_processor/metrics/android/android_lmk.sql",
"src/trace_processor/metrics/android/android_mem.sql",
"src/trace_processor/metrics/android/android_mem_unagg.sql",
+ "src/trace_processor/metrics/android/android_package_list.sql",
"src/trace_processor/metrics/android/android_powrails.sql",
"src/trace_processor/metrics/android/android_process_growth.sql",
"src/trace_processor/metrics/android/android_startup.sql",
diff --git a/protos/BUILD b/protos/BUILD
index 98bdfdb..6685775 100644
--- a/protos/BUILD
+++ b/protos/BUILD
@@ -240,6 +240,7 @@
"perfetto/metrics/android/lmk_metric.proto",
"perfetto/metrics/android/mem_metric.proto",
"perfetto/metrics/android/mem_unagg_metric.proto",
+ "perfetto/metrics/android/package_list.proto",
"perfetto/metrics/android/powrails_metric.proto",
"perfetto/metrics/android/process_growth.proto",
"perfetto/metrics/android/startup_metric.proto",
@@ -285,6 +286,7 @@
"perfetto/metrics/android/lmk_metric.proto",
"perfetto/metrics/android/mem_metric.proto",
"perfetto/metrics/android/mem_unagg_metric.proto",
+ "perfetto/metrics/android/package_list.proto",
"perfetto/metrics/android/powrails_metric.proto",
"perfetto/metrics/android/process_growth.proto",
"perfetto/metrics/android/startup_metric.proto",
diff --git a/protos/perfetto/metrics/android/BUILD.gn b/protos/perfetto/metrics/android/BUILD.gn
index aa9fb8c..6a560dc 100644
--- a/protos/perfetto/metrics/android/BUILD.gn
+++ b/protos/perfetto/metrics/android/BUILD.gn
@@ -27,6 +27,7 @@
"powrails_metric.proto",
"startup_metric.proto",
"heap_profile.proto",
+ "package_list.proto",
]
proto_library("lite") {
diff --git a/protos/perfetto/metrics/android/package_list.proto b/protos/perfetto/metrics/android/package_list.proto
new file mode 100644
index 0000000..3525294
--- /dev/null
+++ b/protos/perfetto/metrics/android/package_list.proto
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2019 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.
+ */
+syntax = "proto2";
+option optimize_for = LITE_RUNTIME;
+
+package perfetto.protos;
+
+message AndroidPackageList {
+ message Package {
+ optional string package_name = 1;
+ optional int64 uid = 2;
+ optional int64 version_code = 3;
+ }
+
+ repeated Package packages = 1;
+}
diff --git a/protos/perfetto/metrics/metrics.proto b/protos/perfetto/metrics/metrics.proto
index 4bb8f7a..1f64ac2 100644
--- a/protos/perfetto/metrics/metrics.proto
+++ b/protos/perfetto/metrics/metrics.proto
@@ -29,6 +29,7 @@
import "perfetto/metrics/android/powrails_metric.proto";
import "perfetto/metrics/android/startup_metric.proto";
import "perfetto/metrics/android/heap_profile.proto";
+import "perfetto/metrics/android/package_list.proto";
// Trace processor statistics (taken from the stats table schema and contents).
// TODO: perhaps add the other columns once we have enum support
@@ -44,7 +45,7 @@
// Root message for all Perfetto-based metrics.
//
-// Next id: 12
+// Next id: 13
message TraceMetrics {
// Battery counters metric on Android.
optional AndroidBatteryMetric android_batt = 5;
@@ -61,6 +62,9 @@
// is clear that this data is necessary.
optional AndroidMemoryUnaggregatedMetric android_mem_unagg = 11;
+ // Package list.
+ optional AndroidPackageList android_package_list = 12;
+
// Per-process memory growth metrics.
optional AndroidProcessGrowth android_process_growth = 10;
@@ -76,12 +80,12 @@
// Startup metrics on Android (owned by the Android Telemetry team).
optional AndroidStartupMetric android_startup = 2;
- // Error statistics (applicable to all traces).
- optional TraceStatistics error_statistics = 3;
-
// Heap profile stats.
optional HeapProfile heap_profile = 4;
+ // Error statistics (applicable to all traces).
+ optional TraceStatistics error_statistics = 3;
+
// Demo extensions.
extensions 450 to 499;
diff --git a/src/trace_processor/metrics/BUILD.gn b/src/trace_processor/metrics/BUILD.gn
index ffbab2f..b8eb3a7 100644
--- a/src/trace_processor/metrics/BUILD.gn
+++ b/src/trace_processor/metrics/BUILD.gn
@@ -29,6 +29,7 @@
"android/android_task_state.sql",
"android/android_startup.sql",
"android/android_startup_cpu.sql",
+ "android/android_package_list.sql",
"android/heap_profile.sql",
"android/process_unagg_mem_view.sql",
"android/process_mem.sql",
diff --git a/src/trace_processor/metrics/android/android_package_list.sql b/src/trace_processor/metrics/android/android_package_list.sql
new file mode 100644
index 0000000..12051a1
--- /dev/null
+++ b/src/trace_processor/metrics/android/android_package_list.sql
@@ -0,0 +1,48 @@
+--
+-- Copyright 2019 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
+--
+-- https://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.
+--
+
+-- Generate a table mapping package names to their attributes
+CREATE VIEW package_args AS
+SELECT args.arg_set_id, args.key, args.string_value, args.int_value
+FROM metadata JOIN args ON metadata.int_value = args.arg_set_id
+WHERE metadata.name = 'android_packages_list';
+
+CREATE TABLE package_list(
+ package_name TEXT PRIMARY KEY,
+ uid INT,
+ version_code INT
+);
+
+INSERT INTO package_list
+SELECT names.name, uids.uid, versions.version
+FROM
+ (SELECT arg_set_id, string_value name FROM package_args WHERE key = 'name')
+ AS names
+ JOIN (SELECT arg_set_id, int_value uid FROM package_args WHERE key = 'uid')
+ AS uids USING (arg_set_id)
+ JOIN (SELECT arg_set_id, int_value version FROM package_args WHERE key = 'version_code')
+ AS versions USING (arg_set_id);
+
+CREATE VIEW android_package_list_output AS
+SELECT AndroidPackageList(
+ 'packages', (
+ SELECT RepeatedField(AndroidPackageList_Package(
+ 'package_name', package_name,
+ 'uid', uid,
+ 'version_code', version_code
+ )) FROM package_list
+ )
+);
diff --git a/src/trace_processor/metrics/metrics.descriptor.h b/src/trace_processor/metrics/metrics.descriptor.h
index 4ef24a6..6d09d6a 100644
--- a/src/trace_processor/metrics/metrics.descriptor.h
+++ b/src/trace_processor/metrics/metrics.descriptor.h
@@ -12,14 +12,14 @@
// SHA1(tools/gen_binary_descriptors)
// 750d7d8f95621b45d4b6430d6f8808087a8702e6
// SHA1(protos/perfetto/metrics/metrics.proto)
-// 64b69f66fb87ffcb6d7924681a0c0a307b6a48c0
+// 74bbe222e9bc51d07f404ce30fb79ca418b3a847
// This is the proto Metrics encoded as a ProtoFileDescriptor to allow
// for reflection without libprotobuf full/non-lite protos.
namespace perfetto {
-constexpr std::array<uint8_t, 7951> kMetricsDescriptor{
+constexpr std::array<uint8_t, 8347> kMetricsDescriptor{
{0x0a, 0x91, 0x03, 0x0a, 0x2a, 0x70, 0x65, 0x72, 0x66, 0x65, 0x74, 0x74,
0x6f, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x61, 0x6e,
0x64, 0x72, 0x6f, 0x69, 0x64, 0x2f, 0x62, 0x61, 0x74, 0x74, 0x5f, 0x6d,
@@ -555,7 +555,29 @@
0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x43, 0x61, 0x6c, 0x6c, 0x73, 0x69,
0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x52, 0x0d, 0x63, 0x61, 0x6c,
0x6c, 0x73, 0x69, 0x74, 0x65, 0x53, 0x74, 0x61, 0x74, 0x73, 0x42, 0x02,
- 0x48, 0x03, 0x0a, 0xf6, 0x0b, 0x0a, 0x1e, 0x70, 0x65, 0x72, 0x66, 0x65,
+ 0x48, 0x03, 0x0a, 0x85, 0x02, 0x0a, 0x2b, 0x70, 0x65, 0x72, 0x66, 0x65,
+ 0x74, 0x74, 0x6f, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f,
+ 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x2f, 0x70, 0x61, 0x63, 0x6b,
+ 0x61, 0x67, 0x65, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x12, 0x0f, 0x70, 0x65, 0x72, 0x66, 0x65, 0x74, 0x74, 0x6f,
+ 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x22, 0xc0, 0x01, 0x0a, 0x12,
+ 0x41, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61,
+ 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x47, 0x0a, 0x08, 0x70, 0x61,
+ 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b,
+ 0x32, 0x2b, 0x2e, 0x70, 0x65, 0x72, 0x66, 0x65, 0x74, 0x74, 0x6f, 0x2e,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x41, 0x6e, 0x64, 0x72, 0x6f,
+ 0x69, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x4c, 0x69, 0x73,
+ 0x74, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x52, 0x08, 0x70,
+ 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x73, 0x1a, 0x61, 0x0a, 0x07, 0x50,
+ 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x12, 0x21, 0x0a, 0x0c, 0x70, 0x61,
+ 0x63, 0x6b, 0x61, 0x67, 0x65, 0x5f, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67,
+ 0x65, 0x4e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x69, 0x64,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x03, 0x52, 0x03, 0x75, 0x69, 0x64, 0x12,
+ 0x21, 0x0a, 0x0c, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x5f, 0x63,
+ 0x6f, 0x64, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0b, 0x76,
+ 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x64, 0x65, 0x42, 0x02,
+ 0x48, 0x03, 0x0a, 0xfa, 0x0c, 0x0a, 0x1e, 0x70, 0x65, 0x72, 0x66, 0x65,
0x74, 0x74, 0x6f, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f,
0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74,
0x6f, 0x12, 0x0f, 0x70, 0x65, 0x72, 0x66, 0x65, 0x74, 0x74, 0x6f, 0x2e,
@@ -597,46 +619,57 @@
0x74, 0x74, 0x6f, 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f,
0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x2f, 0x68, 0x65, 0x61, 0x70,
0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x22, 0x94, 0x01, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x63, 0x65,
- 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x3c,
- 0x0a, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28,
- 0x0b, 0x32, 0x26, 0x2e, 0x70, 0x65, 0x72, 0x66, 0x65, 0x74, 0x74, 0x6f,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x63,
- 0x65, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e,
- 0x45, 0x6e, 0x74, 0x72, 0x79, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79,
- 0x1a, 0x43, 0x0a, 0x05, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x12, 0x0a,
- 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
- 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x78,
- 0x18, 0x02, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x03, 0x69, 0x64, 0x78, 0x12,
- 0x14, 0x0a, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01,
- 0x28, 0x03, 0x52, 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xe3, 0x06,
- 0x0a, 0x0c, 0x54, 0x72, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69,
- 0x63, 0x73, 0x12, 0x48, 0x0a, 0x0c, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69,
- 0x64, 0x5f, 0x62, 0x61, 0x74, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b,
- 0x32, 0x25, 0x2e, 0x70, 0x65, 0x72, 0x66, 0x65, 0x74, 0x74, 0x6f, 0x2e,
- 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x41, 0x6e, 0x64, 0x72, 0x6f,
- 0x69, 0x64, 0x42, 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x4d, 0x65, 0x74,
- 0x72, 0x69, 0x63, 0x52, 0x0b, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64,
- 0x42, 0x61, 0x74, 0x74, 0x12, 0x42, 0x0a, 0x0b, 0x61, 0x6e, 0x64, 0x72,
- 0x6f, 0x69, 0x64, 0x5f, 0x63, 0x70, 0x75, 0x18, 0x06, 0x20, 0x01, 0x28,
- 0x0b, 0x32, 0x21, 0x2e, 0x70, 0x65, 0x72, 0x66, 0x65, 0x74, 0x74, 0x6f,
- 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x41, 0x6e, 0x64, 0x72,
- 0x6f, 0x69, 0x64, 0x43, 0x70, 0x75, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63,
- 0x52, 0x0a, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x43, 0x70, 0x75,
- 0x12, 0x45, 0x0a, 0x0b, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x5f,
- 0x6d, 0x65, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e,
+ 0x74, 0x6f, 0x1a, 0x2b, 0x70, 0x65, 0x72, 0x66, 0x65, 0x74, 0x74, 0x6f,
+ 0x2f, 0x6d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x2f, 0x61, 0x6e, 0x64,
+ 0x72, 0x6f, 0x69, 0x64, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65,
+ 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22,
+ 0x94, 0x01, 0x0a, 0x0f, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x74, 0x61,
+ 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x3c, 0x0a, 0x05, 0x65,
+ 0x6e, 0x74, 0x72, 0x79, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x26,
+ 0x2e, 0x70, 0x65, 0x72, 0x66, 0x65, 0x74, 0x74, 0x6f, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x74,
+ 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2e, 0x45, 0x6e, 0x74,
+ 0x72, 0x79, 0x52, 0x05, 0x65, 0x6e, 0x74, 0x72, 0x79, 0x1a, 0x43, 0x0a,
+ 0x05, 0x45, 0x6e, 0x74, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61,
+ 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61,
+ 0x6d, 0x65, 0x12, 0x10, 0x0a, 0x03, 0x69, 0x64, 0x78, 0x18, 0x02, 0x20,
+ 0x01, 0x28, 0x0d, 0x52, 0x03, 0x69, 0x64, 0x78, 0x12, 0x14, 0x0a, 0x05,
+ 0x76, 0x61, 0x6c, 0x75, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52,
+ 0x05, 0x76, 0x61, 0x6c, 0x75, 0x65, 0x22, 0xba, 0x07, 0x0a, 0x0c, 0x54,
+ 0x72, 0x61, 0x63, 0x65, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x73, 0x12,
+ 0x48, 0x0a, 0x0c, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x5f, 0x62,
+ 0x61, 0x74, 0x74, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e,
0x70, 0x65, 0x72, 0x66, 0x65, 0x74, 0x74, 0x6f, 0x2e, 0x70, 0x72, 0x6f,
- 0x74, 0x6f, 0x73, 0x2e, 0x41, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x4d,
- 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52,
- 0x0a, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x4d, 0x65, 0x6d, 0x12,
- 0x5c, 0x0a, 0x11, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x5f, 0x6d,
- 0x65, 0x6d, 0x5f, 0x75, 0x6e, 0x61, 0x67, 0x67, 0x18, 0x0b, 0x20, 0x01,
- 0x28, 0x0b, 0x32, 0x30, 0x2e, 0x70, 0x65, 0x72, 0x66, 0x65, 0x74, 0x74,
- 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x41, 0x6e, 0x64,
- 0x72, 0x6f, 0x69, 0x64, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x55, 0x6e,
- 0x61, 0x67, 0x67, 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65,
- 0x74, 0x72, 0x69, 0x63, 0x52, 0x0f, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69,
- 0x64, 0x4d, 0x65, 0x6d, 0x55, 0x6e, 0x61, 0x67, 0x67, 0x12, 0x5b, 0x0a,
+ 0x74, 0x6f, 0x73, 0x2e, 0x41, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x42,
+ 0x61, 0x74, 0x74, 0x65, 0x72, 0x79, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63,
+ 0x52, 0x0b, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x42, 0x61, 0x74,
+ 0x74, 0x12, 0x42, 0x0a, 0x0b, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64,
+ 0x5f, 0x63, 0x70, 0x75, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x21,
+ 0x2e, 0x70, 0x65, 0x72, 0x66, 0x65, 0x74, 0x74, 0x6f, 0x2e, 0x70, 0x72,
+ 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x41, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64,
+ 0x43, 0x70, 0x75, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x0a, 0x61,
+ 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x43, 0x70, 0x75, 0x12, 0x45, 0x0a,
+ 0x0b, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x5f, 0x6d, 0x65, 0x6d,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x24, 0x2e, 0x70, 0x65, 0x72,
+ 0x66, 0x65, 0x74, 0x74, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73,
+ 0x2e, 0x41, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x4d, 0x65, 0x6d, 0x6f,
+ 0x72, 0x79, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x0a, 0x61, 0x6e,
+ 0x64, 0x72, 0x6f, 0x69, 0x64, 0x4d, 0x65, 0x6d, 0x12, 0x5c, 0x0a, 0x11,
+ 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x5f, 0x6d, 0x65, 0x6d, 0x5f,
+ 0x75, 0x6e, 0x61, 0x67, 0x67, 0x18, 0x0b, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x30, 0x2e, 0x70, 0x65, 0x72, 0x66, 0x65, 0x74, 0x74, 0x6f, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x41, 0x6e, 0x64, 0x72, 0x6f, 0x69,
+ 0x64, 0x4d, 0x65, 0x6d, 0x6f, 0x72, 0x79, 0x55, 0x6e, 0x61, 0x67, 0x67,
+ 0x72, 0x65, 0x67, 0x61, 0x74, 0x65, 0x64, 0x4d, 0x65, 0x74, 0x72, 0x69,
+ 0x63, 0x52, 0x0f, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x4d, 0x65,
+ 0x6d, 0x55, 0x6e, 0x61, 0x67, 0x67, 0x12, 0x55, 0x0a, 0x14, 0x61, 0x6e,
+ 0x64, 0x72, 0x6f, 0x69, 0x64, 0x5f, 0x70, 0x61, 0x63, 0x6b, 0x61, 0x67,
+ 0x65, 0x5f, 0x6c, 0x69, 0x73, 0x74, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b,
+ 0x32, 0x23, 0x2e, 0x70, 0x65, 0x72, 0x66, 0x65, 0x74, 0x74, 0x6f, 0x2e,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x41, 0x6e, 0x64, 0x72, 0x6f,
+ 0x69, 0x64, 0x50, 0x61, 0x63, 0x6b, 0x61, 0x67, 0x65, 0x4c, 0x69, 0x73,
+ 0x74, 0x52, 0x12, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x50, 0x61,
+ 0x63, 0x6b, 0x61, 0x67, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x5b, 0x0a,
0x16, 0x61, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x5f, 0x70, 0x72, 0x6f,
0x63, 0x65, 0x73, 0x73, 0x5f, 0x67, 0x72, 0x6f, 0x77, 0x74, 0x68, 0x18,
0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x25, 0x2e, 0x70, 0x65, 0x72, 0x66,
@@ -669,18 +702,18 @@
0x2e, 0x41, 0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x53, 0x74, 0x61, 0x72,
0x74, 0x75, 0x70, 0x4d, 0x65, 0x74, 0x72, 0x69, 0x63, 0x52, 0x0e, 0x61,
0x6e, 0x64, 0x72, 0x6f, 0x69, 0x64, 0x53, 0x74, 0x61, 0x72, 0x74, 0x75,
- 0x70, 0x12, 0x4b, 0x0a, 0x10, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x5f, 0x73,
- 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x18, 0x03, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70, 0x65, 0x72, 0x66, 0x65, 0x74,
- 0x74, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x54, 0x72,
- 0x61, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63,
- 0x73, 0x52, 0x0f, 0x65, 0x72, 0x72, 0x6f, 0x72, 0x53, 0x74, 0x61, 0x74,
- 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x12, 0x3f, 0x0a, 0x0c, 0x68, 0x65,
- 0x61, 0x70, 0x5f, 0x70, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x04,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x70, 0x65, 0x72, 0x66, 0x65,
- 0x74, 0x74, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x48,
- 0x65, 0x61, 0x70, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x0b,
- 0x68, 0x65, 0x61, 0x70, 0x50, 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x2a,
+ 0x70, 0x12, 0x3f, 0x0a, 0x0c, 0x68, 0x65, 0x61, 0x70, 0x5f, 0x70, 0x72,
+ 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32,
+ 0x1c, 0x2e, 0x70, 0x65, 0x72, 0x66, 0x65, 0x74, 0x74, 0x6f, 0x2e, 0x70,
+ 0x72, 0x6f, 0x74, 0x6f, 0x73, 0x2e, 0x48, 0x65, 0x61, 0x70, 0x50, 0x72,
+ 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x52, 0x0b, 0x68, 0x65, 0x61, 0x70, 0x50,
+ 0x72, 0x6f, 0x66, 0x69, 0x6c, 0x65, 0x12, 0x4b, 0x0a, 0x10, 0x65, 0x72,
+ 0x72, 0x6f, 0x72, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69,
+ 0x63, 0x73, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x20, 0x2e, 0x70,
+ 0x65, 0x72, 0x66, 0x65, 0x74, 0x74, 0x6f, 0x2e, 0x70, 0x72, 0x6f, 0x74,
+ 0x6f, 0x73, 0x2e, 0x54, 0x72, 0x61, 0x63, 0x65, 0x53, 0x74, 0x61, 0x74,
+ 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x52, 0x0f, 0x65, 0x72, 0x72, 0x6f,
+ 0x72, 0x53, 0x74, 0x61, 0x74, 0x69, 0x73, 0x74, 0x69, 0x63, 0x73, 0x2a,
0x06, 0x08, 0xc2, 0x03, 0x10, 0xf4, 0x03, 0x2a, 0x06, 0x08, 0xf4, 0x03,
0x10, 0xe9, 0x07, 0x42, 0x02, 0x48, 0x03}};
diff --git a/test/metrics/android_package_list.out b/test/metrics/android_package_list.out
new file mode 100644
index 0000000..d14f35b
--- /dev/null
+++ b/test/metrics/android_package_list.out
@@ -0,0 +1,7 @@
+android_package_list {
+ packages {
+ package_name: "com.my.pkg"
+ uid: 123
+ version_code: 456000
+ }
+}
diff --git a/test/metrics/android_package_list.py b/test/metrics/android_package_list.py
new file mode 100644
index 0000000..e8dd0ae
--- /dev/null
+++ b/test/metrics/android_package_list.py
@@ -0,0 +1,24 @@
+#!/usr/bin/python
+# Copyright (C) 2018 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.
+
+from os import sys, path
+
+sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
+import synth_common
+
+trace = synth_common.create_trace()
+trace.add_package_list(1, 'com.my.pkg', 123, 456000)
+
+print(trace.trace.SerializeToString())
diff --git a/test/metrics/index b/test/metrics/index
index 6a6201c..41d447e 100644
--- a/test/metrics/index
+++ b/test/metrics/index
@@ -14,4 +14,6 @@
android_startup_battery.py android_batt android_batt_counters.out
android_startup_cpu.py android_cpu android_startup_cpu.out
-android_startup_powrails.py android_powrails android_startup_powrails.out
\ No newline at end of file
+android_startup_powrails.py android_powrails android_startup_powrails.out
+
+android_package_list.py android_package_list android_package_list.out
diff --git a/test/synth_common.py b/test/synth_common.py
index 066345b..273e74c 100644
--- a/test/synth_common.py
+++ b/test/synth_common.py
@@ -196,6 +196,15 @@
energy_data.timestamp_ms = ts
energy_data.energy = value
+ def add_package_list(self, ts, name, uid, version_code):
+ packet = self.add_packet()
+ packet.timestamp = ts
+ plist = packet.packages_list
+ pinfo = plist.packages.add()
+ pinfo.name = name
+ pinfo.uid = uid
+ pinfo.version_code = version_code
+
def create_trace():
parser = argparse.ArgumentParser()
parser.add_argument(