Commit Graph

5440 Commits

Author SHA1 Message Date
TreeHugger Robot
5a098f7775 Merge "Camera: Rename CameraActionEvent duration" into rvc-dev 2020-02-25 20:47:47 +00:00
TreeHugger Robot
10398d29f3 Merge "Atom for when fgs accesses appop" into rvc-dev 2020-02-25 19:59:16 +00:00
Adam Bookatz
38767932a2 Atom for when fgs accesses appop
statsd logs when an sensitive appop is accessed while a foreground
service is held. These appops include
OP_FINE_LOCATION
OP_COARSE_LOCATION
OP_RECORD_AUDIO
OP_CAMERA

It logs the number of times each of these appops is requested per session
during which the uid holds any foreground service.
Appops requested while the app's process state is TOP are ignored.

Also, the pre-existing ForegroundServiceStateChanged atom has an
additional field that logs whether the fgs is considered 'in-use' in the
context of being allowed while-in-use permissions.

Bug: 149497535
Test: atest UidAtomTests#testForegroundServiceState UidAtomTests#testForegroundServiceAccessAppOp
Test: manually monitor: adb shell cmd stats print-logs && adb logcat -v uid -s statsd | grep "statsd  : {" | egrep '\((60|256)\)'

Change-Id: I991a427dc2ab00399188b10b266ab2d9aa92696d
Merged-In: I991a427dc2ab00399188b10b266ab2d9aa92696d
(cherry picked from commit 0c8637c067)
2020-02-25 17:09:48 +00:00
Garfield Tan
cf11791876 Populate uniq field in uhid.
Sony introduced some logic that combines devices kernel splits into one
Android device based on identical pid, vid and non-empty uniq. Therefore
populate this field with device ID.

We can change that to a separate uniq attribute in register JSON file if
necessary later.

Bug: 38511270
Test: getevent -li shows that uniq is populated.
Change-Id: Ieca0b826c86e9cad7fa3d3c8f98b9cfd54d20c73
2020-02-25 01:40:06 +00:00
Emilian Peev
6ea6fe99ba Camera: Rename CameraActionEvent duration
Rename "duration" field to correspond with the
actual time unit.

Bug: 139439353
Test: Successful build
Change-Id: I3e9b3ac5778d6fa4b6de35079743bdf6e85b7560
2020-02-24 15:31:34 -08:00
Stanislav Zholnin
7dcc51dc79 Add atom and puller for AppOps with FeatureIds
Bug: 136134050
Test: make statsd_testdrive && ./out/host/linux-x86/bin/statsd_testdrive 10074

Change-Id: Ic1d84b2f91e9b6857dda717ab21208d9f331be2f
2020-02-24 15:30:00 +00:00
Mike Ma
5510f7c8cd Add text dumpsys section to incidentd
Enable Incidentd to dump any existing dumpsys section in plain text
(as dumpsys.proto), only in eng or userdebug build. This is for a
few dumpsys services that are prohibitively expensive to migrate to
protobuf dumpsys or will undergo a major rewrite (thus render the
previously defined proto completely useless).

Bug: 149816498
Bug: 146085372
Bug: 146086519
Test: $ incident -p EXPLICIT 4000 4001
Change-Id: I0693d9bace0055cfeb63d7c8d48995d57dc0b733
(cherry picked from commit 95ba73f9c9)
2020-02-23 08:05:42 +00:00
Blake Kragten
e4383d8999 Merge "GnssMetrics" 2020-02-21 22:15:29 +00:00
TreeHugger Robot
d1890075d1 Merge "Make findTrainInfoFileNameLocked return a string instead of a char*." 2020-02-21 00:13:57 +00:00
Makoto Onuki
92cef6c8e7 Merge "Temporarily fix for the "telecom" command" 2020-02-20 23:24:39 +00:00
Jonathan Nguyen
d8c00da9d9 Make findTrainInfoFileNameLocked return a string instead of a char*.
Test: atest GtsStatsdHostTestCases on hwasan
Change-Id: I51a3a7101588001ccb5479ae599a6b52d3a56566
2020-02-20 14:30:33 -08:00
Makoto Onuki
5577300386 Temporarily fix for the "telecom" command
Bug: 148897549
Test: m telecom && adb sync && adb shell telecom set-sim-count 0
Change-Id: I0951aa78dd3a4cc45d0a849baf9bcac1b31ef339
2020-02-20 10:12:50 -08:00
Howard Ro
7008dbe5e4 Merge "Revert^2 "Migrate Statsd to the apex"" 2020-02-20 08:00:53 +00:00
Howard Ro
adc510fd78 Revert^2 "Migrate Statsd to the apex"
24bfb40916

