From 87348a64928d3466c727ce7c0b43526f52a7826e Mon Sep 17 00:00:00 2001 From: Muhammad Qureshi Date: Thu, 14 Feb 2019 16:17:52 -0800 Subject: log guardrail limit hit for Duration, Count and Gauge metrics Bug: 120845881 Test: none Change-Id: I257bbed1f624792fb37a27ca2d568a7dbbab5d1e --- cmds/statsd/src/metrics/CountMetricProducer.cpp | 1 + cmds/statsd/src/metrics/DurationMetricProducer.cpp | 2 ++ cmds/statsd/src/metrics/GaugeMetricProducer.cpp | 1 + 3 files changed, 4 insertions(+) (limited to 'cmds') diff --git a/cmds/statsd/src/metrics/CountMetricProducer.cpp b/cmds/statsd/src/metrics/CountMetricProducer.cpp index 254d7d5a38f5..830828b8ab6f 100644 --- a/cmds/statsd/src/metrics/CountMetricProducer.cpp +++ b/cmds/statsd/src/metrics/CountMetricProducer.cpp @@ -266,6 +266,7 @@ bool CountMetricProducer::hitGuardRailLocked(const MetricDimensionKey& newKey) { if (newTupleCount > StatsdStats::kDimensionKeySizeHardLimit) { ALOGE("CountMetric %lld dropping data for dimension key %s", (long long)mMetricId, newKey.toString().c_str()); + StatsdStats::getInstance().noteHardDimensionLimitReached(mMetricId); return true; } } diff --git a/cmds/statsd/src/metrics/DurationMetricProducer.cpp b/cmds/statsd/src/metrics/DurationMetricProducer.cpp index 7dc4e2d91533..378c5804595b 100644 --- a/cmds/statsd/src/metrics/DurationMetricProducer.cpp +++ b/cmds/statsd/src/metrics/DurationMetricProducer.cpp @@ -637,6 +637,7 @@ bool DurationMetricProducer::hitGuardRailLocked(const MetricDimensionKey& newKey if (newTupleCount > StatsdStats::kDimensionKeySizeHardLimit) { ALOGE("DurationMetric %lld dropping data for condition dimension key %s", (long long)mMetricId, newKey.getDimensionKeyInCondition().toString().c_str()); + StatsdStats::getInstance().noteHardDimensionLimitReached(mMetricId); return true; } } @@ -650,6 +651,7 @@ bool DurationMetricProducer::hitGuardRailLocked(const MetricDimensionKey& newKey if (newTupleCount > StatsdStats::kDimensionKeySizeHardLimit) { ALOGE("DurationMetric %lld dropping data for what dimension key %s", (long long)mMetricId, newKey.getDimensionKeyInWhat().toString().c_str()); + StatsdStats::getInstance().noteHardDimensionLimitReached(mMetricId); return true; } } diff --git a/cmds/statsd/src/metrics/GaugeMetricProducer.cpp b/cmds/statsd/src/metrics/GaugeMetricProducer.cpp index 2b6cac8189f3..b6e4272cd32b 100644 --- a/cmds/statsd/src/metrics/GaugeMetricProducer.cpp +++ b/cmds/statsd/src/metrics/GaugeMetricProducer.cpp @@ -433,6 +433,7 @@ bool GaugeMetricProducer::hitGuardRailLocked(const MetricDimensionKey& newKey) { if (newTupleCount > mDimensionHardLimit) { ALOGE("GaugeMetric %lld dropping data for dimension key %s", (long long)mMetricId, newKey.toString().c_str()); + StatsdStats::getInstance().noteHardDimensionLimitReached(mMetricId); return true; } } -- cgit v1.2.3 From 3658fa7f6eaa5eb799d6b8706cbb39403a018fbf Mon Sep 17 00:00:00 2001 From: Ben Blount Date: Mon, 22 Apr 2019 17:31:40 -0700 Subject: Add timing / count for IntelligenceEventReported Some intelligence events would like timing information we can collect via ValueMetrics. We also have a few counters that can be high frequency enough that we will batch them in memory before reporting to statsd such as text annotation metrics for text views. Test: m out/soong/.intermediates/frameworks/base/framework-statslog-gen/gen/android/util/StatsLogInternal.java Change-Id: I9e2d7dab8c51a243afd9950b4380d6c7c98e58db --- cmds/statsd/src/atoms.proto | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cmds') diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto index 68a88162a1bb..4bc918e1eba8 100644 --- a/cmds/statsd/src/atoms.proto +++ b/cmds/statsd/src/atoms.proto @@ -6009,6 +6009,12 @@ message CoolingDevice { * Logged from the Intelligence mainline module. */ message IntelligenceEventReported { + // The event type. optional android.stats.intelligence.EventType event_id = 1; + // Success, failure. optional android.stats.intelligence.Status status = 2; + // How many times the event occured (to report a batch of high frequency events). + optional int32 count = 3; + // How long the event took (averaged for batches). + optional int64 duration_millis = 4; } -- cgit v1.2.3 From f84c641b15e14910babdf0a3e1034088f1df3528 Mon Sep 17 00:00:00 2001 From: Greg Kaiser Date: Wed, 24 Apr 2019 06:15:54 -0700 Subject: incidentd: Move logging statement so it's used We move our ALOGE() to prior to the 'return', so it gets invoked if we get to this logic. Test: TreeHugger Change-Id: Ifcd73d3abe98705cb94616bedd224b4425f4e964 --- cmds/incidentd/src/cipher/ProtoEncryption.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmds') diff --git a/cmds/incidentd/src/cipher/ProtoEncryption.cpp b/cmds/incidentd/src/cipher/ProtoEncryption.cpp index 493796d2af4d..11f0b2ace99a 100644 --- a/cmds/incidentd/src/cipher/ProtoEncryption.cpp +++ b/cmds/incidentd/src/cipher/ProtoEncryption.cpp @@ -87,8 +87,8 @@ status_t ProtoDecryptor::readOneBlock(string* output) { mReader->move(toRead); } if (pos != sectionSize) { - return BAD_VALUE; ALOGE("Failed to read one block"); + return BAD_VALUE; } } else { return BAD_VALUE; -- cgit v1.2.3 From 1f74b05caf1e41f297fdd0e88ca671549aa5fcbb Mon Sep 17 00:00:00 2001 From: lifr Date: Tue, 16 Apr 2019 22:16:30 +0800 Subject: Extend NetworkDnsEventReported and add new DnsCallReported to log per-query information NetworkDnsEventReported -The message represents the entire lookup operation, which may result one or more queries to the recursive DNS resolvers. DnsCallReported - Those DNS queries are individually logged in DnsCallReported to enable computing error rates and network latency and timeouts broken up by query type, transport, network interface, etc Test: make statsd_testdrive ./out/host/linux-x86/bin/statsd_testdrive 116 => pass Bug: 129463409 Change-Id: Ib75affea5d849437a293affbe294732153511d97 --- cmds/statsd/src/atoms.proto | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'cmds') diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto index 4bc918e1eba8..42ba436f4b27 100644 --- a/cmds/statsd/src/atoms.proto +++ b/cmds/statsd/src/atoms.proto @@ -41,7 +41,7 @@ import "frameworks/base/core/proto/android/server/location/enums.proto"; import "frameworks/base/core/proto/android/service/procstats_enum.proto"; import "frameworks/base/core/proto/android/service/usb.proto"; import "frameworks/base/core/proto/android/stats/connectivity/network_stack.proto"; -import "frameworks/base/core/proto/android/stats/connectivity/resolv_stats.proto"; +import "frameworks/base/core/proto/android/stats/dnsresolver/dns_resolver.proto"; import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy.proto"; import "frameworks/base/core/proto/android/stats/devicepolicy/device_policy_enums.proto"; import "frameworks/base/core/proto/android/stats/docsui/docsui_enums.proto"; @@ -5034,36 +5034,36 @@ message AppCompacted { * Logs a DNS lookup operation initiated by the system resolver on behalf of an application * invoking native APIs such as getaddrinfo() or Java APIs such as Network#getAllByName(). * - * The top-level message represents the entire lookup operation, which may result one or more - * queries to the recursive DNS resolvers. Those are individually logged in DnsQueryEvent to - * enable computing error rates and network latency and timeouts broken up by query type, - * transport, network interface, etc. + * The NetworkDnsEventReported message represents the entire lookup operation, which may + * result one or more queries to the recursive DNS resolvers. Those are individually logged + * in DnsQueryEvents to enable computing error rates and network latency and timeouts + * broken up by query type, transport, network interface, etc. */ message NetworkDnsEventReported { + optional android.stats.dnsresolver.EventType event_type = 1; - optional android.stats.connectivity.EventType event_type = 1; - - optional android.stats.connectivity.ReturnCode return_code = 2; + optional android.stats.dnsresolver.ReturnCode return_code = 2; // The latency in microseconds of the entire DNS lookup operation. optional int32 latency_micros = 3; - optional android.stats.connectivity.DnsQueryEventRe dns_query_event_re = 4 [(log_mode) = MODE_BYTES]; + // Only valid for event_type = EVENT_GETADDRINFO. + optional int32 hints_ai_flags = 4; - // ResNSend flags defined in android/multinetwork.h - optional int32 flags = 5; + // Flags passed to android_res_nsend() defined in multinetwork.h + // Only valid for event_type = EVENT_RESNSEND. + optional int32 res_nsend_flags = 5; - optional android.net.NetworkCapabilitiesProto.Transport network_type = 6; + optional android.stats.dnsresolver.Transport network_type = 6; // The DNS over TLS mode on a specific netId. - optional android.stats.connectivity.PrivateDnsModes private_dns_modes = 7; + optional android.stats.dnsresolver.PrivateDnsModes private_dns_modes = 7; // Additional pass-through fields opaque to statsd. // The DNS resolver Mainline module can add new fields here without requiring an OS update. - optional android.stats.connectivity.DnsCallEvent dns_call_event = 8 [(log_mode) = MODE_BYTES]; + optional android.stats.dnsresolver.DnsQueryEvents dns_query_events = 8 [(log_mode) = MODE_BYTES]; } - /** * Logs when a data stall event occurs. * -- cgit v1.2.3 From 509ef150f23531b18fe29ef85337312f54535300 Mon Sep 17 00:00:00 2001 From: Tyler Gunn Date: Thu, 25 Apr 2019 14:28:47 -0700 Subject: Change command like set-default-dialer to be a test override. RoleManager likes to terminate apps when roles are changed which does not work in CTS tests. We need to use a temp override in Telecom for now. Test: Run the CTS tests over, and over and over again. Bug: 131065482 Change-Id: Id36942f2813abdfa0020ce4805c492a69bd07d0e --- cmds/telecom/src/com/android/commands/telecom/Telecom.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'cmds') diff --git a/cmds/telecom/src/com/android/commands/telecom/Telecom.java b/cmds/telecom/src/com/android/commands/telecom/Telecom.java index 1b7fbfe0e32c..052445095afe 100644 --- a/cmds/telecom/src/com/android/commands/telecom/Telecom.java +++ b/cmds/telecom/src/com/android/commands/telecom/Telecom.java @@ -95,7 +95,8 @@ public final class Telecom extends BaseCommand { + "telecom set-phone-account-disabled: Disables the given phone account, if it \n" + " has already been registered with telecom.\n" + "\n" - + "telecom set-default-dialer: Sets the default dialer to the given component. \n" + + "telecom set-default-dialer: Sets the override default dialer to the given " + + "component; this will override whatever the dialer role is set to. \n" + "\n" + "telecom get-default-dialer: Displays the current default dialer. \n" + "\n" @@ -254,13 +255,8 @@ public final class Telecom extends BaseCommand { private void runSetDefaultDialer() throws RemoteException { final String packageName = nextArgRequired(); - final boolean success = mTelecomService.setDefaultDialer(packageName); - if (success) { - System.out.println("Success - " + packageName + " set as default dialer."); - } else { - System.out.println("Error - " + packageName + " is not an installed Dialer app, \n" - + " or is already the default dialer."); - } + mTelecomService.setTestDefaultDialer(packageName); + System.out.println("Success - " + packageName + " set as override default dialer."); } private void runGetDefaultDialer() throws RemoteException { -- cgit v1.2.3 From 2ec750457e7fae3c09b1e6bcd3f9e4f6cde3108c Mon Sep 17 00:00:00 2001 From: Yao Chen Date: Tue, 30 Apr 2019 20:19:21 +0000 Subject: Revert "incidentd: Move logging statement so it's used" This reverts commit f84c641b15e14910babdf0a3e1034088f1df3528. Reason for revert: As part of the revert of encryption inside incidentd Change-Id: Ia70c35f7d952bfc9c12db24dd373388f29343002 --- cmds/incidentd/src/cipher/ProtoEncryption.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmds') diff --git a/cmds/incidentd/src/cipher/ProtoEncryption.cpp b/cmds/incidentd/src/cipher/ProtoEncryption.cpp index 11f0b2ace99a..493796d2af4d 100644 --- a/cmds/incidentd/src/cipher/ProtoEncryption.cpp +++ b/cmds/incidentd/src/cipher/ProtoEncryption.cpp @@ -87,8 +87,8 @@ status_t ProtoDecryptor::readOneBlock(string* output) { mReader->move(toRead); } if (pos != sectionSize) { - ALOGE("Failed to read one block"); return BAD_VALUE; + ALOGE("Failed to read one block"); } } else { return BAD_VALUE; -- cgit v1.2.3 From 508181e2b725afbccf6e531a5913dca84bf30645 Mon Sep 17 00:00:00 2001 From: Al Sutton Date: Tue, 30 Apr 2019 11:22:04 +0100 Subject: Add TEST_MAPPING for backup paths Fixes: 131298070 Test: Gerrit verification that tests are running Change-Id: I3eab9721f1f4e74d70b718ca8f54943278ef6ee1 --- cmds/bmgr/TEST_MAPPING | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 cmds/bmgr/TEST_MAPPING (limited to 'cmds') diff --git a/cmds/bmgr/TEST_MAPPING b/cmds/bmgr/TEST_MAPPING new file mode 100644 index 000000000000..7c0e79e7692d --- /dev/null +++ b/cmds/bmgr/TEST_MAPPING @@ -0,0 +1,11 @@ +{ + "presubmit": [ + ], + "postsubmit": [ + ], + "imports": [ + { + "path": "frameworks/base/services/backup" + } + ] +} -- cgit v1.2.3 From e3223f3d4c8e39f5d3fa91cb7d3a480949821c3e Mon Sep 17 00:00:00 2001 From: Ben Blount Date: Thu, 2 May 2019 22:49:03 -0700 Subject: Update usage comment for IntelligenceEventReported Sum is a better way to use this atom as it's less error prone and has less rounding error with computing average based on sum. Test: build --- cmds/statsd/src/atoms.proto | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'cmds') diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto index 004eef7af457..2bc73abea3da 100644 --- a/cmds/statsd/src/atoms.proto +++ b/cmds/statsd/src/atoms.proto @@ -6250,6 +6250,6 @@ message IntelligenceEventReported { optional android.stats.intelligence.Status status = 2; // How many times the event occured (to report a batch of high frequency events). optional int32 count = 3; - // How long the event took (averaged for batches). + // How long the event took (sum of durations if count > 1) optional int64 duration_millis = 4; } -- cgit v1.2.3 From 420947c4cc237ec3bf286d10cbd74d4971e8d82e Mon Sep 17 00:00:00 2001 From: Adam He Date: Wed, 23 Jan 2019 15:59:09 -0800 Subject: Metrics for content capture. Bug: 119613670 Test: statsd_testdrive & manual test Change-Id: If43465ccee7454a7ebf9e15caa23fce7bae33cfe --- cmds/statsd/src/atoms.proto | 93 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 93 insertions(+) (limited to 'cmds') diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto index f5dd8523a4c2..8e786378e322 100644 --- a/cmds/statsd/src/atoms.proto +++ b/cmds/statsd/src/atoms.proto @@ -299,6 +299,10 @@ message Atom { CarPowerStateChanged car_power_state_changed = 203; GarageModeInfo garage_mode_info = 204; TestAtomReported test_atom_reported = 205 [(log_from_module) = "cts"]; + ContentCaptureCallerMismatchReported content_capture_caller_mismatch_reported = 206; + ContentCaptureServiceEvents content_capture_service_events = 207; + ContentCaptureSessionEvents content_capture_session_events = 208; + ContentCaptureFlushed content_capture_flushed = 209; } // Pulled events will start at field 10000. @@ -4829,6 +4833,95 @@ message BuildInformation { optional string tags = 9; } +/** + * Logs information about mismatched caller for content capture. + * + * Logged from: + * frameworks/base/core/java/android/service/contentcapture/ContentCaptureService.java + */ +message ContentCaptureCallerMismatchReported { + optional string intended_package = 1; + optional string calling_package = 2; +} + +/** + * Logs information about content capture service events. + * + * Logged from: + * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java + */ +message ContentCaptureServiceEvents { + // The type of event. + enum Event { + UNKNOWN = 0; + ON_CONNECTED = 1; + ON_DISCONNECTED = 2; + SET_WHITELIST = 3; + SET_DISABLED = 4; + ON_USER_DATA_REMOVED = 5; + } + optional Event event = 1; + // component/package of content capture service. + optional string service_info = 2; + // component/package of target. + // it's a concatenated list of component/package for SET_WHITELIST event + // separated by " ". + optional string target_info = 3; +} + +/** + * Logs information about content capture session events. + * + * Logged from: + * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java + */ +message ContentCaptureSessionEvents { + // The type of event. + enum Event { + UNKNOWN = 0; + ON_SESSION_STARTED = 1; + ON_SESSION_FINISHED = 2; + SESSION_NOT_CREATED = 3; + } + optional int32 session_id = 1; + optional Event event = 2; + // (n/a on session finished) + optional int32 state_flags = 3; + // component/package of content capture service. + optional string service_info = 4; + // component/package of app. + // (n/a on session finished) + optional string app_info = 5; + optional bool is_child_session = 6; +} + +/** + * Logs information about session being flushed. + * + * Logged from: + * frameworks/base/services/contentcapture/java/com/android/server/contentcapture/ContentCaptureMetricsLogger.java + */ +message ContentCaptureFlushed { + optional int32 session_id = 1; + // component/package of content capture service. + optional string service_info = 2; + // component/package of app. + optional string app_info = 3; + // session start/finish events + optional int32 child_session_started = 4; + optional int32 child_session_finished = 5; + // count of view events. + optional int32 view_appeared_count = 6; + optional int32 view_disappeared_count = 7; + optional int32 view_text_changed_count = 8; + + // Flush stats. + optional int32 max_events = 9; + optional int32 idle_flush_freq = 10; + optional int32 text_flush_freq = 11; + optional int32 flush_reason = 12; +} + /** * Pulls on-device BatteryStats power use calculations for the overall device. */ -- cgit v1.2.3 From 09a847902fa428f97841c3689b9f11243cc60460 Mon Sep 17 00:00:00 2001 From: Ryan Savitski Date: Mon, 3 Jun 2019 23:57:09 +0100 Subject: userdebug: support perfetto traces as a section in incident reports This set of patches adds a way for the perfetto command line client to save a trace to a hardcoded location, /data/misc/perfetto-traces/incident-trace, and call into incidentd to start a report, which will include said trace in a new section. This is not a long-term solution, and is structured to minimize changes to perfetto and incidentd. The latter is currently architected in a way where it can only pull pre-defined information out of the system, so we're resorting to persisting the intermediate results in a hardcoded location. This will introduce at most two more linked files at the same time. Bug: 130543265 Tested: manually on blueline-userdebug Change-Id: Iaaa312d2d9da73ca329807211227a8c7a049102c --- cmds/incident_helper/src/main.cpp | 2 ++ cmds/incidentd/src/Section.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'cmds') diff --git a/cmds/incident_helper/src/main.cpp b/cmds/incident_helper/src/main.cpp index 809a77163fb4..ff5fd86cf11e 100644 --- a/cmds/incident_helper/src/main.cpp +++ b/cmds/incident_helper/src/main.cpp @@ -72,6 +72,8 @@ static TextParserBase* selectParser(int section) { return new PsParser(); case 2006: return new BatteryTypeParser(); + case 3026: // system_trace is already a serialized protobuf + return new NoopParser(); default: // Return no op parser when no specific ones are implemented. return new NoopParser(); diff --git a/cmds/incidentd/src/Section.cpp b/cmds/incidentd/src/Section.cpp index 85c5a20174c3..1572114c639f 100644 --- a/cmds/incidentd/src/Section.cpp +++ b/cmds/incidentd/src/Section.cpp @@ -67,6 +67,8 @@ bool section_requires_specific_mention(int sectionId) { switch (sectionId) { case 3025: // restricted_images return true; + case 3026: // system_trace + return true; default: return false; } -- cgit v1.2.3 From c298eedb02f7f6bb4af1930f3d66d60f64ca81be Mon Sep 17 00:00:00 2001 From: tsaichristine Date: Thu, 6 Jun 2019 13:40:43 -0700 Subject: Add tsaichristine to owners list Test: make Change-Id: Ib57879aeb6eec14d797212bdcbacf1a6c57922f6 --- cmds/statsd/OWNERS | 1 + 1 file changed, 1 insertion(+) (limited to 'cmds') diff --git a/cmds/statsd/OWNERS b/cmds/statsd/OWNERS index 380e499a5abf..04464ce02b4f 100644 --- a/cmds/statsd/OWNERS +++ b/cmds/statsd/OWNERS @@ -3,5 +3,6 @@ joeo@google.com jtnguyen@google.com muhammadq@google.com singhtejinder@google.com +tsaichristine@google.com yaochen@google.com yro@google.com -- cgit v1.2.3 From 77987ed47f5a0c11052c9f33f1d7933ca60e50b5 Mon Sep 17 00:00:00 2001 From: Rafal Slawik Date: Mon, 17 Jun 2019 12:28:23 +0100 Subject: Add atom for per-process system ion heap size The pulling code will be added in the next commit. Bug: 130526489 Test: statsd_testdrive Change-Id: I0fea4b6a7a8dbbdc574fb342c1e07aa0165bf797 --- cmds/statsd/src/atoms.proto | 25 ++++++++++++++++++++++++- cmds/statsd/src/external/StatsPullerManager.cpp | 3 +++ 2 files changed, 27 insertions(+), 1 deletion(-) (limited to 'cmds') diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto index e91e87935963..194d7e5dec10 100644 --- a/cmds/statsd/src/atoms.proto +++ b/cmds/statsd/src/atoms.proto @@ -310,7 +310,7 @@ message Atom { } // Pulled events will start at field 10000. - // Next: 10059 + // Next: 10062 oneof pulled { WifiBytesTransfer wifi_bytes_transfer = 10000; WifiBytesTransferByFgBg wifi_bytes_transfer_by_fg_bg = 10001; @@ -373,6 +373,7 @@ message Atom { FaceSettings face_settings = 10058; CoolingDevice cooling_device = 10059; AppOps app_ops = 10060; + ProcessSystemIonHeapSize process_system_ion_heap_size = 10061; } // DO NOT USE field numbers above 100,000 in AOSP. @@ -6351,6 +6352,28 @@ message SystemIonHeapSize { optional int64 size_in_bytes = 1; } +/* + * Logs the per-process size of the system ion heap. + * + * Pulled from StatsCompanionService. + */ +message ProcessSystemIonHeapSize { + // The uid if available. -1 means not available. + optional int32 uid = 1 [(is_uid) = true]; + + // The process name (from /proc/PID/cmdline). + optional string process_name = 2; + + // Sum of sizes of all allocations. + optional int32 total_size_in_kilobytes = 3; + + // Number of allocations. + optional int32 allocation_count = 4; + + // Size of the largest allocation. + optional int32 max_size_in_kilobytes = 5; +} + /** * Push network stack events. * diff --git a/cmds/statsd/src/external/StatsPullerManager.cpp b/cmds/statsd/src/external/StatsPullerManager.cpp index 914d60d3daca..475f18a9b0b8 100644 --- a/cmds/statsd/src/external/StatsPullerManager.cpp +++ b/cmds/statsd/src/external/StatsPullerManager.cpp @@ -156,6 +156,9 @@ std::map StatsPullerManager::kAllPullAtomInfo = { // system_ion_heap_size {android::util::SYSTEM_ION_HEAP_SIZE, {.puller = new StatsCompanionServicePuller(android::util::SYSTEM_ION_HEAP_SIZE)}}, + // process_system_ion_heap_size + {android::util::PROCESS_SYSTEM_ION_HEAP_SIZE, + {.puller = new StatsCompanionServicePuller(android::util::PROCESS_SYSTEM_ION_HEAP_SIZE)}}, // temperature {android::util::TEMPERATURE, {.puller = new StatsCompanionServicePuller(android::util::TEMPERATURE)}}, -- cgit v1.2.3 From 7a57b8e49865b5ebcd00a78cb562a298cc6643a6 Mon Sep 17 00:00:00 2001 From: tsaichristine Date: Mon, 24 Jun 2019 18:25:38 -0700 Subject: Matching regular uid field with pkg name in statsd Bug: 124377157 Test: bit statsd_test:* Change-Id: I6844ea1a9eade4bfcd3698dfbc2bf8475c8e2bec --- cmds/statsd/src/FieldValue.cpp | 14 ++++++++++- cmds/statsd/src/FieldValue.h | 1 + cmds/statsd/src/matchers/matcher_util.cpp | 2 +- cmds/statsd/tests/LogEntryMatcher_test.cpp | 40 ++++++++++++++++++++++++++++++ 4 files changed, 55 insertions(+), 2 deletions(-) (limited to 'cmds') diff --git a/cmds/statsd/src/FieldValue.cpp b/cmds/statsd/src/FieldValue.cpp index 13f5c8ae5fd8..1185127ab805 100644 --- a/cmds/statsd/src/FieldValue.cpp +++ b/cmds/statsd/src/FieldValue.cpp @@ -149,6 +149,18 @@ bool isAttributionUidField(const Field& field, const Value& value) { return false; } +bool isUidField(const Field& field, const Value& value) { + auto it = android::util::AtomsInfo::kAtomsWithUidField.find(field.getTag()); + + if (it != android::util::AtomsInfo::kAtomsWithUidField.end()) { + int uidField = it->second; + return field.getDepth() == 0 && field.getPosAtDepth(0) == uidField && + value.getType() == INT; + } + + return false; +} + Value::Value(const Value& from) { type = from.getType(); switch (type) { @@ -464,4 +476,4 @@ bool HasPositionALL(const FieldMatcher& matcher) { } // namespace statsd } // namespace os -} // namespace android \ No newline at end of file +} // namespace android diff --git a/cmds/statsd/src/FieldValue.h b/cmds/statsd/src/FieldValue.h index 6729e052b5ee..0e033e06c203 100644 --- a/cmds/statsd/src/FieldValue.h +++ b/cmds/statsd/src/FieldValue.h @@ -392,6 +392,7 @@ int getUidIfExists(const FieldValue& value); void translateFieldMatcher(const FieldMatcher& matcher, std::vector* output); bool isAttributionUidField(const Field& field, const Value& value); +bool isUidField(const Field& field, const Value& value); bool equalDimensions(const std::vector& dimension_a, const std::vector& dimension_b); diff --git a/cmds/statsd/src/matchers/matcher_util.cpp b/cmds/statsd/src/matchers/matcher_util.cpp index 8dc5cef988b0..10ac4a182f87 100644 --- a/cmds/statsd/src/matchers/matcher_util.cpp +++ b/cmds/statsd/src/matchers/matcher_util.cpp @@ -84,7 +84,7 @@ bool combinationMatch(const vector& children, const LogicalOperation& opera bool tryMatchString(const UidMap& uidMap, const Field& field, const Value& value, const string& str_match) { - if (isAttributionUidField(field, value)) { + if (isAttributionUidField(field, value) || isUidField(field, value)) { int uid = value.int_value; auto aidIt = UidMap::sAidToUidMapping.find(str_match); if (aidIt != UidMap::sAidToUidMapping.end()) { diff --git a/cmds/statsd/tests/LogEntryMatcher_test.cpp b/cmds/statsd/tests/LogEntryMatcher_test.cpp index 2b9528f7d1de..70f0f6f75a59 100644 --- a/cmds/statsd/tests/LogEntryMatcher_test.cpp +++ b/cmds/statsd/tests/LogEntryMatcher_test.cpp @@ -29,6 +29,7 @@ using std::unordered_map; using std::vector; const int32_t TAG_ID = 123; +const int32_t TAG_ID_2 = 28; // hardcoded tag of atom with uid field const int FIELD_ID_1 = 1; const int FIELD_ID_2 = 2; const int FIELD_ID_3 = 2; @@ -297,6 +298,45 @@ TEST(AtomMatcherTest, TestAttributionMatcher) { EXPECT_FALSE(matchesSimple(uidMap, *simpleMatcher, event)); } +TEST(AtomMatcherTest, TestUidFieldMatcher) { + UidMap uidMap; + uidMap.updateMap( + 1, {1111, 1111, 2222, 3333, 3333} /* uid list */, {1, 1, 2, 1, 2} /* version list */, + {android::String16("v1"), android::String16("v1"), android::String16("v2"), + android::String16("v1"), android::String16("v2")}, + {android::String16("pkg0"), android::String16("pkg1"), android::String16("pkg1"), + android::String16("Pkg2"), android::String16("PkG3")} /* package name list */, + {android::String16(""), android::String16(""), android::String16(""), + android::String16(""), android::String16("")}); + + // Set up matcher + AtomMatcher matcher; + auto simpleMatcher = matcher.mutable_simple_atom_matcher(); + simpleMatcher->set_atom_id(TAG_ID); + simpleMatcher->add_field_value_matcher()->set_field(1); + simpleMatcher->mutable_field_value_matcher(0)->set_eq_string("pkg0"); + + // Set up the event + LogEvent event(TAG_ID, 0); + event.write(1111); + event.init(); + + LogEvent event2(TAG_ID_2, 0); + event2.write(1111); + event2.write("some value"); + event2.init(); + + // Tag not in kAtomsWithUidField + EXPECT_FALSE(matchesSimple(uidMap, *simpleMatcher, event)); + + // Tag found in kAtomsWithUidField and has matching uid + EXPECT_TRUE(matchesSimple(uidMap, *simpleMatcher, event2)); + + // Tag found in kAtomsWithUidField but has non-matching uid + simpleMatcher->mutable_field_value_matcher(0)->set_eq_string("Pkg2"); + EXPECT_FALSE(matchesSimple(uidMap, *simpleMatcher, event2)); +} + TEST(AtomMatcherTest, TestNeqAnyStringMatcher) { UidMap uidMap; uidMap.updateMap( -- cgit v1.2.3 From a7638614520775827fb7c5feba44a3d8fc545530 Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Wed, 3 Jul 2019 17:34:12 -0700 Subject: GpuStats: track Vulkan apps not doing pre-rotation correctly Bug: 135210726 Test: atest statsd_test:GpuStatsPuller_test Change-Id: I9e44e95876dd6d09025e877f450736b6ea9d5da8 --- cmds/statsd/src/atoms.proto | 3 +++ cmds/statsd/src/external/GpuStatsPuller.cpp | 1 + cmds/statsd/tests/external/GpuStatsPuller_test.cpp | 5 ++++- 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'cmds') diff --git a/cmds/statsd/src/atoms.proto b/cmds/statsd/src/atoms.proto index ee500d7c362e..ceabd39aee8b 100644 --- a/cmds/statsd/src/atoms.proto +++ b/cmds/statsd/src/atoms.proto @@ -6360,6 +6360,9 @@ message GpuStatsAppInfo { // CPU Vulkan implementation is in use. optional bool cpu_vulkan_in_use = 6; + + // App is not doing pre-rotation correctly. + optional bool false_prerotation = 7; } /* diff --git a/cmds/statsd/src/external/GpuStatsPuller.cpp b/cmds/statsd/src/external/GpuStatsPuller.cpp index 0d3aca05e0e5..bbdb5405ca05 100644 --- a/cmds/statsd/src/external/GpuStatsPuller.cpp +++ b/cmds/statsd/src/external/GpuStatsPuller.cpp @@ -96,6 +96,7 @@ static bool pullGpuStatsAppInfo(const sp& gpuService, if (!event->write(int64VectorToProtoByteString(info.vkDriverLoadingTime))) return false; if (!event->write(int64VectorToProtoByteString(info.angleDriverLoadingTime))) return false; if (!event->write(info.cpuVulkanInUse)) return false; + if (!event->write(info.falsePrerotation)) return false; event->init(); data->emplace_back(event); } diff --git a/cmds/statsd/tests/external/GpuStatsPuller_test.cpp b/cmds/statsd/tests/external/GpuStatsPuller_test.cpp index bdc52b0af34c..e91fb0d4b27c 100644 --- a/cmds/statsd/tests/external/GpuStatsPuller_test.cpp +++ b/cmds/statsd/tests/external/GpuStatsPuller_test.cpp @@ -56,8 +56,9 @@ static const int32_t VULKAN_VERSION = 1; static const int32_t CPU_VULKAN_VERSION = 2; static const int32_t GLES_VERSION = 3; static const bool CPU_VULKAN_IN_USE = true; +static const bool FALSE_PREROTATION = true; static const size_t NUMBER_OF_VALUES_GLOBAL = 13; -static const size_t NUMBER_OF_VALUES_APP = 6; +static const size_t NUMBER_OF_VALUES_APP = 7; // clang-format on class MockGpuStatsPuller : public GpuStatsPuller { @@ -150,6 +151,7 @@ TEST_F(GpuStatsPuller_test, PullGpuStatsAppInfo) { EXPECT_TRUE(event->write(int64VectorToProtoByteString(vkDriverLoadingTime))); EXPECT_TRUE(event->write(int64VectorToProtoByteString(angleDriverLoadingTime))); EXPECT_TRUE(event->write(CPU_VULKAN_IN_USE)); + EXPECT_TRUE(event->write(FALSE_PREROTATION)); event->init(); inData.emplace_back(event); MockGpuStatsPuller mockPuller(android::util::GPU_STATS_APP_INFO, &inData); @@ -168,6 +170,7 @@ TEST_F(GpuStatsPuller_test, PullGpuStatsAppInfo) { EXPECT_EQ(int64VectorToProtoByteString(angleDriverLoadingTime), outData[0]->getValues()[4].mValue.str_value); EXPECT_EQ(CPU_VULKAN_IN_USE, outData[0]->getValues()[5].mValue.int_value); + EXPECT_EQ(FALSE_PREROTATION, outData[0]->getValues()[6].mValue.int_value); } } // namespace statsd -- cgit v1.2.3 From cba9579158cc70bf8eadb6e8a239e0ab2dc073d2 Mon Sep 17 00:00:00 2001 From: Jeongik Cha Date: Tue, 9 Jul 2019 23:58:01 +0900 Subject: Consider overlay in system_ext as system's When there is overlay package in system_ext, turn on POLICY_SYSTEM_PARTITION. In other words, overlay pacakge in /system_ext is considered as system's one Test: mv vendor/overlay/framework-res__auto_generated_rro.apk system_ext/overlay and then check if it works properly. Bug: 136715327 Change-Id: Ib225368eae41203a8630f4310d26e9cf1afa706a --- cmds/idmap2/idmap2/Scan.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'cmds') diff --git a/cmds/idmap2/idmap2/Scan.cpp b/cmds/idmap2/idmap2/Scan.cpp index cfac5f31e2e6..0b349e10a118 100644 --- a/cmds/idmap2/idmap2/Scan.cpp +++ b/cmds/idmap2/idmap2/Scan.cpp @@ -103,6 +103,7 @@ std::vector PoliciesForPath(const std::string& apk_path) { {"/oem/", kPolicyOem}, {"/product/", kPolicyProduct}, {"/system/", kPolicySystem}, + {"/system_ext/", kPolicySystem}, {"/vendor/", kPolicyVendor}, }; -- cgit v1.2.3 From 5a12f19ee1485bb8d70078e8b4cc578d74088e61 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Thu, 11 Jul 2019 15:54:23 -0700 Subject: Remove perfprofd support. This isn't finished, and no-one's working on finishing it. Test: builds Change-Id: I0406afadc0663ef3c07acafcdf40f76c9bba27bf --- cmds/statsd/Android.bp | 3 -- cmds/statsd/src/anomaly/subscriber_util.cpp | 7 --- cmds/statsd/src/external/Perfprofd.cpp | 74 ----------------------------- cmds/statsd/src/external/Perfprofd.h | 38 --------------- cmds/statsd/src/statsd_config.proto | 13 ++--- 5 files changed, 3 insertions(+), 132 deletions(-) delete mode 100644 cmds/statsd/src/external/Perfprofd.cpp delete mode 100644 cmds/statsd/src/external/Perfprofd.h (limited to 'cmds') diff --git a/cmds/statsd/Android.bp b/cmds/statsd/Android.bp index 2f0dc3cb1e98..6df0a8e14f6a 100644 --- a/cmds/statsd/Android.bp +++ b/cmds/statsd/Android.bp @@ -71,7 +71,6 @@ cc_defaults { "src/config/ConfigManager.cpp", "src/external/GpuStatsPuller.cpp", "src/external/Perfetto.cpp", - "src/external/Perfprofd.cpp", "src/external/StatsPuller.cpp", "src/external/StatsCallbackPuller.cpp", "src/external/StatsCompanionServicePuller.cpp", @@ -109,8 +108,6 @@ cc_defaults { "src/socket/StatsSocketListener.cpp", "src/shell/ShellSubscriber.cpp", "src/shell/shell_config.proto", - - ":perfprofd_aidl", ], local_include_dirs: [ diff --git a/cmds/statsd/src/anomaly/subscriber_util.cpp b/cmds/statsd/src/anomaly/subscriber_util.cpp index 548a6869436d..e09d5751d323 100644 --- a/cmds/statsd/src/anomaly/subscriber_util.cpp +++ b/cmds/statsd/src/anomaly/subscriber_util.cpp @@ -22,7 +22,6 @@ #include #include "external/Perfetto.h" -#include "external/Perfprofd.h" #include "subscriber/IncidentdReporter.h" #include "subscriber/SubscriberReporter.h" @@ -64,12 +63,6 @@ void triggerSubscribers(int64_t ruleId, int64_t metricId, const MetricDimensionK SubscriberReporter::getInstance().alertBroadcastSubscriber(configKey, subscription, dimensionKey); break; - case Subscription::SubscriberInformationCase::kPerfprofdDetails: - if (!CollectPerfprofdTraceAndUploadToDropbox(subscription.perfprofd_details(), - ruleId, configKey)) { - ALOGW("Failed to generate perfprofd traces."); - } - break; default: break; } diff --git a/cmds/statsd/src/external/Perfprofd.cpp b/cmds/statsd/src/external/Perfprofd.cpp deleted file mode 100644 index 1678f104a07a..000000000000 --- a/cmds/statsd/src/external/Perfprofd.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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. - */ - -#include "Perfprofd.h" - -#define DEBUG false // STOPSHIP if true -#include "config/ConfigKey.h" -#include "Log.h" - -#include -#include -#include -#include -#include - -#include - -#include - -#include "frameworks/base/cmds/statsd/src/statsd_config.pb.h" // Alert - -#include "android/os/IPerfProfd.h" - -namespace android { -namespace os { -namespace statsd { - -bool CollectPerfprofdTraceAndUploadToDropbox(const PerfprofdDetails& config, - int64_t alert_id, - const ConfigKey& configKey) { - VLOG("Starting trace collection through perfprofd"); - - if (!config.has_perfprofd_config()) { - ALOGE("The perfprofd trace config is empty, aborting"); - return false; - } - - sp service = interface_cast( - defaultServiceManager()->getService(android::String16("perfprofd"))); - if (service == NULL) { - ALOGE("Could not find perfprofd service"); - return false; - } - - auto* data = reinterpret_cast(config.perfprofd_config().data()); - std::vector proto_serialized(data, data + config.perfprofd_config().size()); - - // TODO: alert-id etc? - - binder::Status status = service->startProfilingProtobuf(proto_serialized); - if (status.isOk()) { - return true; - } - - ALOGE("Error starting perfprofd profiling: %s", status.toString8().c_str()); - return false; -} - -} // namespace statsd -} // namespace os -} // namespace android diff --git a/cmds/statsd/src/external/Perfprofd.h b/cmds/statsd/src/external/Perfprofd.h deleted file mode 100644 index b93fdf8e1cb2..000000000000 --- a/cmds/statsd/src/external/Perfprofd.h +++ /dev/null @@ -1,38 +0,0 @@ -/* - * 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. - */ - -#pragma once - -#include - -namespace android { -namespace os { -namespace statsd { - -class ConfigKey; -class PerfprofdDetails; // Declared in statsd_config.pb.h - -// Starts the collection of a Perfprofd trace with the given |config|. -// The trace is uploaded to Dropbox by the perfprofd service once done. -// This method returns immediately after passing the config and does NOT wait -// for the full duration of the trace. -bool CollectPerfprofdTraceAndUploadToDropbox(const PerfprofdDetails& config, - int64_t alert_id, - const ConfigKey& configKey); - -} // namespace statsd -} // namespace os -} // namespace android diff --git a/cmds/statsd/src/statsd_config.proto b/cmds/statsd/src/statsd_config.proto index a2fd9d42f488..79c06b98a82d 100644 --- a/cmds/statsd/src/statsd_config.proto +++ b/cmds/statsd/src/statsd_config.proto @@ -343,15 +343,6 @@ message PerfettoDetails { optional bytes trace_config = 1; } -message PerfprofdDetails { - // The |perfprofd_config| field is a proto-encoded message of type - // android.perfprofd.ProfilingConfig defined in - // //system/extras/perfprofd/. On device, statsd doesn't need to - // deserialize the message as it's just passed binary-encoded to - // the perfprofd service. - optional bytes perfprofd_config = 1; -} - message BroadcastSubscriberDetails { optional int64 subscriber_id = 1; repeated string cookie = 2; @@ -373,10 +364,12 @@ message Subscription { IncidentdDetails incidentd_details = 4; PerfettoDetails perfetto_details = 5; BroadcastSubscriberDetails broadcast_subscriber_details = 6; - PerfprofdDetails perfprofd_details = 8; } optional float probability_of_informing = 7 [default = 1.1]; + + // This was used for perfprofd historically. + reserved 8; } enum ActivationType { -- cgit v1.2.3 From 3c57dd20f655748518f42ed83ce280b57ea7af45 Mon Sep 17 00:00:00 2001 From: nathch Date: Tue, 16 Jul 2019 18:01:04 +0100 Subject: Differentiate between various error conditions when calling Bmgr methods Differentiate between 1. when the service is null 2. the service is not activated 3. there is a remote exception 4. we cant get a restore session from the service Bug: 137156961 Test: atest -v CtsBackupTestCases CtsBackupHostTestCases Test: atest -v BmgrTest Change-Id: I63f1005f43d8e3e23bbd629b183f128fa02bbac1 --- cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java | 74 ++++++++++------------- 1 file changed, 32 insertions(+), 42 deletions(-) (limited to 'cmds') diff --git a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java index 680ccfc57ddf..76b905d8985f 100644 --- a/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java +++ b/cmds/bmgr/src/com/android/commands/bmgr/Bmgr.java @@ -64,6 +64,10 @@ public class Bmgr { private static final String BMGR_NOT_RUNNING_ERR = "Error: Could not access the Backup Manager. Is the system running?"; + private static final String BMGR_NOT_ACTIVATED_FOR_USER = + "Error: Backup Manager is not activated for user "; + private static final String BMGR_ERR_NO_RESTORESESSION_FOR_USER = + "Error: Could not get restore session for user "; private static final String TRANSPORT_NOT_RUNNING_ERR = "Error: Could not access the backup transport. Is the system running?"; private static final String PM_NOT_RUNNING_ERR = @@ -190,15 +194,19 @@ public class Bmgr { showUsage(); } - boolean isBackupActive(@UserIdInt int userId) { + private void handleRemoteException(RemoteException e) { + System.err.println(e.toString()); + System.err.println(BMGR_NOT_RUNNING_ERR); + } + + private boolean isBackupActive(@UserIdInt int userId) { try { if (!mBmgr.isBackupServiceActive(userId)) { - System.err.println(BMGR_NOT_RUNNING_ERR); + System.err.println(BMGR_NOT_ACTIVATED_FOR_USER + userId); return false; } } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); return false; } @@ -214,8 +222,7 @@ public class Bmgr { System.out.println("Backup Manager currently " + activatedToString(mBmgr.isBackupServiceActive(userId))); } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } } @@ -230,8 +237,7 @@ public class Bmgr { System.out.println("Backup Manager currently " + enableToString(isEnabled)); } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } } @@ -250,8 +256,7 @@ public class Bmgr { showUsage(); return; } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } } @@ -259,8 +264,7 @@ public class Bmgr { try { mBmgr.backupNowForUser(userId); } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } } @@ -274,8 +278,7 @@ public class Bmgr { try { mBmgr.dataChangedForUser(userId, pkg); } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } } @@ -292,8 +295,7 @@ public class Bmgr { mBmgr.fullTransportBackupForUser( userId, allPkgs.toArray(new String[allPkgs.size()])); } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } } } @@ -421,8 +423,7 @@ public class Bmgr { try { filteredPackages = mBmgr.filterAppsEligibleForBackupForUser(userId, packages); } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } backupNowPackages(userId, Arrays.asList(filteredPackages), nonIncrementalBackup, monitorState); @@ -455,8 +456,7 @@ public class Bmgr { System.err.println("Unable to run backup"); } } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } } @@ -506,8 +506,7 @@ public class Bmgr { try { mBmgr.cancelBackupsForUser(userId); } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } return; } @@ -537,8 +536,7 @@ public class Bmgr { } } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } } @@ -569,8 +567,7 @@ public class Bmgr { } }); } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); return; } @@ -598,8 +595,7 @@ public class Bmgr { mBmgr.clearBackupDataForUser(userId, transport, pkg); System.out.println("Wiped backup data for " + pkg + " on " + transport); } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } } @@ -632,8 +628,7 @@ public class Bmgr { observer.waitForCompletion(30*1000L); System.out.println("Initialization result: " + observer.result); } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } } @@ -648,7 +643,7 @@ public class Bmgr { try { mRestore = mBmgr.beginRestoreSessionForUser(userId, null, null); if (mRestore == null) { - System.err.println(BMGR_NOT_RUNNING_ERR); + System.err.println(BMGR_ERR_NO_RESTORESESSION_FOR_USER + userId); return; } @@ -658,8 +653,7 @@ public class Bmgr { mRestore.endRestoreSession(); } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } } @@ -686,8 +680,7 @@ public class Bmgr { System.out.println(pad + t); } } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } } @@ -805,7 +798,7 @@ public class Bmgr { boolean didRestore = false; mRestore = mBmgr.beginRestoreSessionForUser(userId, null, null); if (mRestore == null) { - System.err.println(BMGR_NOT_RUNNING_ERR); + System.err.println(BMGR_ERR_NO_RESTORESESSION_FOR_USER + userId); return; } RestoreSet[] sets = null; @@ -851,8 +844,7 @@ public class Bmgr { System.out.println("done"); } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } } @@ -865,8 +857,7 @@ public class Bmgr { } } } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } } @@ -886,8 +877,7 @@ public class Bmgr { + " for user " + userId); } catch (RemoteException e) { - System.err.println(e.toString()); - System.err.println(BMGR_NOT_RUNNING_ERR); + handleRemoteException(e); } } -- cgit v1.2.3 From 3119f59f14871e95bbf0aad0b7c5109605046665 Mon Sep 17 00:00:00 2001 From: Pavel Grafov Date: Tue, 23 Jul 2019 12:25:18 +0100 Subject: Run lockscreen-related tests in presubmit for LSS. Bug: 135979609 Test: atest Change-Id: I184eaf4b1776890cafadc7e3e5e69bf07352d567 --- cmds/locksettings/TEST_MAPPING | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 cmds/locksettings/TEST_MAPPING (limited to 'cmds') diff --git a/cmds/locksettings/TEST_MAPPING b/cmds/locksettings/TEST_MAPPING new file mode 100644 index 000000000000..c1cba5f7f22d --- /dev/null +++ b/cmds/locksettings/TEST_MAPPING @@ -0,0 +1,15 @@ +{ + "presubmit": [ + { + "name": "CtsDevicePolicyManagerTestCases", + "options": [ + { + "include-annotation": "com.android.cts.devicepolicy.annotations.LockSettingsTest" + }, + { + "exclude-annotation": "android.platform.test.annotations.FlakyTest" + } + ] + } + ] +} -- cgit v1.2.3 From 1c5a50a9cb55d008e522d3e5d22eb531101c8c53 Mon Sep 17 00:00:00 2001 From: Yao Chen Date: Tue, 23 Jul 2019 14:57:52 -0700 Subject: Remove the deprecated StatsdDogfood and LoadTest app. Bug: 128364199 Test: build Change-Id: I898272860dc9136318320d87a3b19c5ef2725e84 --- cmds/statsd/tools/dogfood/Android.bp | 37 - cmds/statsd/tools/dogfood/AndroidManifest.xml | 43 -- .../dogfood/res/drawable-hdpi/ic_launcher.png | Bin 7783 -> 0 bytes .../dogfood/res/drawable-mdpi/ic_launcher.png | Bin 3760 -> 0 bytes .../dogfood/res/drawable-xhdpi/ic_launcher.png | Bin 12356 -> 0 bytes .../dogfood/res/drawable-xxhdpi/ic_launcher.png | Bin 24780 -> 0 bytes .../tools/dogfood/res/layout/activity_main.xml | 162 ----- .../tools/dogfood/res/raw/statsd_baseline_config | 109 --- cmds/statsd/tools/dogfood/res/values/strings.xml | 57 -- .../android/statsd/dogfood/DisplayProtoUtils.java | 158 ----- .../com/android/statsd/dogfood/MainActivity.java | 361 ---------- cmds/statsd/tools/loadtest/Android.bp | 37 - cmds/statsd/tools/loadtest/AndroidManifest.xml | 44 -- .../loadtest/res/drawable-hdpi/ic_launcher.png | Bin 7783 -> 0 bytes .../loadtest/res/drawable-mdpi/ic_launcher.png | Bin 3760 -> 0 bytes .../loadtest/res/drawable-xhdpi/ic_launcher.png | Bin 12356 -> 0 bytes .../loadtest/res/drawable-xxhdpi/ic_launcher.png | Bin 24780 -> 0 bytes .../loadtest/res/layout/activity_loadtest.xml | 208 ------ .../tools/loadtest/res/layout/spinner_item.xml | 10 - cmds/statsd/tools/loadtest/res/raw/loadtest_config | Bin 2087 -> 0 bytes cmds/statsd/tools/loadtest/res/values/integers.xml | 24 - cmds/statsd/tools/loadtest/res/values/strings.xml | 36 - cmds/statsd/tools/loadtest/run_loadtest.sh | 99 --- .../statsd/loadtest/BatteryDataRecorder.java | 56 -- .../statsd/loadtest/BatteryStatsParser.java | 113 --- .../com/android/statsd/loadtest/ConfigFactory.java | 314 --------- .../android/statsd/loadtest/DisplayProtoUtils.java | 169 ----- .../android/statsd/loadtest/LoadtestActivity.java | 756 --------------------- .../com/android/statsd/loadtest/MemInfoParser.java | 69 -- .../statsd/loadtest/MemoryDataRecorder.java | 53 -- .../android/statsd/loadtest/NumericalWatcher.java | 70 -- .../src/com/android/statsd/loadtest/PerfData.java | 116 ---- .../android/statsd/loadtest/PerfDataRecorder.java | 174 ----- .../com/android/statsd/loadtest/PerfParser.java | 27 - .../android/statsd/loadtest/SequencePusher.java | 165 ----- .../statsd/loadtest/StatsdStatsRecorder.java | 62 -- .../statsd/loadtest/ValidationRecorder.java | 93 --- 37 files changed, 3622 deletions(-) delete mode 100644 cmds/statsd/tools/dogfood/Android.bp delete mode 100644 cmds/statsd/tools/dogfood/AndroidManifest.xml delete mode 100644 cmds/statsd/tools/dogfood/res/drawable-hdpi/ic_launcher.png delete mode 100644 cmds/statsd/tools/dogfood/res/drawable-mdpi/ic_launcher.png delete mode 100644 cmds/statsd/tools/dogfood/res/drawable-xhdpi/ic_launcher.png delete mode 100644 cmds/statsd/tools/dogfood/res/drawable-xxhdpi/ic_launcher.png delete mode 100644 cmds/statsd/tools/dogfood/res/layout/activity_main.xml delete mode 100644 cmds/statsd/tools/dogfood/res/raw/statsd_baseline_config delete mode 100644 cmds/statsd/tools/dogfood/res/values/strings.xml delete mode 100644 cmds/statsd/tools/dogfood/src/com/android/statsd/dogfood/DisplayProtoUtils.java delete mode 100644 cmds/statsd/tools/dogfood/src/com/android/statsd/dogfood/MainActivity.java delete mode 100644 cmds/statsd/tools/loadtest/Android.bp delete mode 100644 cmds/statsd/tools/loadtest/AndroidManifest.xml delete mode 100644 cmds/statsd/tools/loadtest/res/drawable-hdpi/ic_launcher.png delete mode 100644 cmds/statsd/tools/loadtest/res/drawable-mdpi/ic_launcher.png delete mode 100644 cmds/statsd/tools/loadtest/res/drawable-xhdpi/ic_launcher.png delete mode 100644 cmds/statsd/tools/loadtest/res/drawable-xxhdpi/ic_launcher.png delete mode 100644 cmds/statsd/tools/loadtest/res/layout/activity_loadtest.xml delete mode 100644 cmds/statsd/tools/loadtest/res/layout/spinner_item.xml delete mode 100755 cmds/statsd/tools/loadtest/res/raw/loadtest_config delete mode 100644 cmds/statsd/tools/loadtest/res/values/integers.xml delete mode 100644 cmds/statsd/tools/loadtest/res/values/strings.xml delete mode 100755 cmds/statsd/tools/loadtest/run_loadtest.sh delete mode 100644 cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/BatteryDataRecorder.java delete mode 100644 cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/BatteryStatsParser.java delete mode 100644 cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/ConfigFactory.java delete mode 100644 cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/DisplayProtoUtils.java delete mode 100644 cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/LoadtestActivity.java delete mode 100644 cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/MemInfoParser.java delete mode 100644 cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/MemoryDataRecorder.java delete mode 100644 cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/NumericalWatcher.java delete mode 100644 cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/PerfData.java delete mode 100644 cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/PerfDataRecorder.java delete mode 100644 cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/PerfParser.java delete mode 100644 cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/SequencePusher.java delete mode 100644 cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/StatsdStatsRecorder.java delete mode 100644 cmds/statsd/tools/loadtest/src/com/android/statsd/loadtest/ValidationRecorder.java (limited to 'cmds') diff --git a/cmds/statsd/tools/dogfood/Android.bp b/cmds/statsd/tools/dogfood/Android.bp deleted file mode 100644 index bb494a6025af..000000000000 --- a/cmds/statsd/tools/dogfood/Android.bp +++ /dev/null @@ -1,37 +0,0 @@ -// Copyright (C) 2017 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. -// -// - -android_app { - name: "StatsdDogfood", - platform_apis: true, - - srcs: ["src/**/*.java"], - - resource_dirs: ["res"], - static_libs: [ - "platformprotoslite", - "statsdprotolite", - ], - - privileged: true, - dex_preopt: { - enabled: false, - }, - certificate: "platform", - optimize: { - enabled: false, - }, -} diff --git a/cmds/statsd/tools/dogfood/AndroidManifest.xml b/cmds/statsd/tools/dogfood/AndroidManifest.xml deleted file mode 100644 index 52673fbdcf92..000000000000 --- a/cmds/statsd/tools/dogfood/AndroidManifest.xml +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - diff --git a/cmds/statsd/tools/dogfood/res/drawable-hdpi/ic_launcher.png b/cmds/statsd/tools/dogfood/res/drawable-hdpi/ic_launcher.png deleted file mode 100644 index 55621cc1074f..000000000000 Binary files a/cmds/statsd/tools/dogfood/res/drawable-hdpi/ic_launcher.png and /dev/null differ diff --git a/cmds/statsd/tools/dogfood/res/drawable-mdpi/ic_launcher.png b/cmds/statsd/tools/dogfood/res/drawable-mdpi/ic_launcher.png deleted file mode 100644 index 11ec2068be19..000000000000 Binary files a/cmds/statsd/tools/dogfood/res/drawable-mdpi/ic_launcher.png and /dev/null differ diff --git a/cmds/statsd/tools/dogfood/res/drawable-xhdpi/ic_launcher.png b/cmds/statsd/tools/dogfood/res/drawable-xhdpi/ic_launcher.png deleted file mode 100644 index 7c02b784aa5d..000000000000 Binary files a/cmds/statsd/tools/dogfood/res/drawable-xhdpi/ic_launcher.png and /dev/null differ diff --git a/cmds/statsd/tools/dogfood/res/drawable-xxhdpi/ic_launcher.png b/cmds/statsd/tools/dogfood/res/drawable-xxhdpi/ic_launcher.png deleted file mode 100644 index 915d91441349..000000000000 Binary files a/cmds/statsd/tools/dogfood/res/drawable-xxhdpi/ic_launcher.png and /dev/null differ diff --git a/cmds/statsd/tools/dogfood/res/layout/activity_main.xml b/cmds/statsd/tools/dogfood/res/layout/activity_main.xml deleted file mode 100644 index 784ed40ce2c2..000000000000 --- a/cmds/statsd/tools/dogfood/res/layout/activity_main.xml +++ /dev/null @@ -1,162 +0,0 @@ - - - - - - -