Change-Id: I4bda9b6eb759c32b9167ad9d58bdd3d10ff29411
2020-02-20 04:57:00 +00:00
Howard Ro
00306fce6a Merge "Revert "Migrate Statsd to the apex"" 2020-02-20 04:22:02 +00:00
Howard Ro
24bfb40916 Revert "Migrate Statsd to the apex"
Revert "Update statsd binary path for apex"

Revert submission 10356003-statsd_apex

Reason for revert: https://android-build.googleplex.com/builds/quarterdeck?branch=git_master&target=build_test&lkgb=6221366&fkbb=6221428
Reverted Changes:
Ic84e77269:Update init.rc for statsd setup
I6f3fab4b4:Update statsd binary path for apex
Ib4ea98aed:Migrate Statsd to the apex

Change-Id: I089d5b9bbbdc363e27e79e4addd4eec1e4339c48
2020-02-20 04:19:41 +00:00
TreeHugger Robot
5a9b426ef3 Merge "Added ability to set bus used for hid device tests" 2020-02-20 03:11:47 +00:00
TreeHugger Robot
d71f157eb6 Merge "Add libstatspull and libstatssocket to the apex" 2020-02-20 02:35:47 +00:00
Howard Ro
ff5581d498 Merge "Migrate Statsd to the apex" 2020-02-20 01:53:20 +00:00
Alessio Balsini
80c3c1579a Merge "Extend atoms with Virtual A/B merge metrics" 2020-02-20 01:12:04 +00:00
Blake Kragten
6ce382a372 GnssMetrics
These metrics will pull different metrics that tell the performance of the gnss subsystem.

Metrics include:
Location reports
% of location failure
Num times GPS had to first fix
Mean time to first fix on signal
Num position accuracy logs
Mean position accuracy in meters
Num top 4 Cn0 messages
Mean top 4 average Cn0 (signal quality)
Num L5 top 4 Cn0 messages
Mean L5 top 4 average Cn0 (signal quality)
Num Satellite status messages received
Num of Satellites used in fix
L5 Satellite status messages received
L5 of Satellites used in fix

metric_id: 1111
gauge_metrics {
  data {
    bucket_info {
      atom {
        gnss_stats {
          location_reports: 12
          location_failure_reports: 3
          time_to_first_fix_reports: 2
          time_to_first_fix_milli_s: 43588
          position_accuracy_reports: 9
          position_accuracy_meters: 112
          top_four_average_cn0_reports: 31
          top_four_average_cn0_db_mhz: 734711
          l5_top_four_average_cn0_reports: 1
          l5_top_four_average_cn0_db_mhz: 21500
          sv_status_reports: 1015
          sv_status_reports_used_in_fix: 100
          l5_sv_status_reports: 7
          l5_sv_status_reports_used_in_fix: 0
        }
      }
      elapsed_timestamp_nanos: 537249375445
      start_bucket_elapsed_millis: 522186
      end_bucket_elapsed_millis: 549283
    }
  }
}
time_base_elapsed_nano_seconds: 9283624934
bucket_size_nano_seconds: 60000000000
is_active: true

Bug: 147910698
Test: On Device using test script and gnsslogger.apk
>  make statsd_testdrive
>  ./out/host/linux-x86/bin/statsd_testdrive <ATOM_ID>

Change-Id: I92461eb8533ec810bb67d76a25931295cfa1efbd
2020-02-19 17:07:11 -08:00
Farid Chahla
bf881360f0 Added ability to set bus used for hid device tests
When testing HID devices, it was assumed that the bus used would always
be bluetooth. This caused USB hid tests to fail. This patch fixes this
issue by adding a "busType" parameter to the test register file. This
can be either "bluetooth" or "usb" at this time. This will break any
hid test that does not specify a busType.

Cherry picked from pa/1549664.

Bug: 136263708
Test: atest CtsHarwareTestCases

Change-Id: I44cda52505110227fa5262994d0cfe59ecb8763d
2020-02-19 17:00:05 -08:00
Muhammad Qureshi
7b31ff81c5 Add libstatspull and libstatssocket to the apex
Also make libstatssocket dependency static in statsd_test temporarily to use
AStatsEvent_getBuffer in tests.

Bug: 145922701
Bug: 145923416
Test: m

Change-Id: Idb8107cfe4f7d08d08c7a242c037fcc63912bb5f
2020-02-19 14:49:43 -08:00
Jeffrey Huang
89e09b58d6 Migrate Statsd to the apex
Bug: 145923087
Test: m -j
Change-Id: Ib4ea98aedef629dd9a2a8764cfd91284a38ba596
2020-02-19 14:13:13 -08:00
TreeHugger Robot
2ae81c3c0f Merge "Update GraphicsStats proto definition" 2020-02-19 14:23:20 +00:00
TreeHugger Robot
a73ae8bbc4 Merge "Comment out Statsd tests" 2020-02-19 04:57:51 +00:00
Ryan Mitchell
f2392c6f56 Merge changes from topic "rro_config"
* changes:
  Make overlay config work with immutable non-android overlays
  Add xml configuration of RROs
  Extract system partitions into standalone class
2020-02-19 04:37:26 +00:00
Jeffrey Huang
1e4368aa43 Comment out Statsd tests
Added todos to make them ues the new schema.

Bug: 145923087
Test: m -j && bit statsd_test:*
Change-Id: I0749760eb3123407b78b9ace9a93967bac727bf5
2020-02-18 18:36:02 -08:00
Ryan Mitchell
9b93942a80 Add xml configuration of RROs
This change adds the ability to configure the priority, default enable
state, and mutability (previously know as staticness) of an overlay.
Rather than overlays configuring themselves, the system can configure
overlays relative to each other.

An example configuration file looks like:
<config>
    <merge path="auto-generated.xml" />
    <overlay package="com.example.one" mutable="false"
             enabled="true"/>
    <overlay package="com.example.two" mutable="false"
             enabled="true"/>
    <overlay package="com.example.three" enabled="true"/>
</config>

The <overlay> tag configures the overlay while the <merge> tag allows
additional configuration files to be included at a position within
the configuration file.

If the configuration file is not present for a partition, the legacy
android:isStatic and android:priority will continue to configure the
overlays in the partition. Once at least one configuration file has
been defined in any partition, strict partition precedence will be
enforced and overlays on separate partitions will no longer be able
to use android:priority to reorder themselves conversely from the
overlay partition precedence.

The order of the system partitions from least to greatest precedence
is system, vendor, odm, oem, product, system_ext.

Bug: 135048762
Test: atest OverlayConfigTest
Change-Id: If57e8caa9b881f9d424ef48bba80b18cc8b7b943
2020-02-18 16:13:22 -08:00
Jeffrey Huang
52e90024d3 Allow libstatsmetadata to be linked by statsd
Bug: 145923087
Test: m -j
Change-Id: I8ad5453be7aaefd8be9a20539f35de06209060e3
2020-02-18 14:57:20 -08:00
Oscar Shu
2f156b0da2 Merge "Bucket channel frequency on device" 2020-02-18 18:08:17 +00:00
Alessio Balsini
628fb8d900 Extend atoms with Virtual A/B merge metrics
With the Virtual A/B feature, when the device successfully boots after
an OTA update, a dm-snapshot merge operation is performed, which
consolidates the updated images to the base devices.
This merge operation depends on the OTA size and may affect the device
performance until completed.
The new virtual_ab_update_reported push metric tracks the merge
operation duration (if not interrupted), the final merge status and
possible number of reboots that occurred during the merge.

Bug: 138817833
Bug: 148138124
Test: build + OTA application + local metric test with statsd_testdrive
Change-Id: Iabd1dc48ad0d737f6ed14caa247fd4952c65a258
Signed-off-by: Alessio Balsini <balsini@google.com>
2020-02-18 15:19:43 +00:00
Stan Iliev
b65171956c Update GraphicsStats proto definition
Follow ProtoBestPractices and comments suggested by cl/295218381.
Changing proto definition, should be fine, because these are
fields added after the last Android release.
Move PipelineType enum inside GraphicsStats and add a default
UNKNOWN state.
Rename start_millis and end_millis in GraphicsStats atom.
Fields in GraphicsStatsProto cannot be renamed as these were
part of previous Android releases.

Test: Ran "adb shell cmd stats pull-source 10068"
Test: Ran "statsd_testdrive 10068" and it looks OK
Bug: 149646555
Change-Id: Idc326eb2a7eb9ff0be39026e6fec544491b7d8a6
2020-02-18 10:12:42 -05:00
TreeHugger Robot
48b2f06621 Merge "Fix bug in StatsService which prevents any shell command from execution." 2020-02-18 08:13:23 +00:00
TreeHugger Robot
3c51ff6bd8 Merge "Add comments and prevent duplicate experiment ids being added." 2020-02-18 07:32:58 +00:00
Stanislav Zholnin
d7674c2be5 Fix bug in StatsService which prevents any shell command from execution.
Bug: 149691126
Test: adb shell cmd stats
Change-Id: I71befdd02e61de0f39cdff9694d4ab07abb1799c
2020-02-17 17:48:12 +00:00
Ruchir Rastogi
e449b0c185 Move statsd (and tests) to libbinder_ndk
Major changes include:
    - Removing unused permission checks within StatsService. These
      include ENFORCE_DUMP_AND_USAGE_STATS, checkDumpAndUsageStats,
      kOpUsage, and kPermissionUsage.
    - Converting from sp to shared_ptr
    - Using libbinder_ndk functions instead of libbinder functions
      (e.g. for installing death recipients, getting calling uids, etc.)
        - New death recipients were added in StatsService,
          ConfigManager, and SubscriberReporter.
    - Using a unique token (timestamp) to identify shell subscribers
      instead of IResultReceiver because IResultReceiver is not exposed by
      libbinder_ndk. Currently, statsd cannot detect if perfd dies; we
      will fix that later.

Bug: 145232107
Bug: 148609603
Test: m statsd
Test: m statsd_test
Test: bit stastd_test:*
Test: atest GtsStatsdHostTestCases
Change-Id: Ia1fda7280c22320bc4ebc8371acaadbe8eabcbd2
2020-02-14 18:07:37 -08:00
xshu
39bfd93034 Bucket channel frequency on device
Instead of logging the raw frequency, log the pre-bucketed enum.

Bug: 144585569
Test: compile
Change-Id: I02ce4fe42969933f3edfa6c7a4534960cd7cedba
2020-02-14 17:56:22 -08:00
Ruchir Rastogi
ba5996060b Merge "Delete stats_event_list refs from statsd src" 2020-02-15 01:34:34 +00:00
TreeHugger Robot
9fdd67b839 Merge changes from topic "revert-149538115"
* changes:
  Revert "Move libstatspull to the apex"
  Revert "Move libstatssocket to apex"
2020-02-14 23:50:37 +00:00
Ruchir Rastogi
00763a3bee Delete stats_event_list refs from statsd src
This breaks LogEvent::writeBytes, but that function is only called from
test code (and those tests are about to be broken soon anyways).

Test: m statsd
Test: m statsd_test
Bug: 145573568

Change-Id: Ic2d2e7c80d25fa93269e3432dbe58dffbd80dfd4
2020-02-14 13:11:15 -08:00
TreeHugger Robot
c6b89516e3 Merge "Add global frame histograms into SF atoms" 2020-02-14 19:48:23 +00:00
Wonsik Kim
d3f06c5f84 Revert "Move libstatssocket to apex"
This reverts commit 3f17225f75.

Reason for revert: major functional regression
Bug: 149538115
Change-Id: Ic5650a09afcfb735668a6ef35cfefc6c4c915a20
2020-02-14 19:35:04 +00:00
TreeHugger Robot
e5aae69015 Merge "Move libstatssocket to apex" 2020-02-14 03:14:44 +00:00
TreeHugger Robot
d1c394c55a Merge "Fix issue where train files would not be deleted past TTL or when over file number limit." 2020-02-14 02:12:58 +00:00
Jonathan Nguyen
981069af8d Fix issue where train files would not be deleted past TTL or when over
file number limit.

Test: manual test
Change-Id: Iba6a7f7236cb37dd392ce535ff1875cd31bc9c59
2020-02-13 15:44:10 -08:00
TreeHugger Robot
e0fc52af32 Merge "Fix typo in atoms.proto" 2020-02-13 21:01:57 +00:00
Jeffrey Huang
3f17225f75 Move libstatssocket to apex
Bug: 145923416
Test: m
Test: fastboot flashall
Change-Id: Ieae64fb975bf7986f987e1f27548e041db2c505e
2020-02-13 11:13:57 -08:00
Nikita Ioffe
8f0f950227 Merge "Log UserspaceRebootReported atom from system_server" 2020-02-13 14:12:24 +00:00
Alec Mouri
bb55b7f4ec Add global frame histograms into SF atoms
Adding CPU and GPU histograms for regression tracking.

Bug: 144037240
Test: builds
Change-Id: I2f9aec93a78c9a28a8a393c3fc70eec6e8927f91
2020-02-12 17:35:01 -08:00