Commit Graph

3546 Commits

Author SHA1 Message Date
Fan Zhang
74494b5172 Merge "Add a Settings atom" 2018-10-22 22:24:11 +00:00
Sudheer Shanka
23bab6c766 Merge "Add instrumentation flag to get access to full exteranl storage." 2018-10-22 21:43:29 +00:00
Chih-Hung Hsieh
e1afb6cb29 Allow implicit-fallthrough warnings locally.
It will be a global error by default.
Cherry pick lost changes from AOSP, for Android.mk and main.cpp.

Test: make checkbuild
Bug: 112564944
Change-Id: I6f1024fa5e31302af27fa9d5bac195e511f4ba20
Exempt-From-Owner-Approval: do not block on new warnings
2018-10-22 12:25:50 -07:00
Fan Zhang
916c13b5f5 Add a Settings atom
Bug: 117860032
Test: rebuild
Change-Id: I0cd0422891ca9a18168eb57cf4b61ad1089263f6
2018-10-22 11:34:50 -07:00
Yang Lu
1587e13496 Revert "Pull process cpu stats into statsd"
This reverts commit b35b5f7c6b.

Reason for revert: move the refactoring/renaming to another CL.

Test: statsd test

Change-Id: Ia3445beb0df813adba0d3d6e137a363e694b5da1
2018-10-22 09:31:04 -07:00
Antoan Angelov
07a9c42c39 Merge "Add UserRestrictionChanged atom and log to track user restriction events." 2018-10-22 11:59:25 +00:00
Sudheer Shanka
8f99bff2e4 Add instrumentation flag to get access to full exteranl storage.
When starting a process under instrumentation using this new
"--no-isolated-storage" flag, the process would be able to see the
full external storage.

Bug: 117229024
Test: adb shell am instrument --no-isolated-storage \
      -e class android.media.cts.EncodeDecodeTest#testEncodeDecodeVideoFromBufferToBuffer720p \
      -w android.media.cts/android.test.InstrumentationTestRunner
Change-Id: I7973b123cf4fc08e8ce2b05bd4c23fa41b1cdcdf
2018-10-21 16:30:52 -07:00
arangelov
d5db50ee93 Add UserRestrictionChanged atom and log to track user restriction events.
Test: none
Bug: 114382154
Change-Id: I20dcdce657e1fed3057d84df5f427542bbabf2cc
2018-10-19 17:26:09 +01:00
Rafal Slawik
37c3c958d7 Merge "Rename pgfault and pgmajfault fields" 2018-10-19 07:41:20 +00:00
TreeHugger Robot
7dd9e171c2 Merge "metric activation and TTL." 2018-10-18 21:32:29 +00:00
Yangster-mac
849dfdc25b metric activation and TTL.
Currently, once a metric config is pushed to statsD, it will
start to collect metrics immediately. This CL introduces the metric
activation logic. When metric needs an activation, the metric producer
will hold until the activation event is detected. Then the metric producer
starts metric generation until the TTL expires (timebomb).

This is to support Mainline where it wants to collect a few metrics for
a few hours when the binary push starts or flag flips.

Test: statsd test
BUG: b/117858835
Change-Id: I992ae98f4303d5b79932eb94eddf6c19ded3727e
2018-10-18 10:45:31 -07:00
Rafal Slawik
298e07fb04 Rename pgfault and pgmajfault fields
Bug: 115968899
Test: existing tests pass
Change-Id: Iff5932c55941772dda5d85ee1ccdd243ec8856c8
2018-10-18 14:44:44 +01:00
Yangster-mac
32f07af29c Match pulled events in gauge metric.
Bug: b/117703265

Test: statsd unit tests
Change-Id: Ia4c67ebfdb4f9647d4135c6879f04faa4efdd471
2018-10-17 17:47:11 -07:00
TreeHugger Robot
7c5c113f53 Merge "Snapshot memory state for some native processes" 2018-10-17 16:30:55 +00:00
Rafal Slawik
0862158f13 Snapshot memory state for some native processes
Which processes to snapshot is controlled by a whitelist.

Benchmark for taking the snapshot:
https://docs.google.com/spreadsheets/d/1vG9ku8Uu8104CmKbO4cNeEKVeeByvHY--p0_dK1GAdA/edit?usp=sharing
(The difference between the first two sheets.)
~20ms constant cost plus ~4ms per process.

Bug: 115968899
Test: manually verified that statsd is included in the report
Change-Id: Iba680531c563ba28fae849e44044313866b2103f
2018-10-17 10:34:27 +01:00
TreeHugger Robot
dfa4c24aaf Merge "Add pulled atom subscription for shell." 2018-10-16 21:46:49 +00:00
Chenjie Yu
cfc152af9c Merge "Pull process cpu stats into statsd" 2018-10-16 20:48:57 +00:00
Chenjie Yu
b35b5f7c6b Pull process cpu stats into statsd
Here is a sample output:

$ adb shell cmd stats pull-source 10035
Pull from 10035: { 1539500981000000000 222067020557 (10035)0x10000->0[I]
0x20000->ksoftirqd/0[S] 0x30000->0[L] 0x40000->720[L]  }
Pull from 10035: { 1539500981000000000 222067020557
(10035)0x10000->1000[I]
0x20000->android.hardware.graphics.composer@2.1-service[S]
0x30000->1390[L] 0x40000->2240[L]  }
Pull from 10035: { 1539500981000000000 222067020557
(10035)0x10000->1002[I]
0x20000->android.hardware.bluetooth@1.0-service-qti[S] 0x30000->50[L]
0x40000->80[L]  }
Pull from 10035: { 1539500981000000000 222067020557
(10035)0x10000->1010[I] 0x20000->android.hardware.wifi@1.0-service[S]
0x30000->80[L] 0x40000->150[L]  }
Pull from 10035: { 1539500981000000000 222067020557
(10035)0x10000->1069[I] 0x20000->lmkd[S] 0x30000->60[L] 0x40000->280[L]
}
Pull from 10035: { 1539500981000000000 222067020557
(10035)0x10000->9999[I] 0x20000->traced_probes[S] 0x30000->0[L]
0x40000->10[L]  }
Pull from 10035: { 1539500981000000000 222067020557
(10035)0x10000->1066[I] 0x20000->statsd[S] 0x30000->160[L]
0x40000->160[L]  }
Pull from 10035: { 1539500981000000000 222067020557
(10035)0x10000->10024[I] 0x20000->com.android.systemui[S]
0x30000->3020[L] 0x40000->740[L]  }
Pull from 10035: { 1539500981000000000 222067020557
(10035)0x10000->10058[I] 0x20000->com.ustwo.lwp[S] 0x30000->9120[L]
0x40000->7810[L]  }
Pull from 10035: { 1539500981000000000 222067020557
(10035)0x10000->10080[I] 0x20000->com.google.android.apps.turbo[S]
0x30000->410[L] 0x40000->150[L]  }
Pull from 10035: { 1539500981000000000 222067020557
(10035)0x10000->10085[I] 0x20000->com.google.android.gms.persistent[S]
0x30000->9890[L] 0x40000->2560[L]  }
Pull from 10035: { 1539500981000000000 222067020557
(10035)0x10000->10110[I] 0x20000->com.google.android.ims[S]
0x30000->530[L] 0x40000->210[L]  }
Pull from 10035: { 1539500981000000000 222067020557
(10035)0x10000->10097[I] 0x20000->com.google.android.apps.maps[S]
0x30000->1170[L] 0x40000->290[L]  }
Pull from 10035: { 1539500981000000000 222067020557
(10035)0x10000->10014[I] 0x20000->android.process.acore[S]
0x30000->500[L] 0x40000->180[L]  }
Pull from 10035: { 1539500981000000000 222067020557
(10035)0x10000->10131[I] 0x20000->com.google.android.contacts[S]
0x30000->270[L] 0x40000->160[L]  }
Pull from 10035: { 1539500981000000000 222067020557
(10035)0x10000->2000[I] 0x20000->cmd[S] 0x30000->20[L] 0x40000->60[L]  }

Bug: 113353129
Test: will add cts
Change-Id: Ia5335910e4f044791e9043823cc4f007d372e7d3
2018-10-15 19:59:33 -07:00
Chenjie Yu
dd7dc4f7de local test drive tool for statsd
example usage:

$./out/host/linux-x86/bin/statsd_testdrive 10009
Uploading the following config to statsd:
id: 56789
gauge_metric {
  id: 2222
  what: 1234567
  gauge_fields_filter {
    include_all: true
  }
  bucket: ONE_MINUTE
}
atom_matcher {
  id: 1234567
  simple_atom_matcher {
    atom_id: 10009
  }
}
allowed_log_source: "AID_GRAPHICS"
allowed_log_source: "AID_INCIDENTD"
allowed_log_source: "AID_STATSD"
allowed_log_source: "AID_RADIO"
allowed_log_source: "com.android.systemui"
allowed_log_source: "com.android.vending"
allowed_log_source: "AID_SYSTEM"
allowed_log_source: "AID_ROOT"
allowed_log_source: "AID_BLUETOOTH"
hash_strings_in_metric_report: false

Success!

Success!

Now wait for 2 minutes ...
Success!

Got following metric data:
metric_id: 2222
gauge_metrics {
  data {
    bucket_info {
      atom {
        cpu_time_per_uid {
          uid: 0
          user_time_millis: 581844000
          sys_time_millis: 135242354000
        }
      }
      elapsed_timestamp_nanos: 610841423012521
      start_bucket_elapsed_millis: 610841423
      end_bucket_elapsed_millis: 610880290
    }
    bucket_info {
      atom {
        cpu_time_per_uid {
          uid: 0
          user_time_millis: 581904000
          sys_time_millis: 135251114000
        }
      }
      elapsed_timestamp_nanos: 610880295723373
      bucket_num: 65
    }
    bucket_info {
      atom {
        cpu_time_per_uid {
          uid: 0
          user_time_millis: 581944000
          sys_time_millis: 135264674000
        }
      }
      elapsed_timestamp_nanos: 610940293803881
      start_bucket_elapsed_millis: 610940290
      end_bucket_elapsed_millis: 610961579
    }
  }
}
time_base_elapsed_nano_seconds: 606980290711787
bucket_size_nano_seconds: 60000000000

Success!

Test: manual test
Change-Id: I8ea5249807cf3cf6971e3bbc8696ff33025ba8d7
2018-10-15 15:47:17 -07:00
TreeHugger Robot
b49d8ec17f Merge "Fix the typos and naming convention in atoms.proto" 2018-10-15 17:43:39 +00:00
Marcin Oczeretko
7ab7531dab Merge "Add more fields to LooperStats atom" 2018-10-15 14:43:18 +00:00
Yangster-mac
a8a304458b Fix the typos and naming convention in atoms.proto
Test: cts,statsd
BUG: b/117708491

Change-Id: Ib381ef66ae9925938e1f70b9a8869ef008e3d335
2018-10-14 22:04:52 -07:00
TreeHugger Robot
a20743b92d Merge "Make state atom field annotation name consistent between google3 and android." 2018-10-13 23:56:42 +00:00
Yangster-mac
b6b77c6fb4 Make state atom field annotation name consistent between google3 and android.
Test: statsd test
Fix: b/117681672

Change-Id: I3b0145516c594cc23565df67acc1cfa9f79d306e
2018-10-13 10:40:09 -07:00
Chih-Hung Hsieh
1863ff2644 Merge "Fix implicit fallthrough warnings." am: 012692be3f am: 3515bf0fc9
am: 0a6ca66a34

Change-Id: If5c42e9bd0b570531f29fc8ef9fc0fa1228db5fa
2018-10-12 18:17:58 -07:00
Chih-Hung Hsieh
0a6ca66a34 Merge "Fix implicit fallthrough warnings." am: 012692be3f
am: 3515bf0fc9

Change-Id: Ia07a0a00d1ae547bc7af968e6f8a7caeb51f3e6e
2018-10-12 18:05:24 -07:00
TreeHugger Robot
6d0b3051c8 Merge "Avoid importing protos." 2018-10-12 23:26:41 +00:00
TreeHugger Robot
eaa672ad0e Merge "Persist data to disk when system shuts down" 2018-10-12 23:15:49 +00:00
Chih-Hung Hsieh
6c5b82f7c5 Fix implicit fallthrough warnings.
Test: make checkbuild
Bug: 112564944
Change-Id: Ia33bf816fb6b179ac0a5a6a20bcb50c11b47431d
2018-10-12 15:05:01 -07:00
Yangster
af9aee7f3d Avoid importing protos.
Test: statsd test

Fix: b/117624077

Change-Id: I64ec8ed73c77dbff954b74882f753b90cf3ebead
2018-10-12 20:16:14 +00:00
TreeHugger Robot
d2aa51e481 Merge "Move/rename stats_enums.proto's directory/name" 2018-10-12 18:16:52 +00:00
Yao Chen
41e606c1fc Add pulled atom subscription for shell.
+ Changed the output format from Atom to ShellData, which is a wrapper for repeated Atom
  This is useful because pulled atoms are usually a list of atoms.

Test: statsd_test added
Bug: 110536553

Change-Id: I0e2f55bdd9015c9bc95b87a630297c6f13e39636
2018-10-12 09:23:25 -07:00
Marcin Oczeretko
c06331adee Add more fields to LooperStats atom
Test: Manual
Bug: 113651685
Change-Id: I7b2b64bf939310627f0659e0656aa86d0fc79e96
2018-10-12 15:47:43 +00:00
Howard Ro
9a862de7e9 Move/rename stats_enums.proto's directory/name
Migrate stats_enums.proto to core/proto/android/stats/ directory for the
consistency with other enums file imported in atoms.proto

Test: mma
Change-Id: I79f068889ac5c34c6fd8c5966687669efb37d180
2018-10-11 23:52:09 -07:00
Yangster-mac
97e7d20445 Persist data to disk when system shuts down
Test: local test

BUG: b/112432890

Change-Id: Iaed318671a719cc366d4e6be9f77270147ba6596
2018-10-11 13:25:37 -07:00
Yangster
1db2e8e4b4 Merge "Phone service state change atom." am: 419fc89b52 am: 16e3399902
am: 8f842fae06

Change-Id: Ibc518a29d8a31b3001aa6569ee370c45ce302f7c
2018-10-10 22:06:25 -07:00
Yangster
8f842fae06 Merge "Phone service state change atom." am: 419fc89b52
am: 16e3399902

Change-Id: Ifbff53d3b113c527975b5509289600f734dcca7b
2018-10-10 15:53:35 -07:00
Yangster
4ccebeadc7 Phone service state change atom.
Background: BatteryStatsService tracks the phone scanning time metric. In Q,
we are migrating the dumpsys-based collection to the new infra. This CL is to
instrument the new logging mechanism.

Test: statsd test
FIX: b/116748990

Change-Id: I3cf5e0026bfc6f594c5f7b524f14b3a43b702afb
2018-10-10 19:45:10 +00:00
Igor Murashkin
1a957c8737 Merge "statsd: Add AID mappings for iorapd" am: 34bd3dfb39 am: 543c688c3b
am: 13ad78e9e7

Change-Id: If99bb83fbd4a9a5c533269ffc21995e0206d78a3
2018-10-08 14:14:11 -07:00
Igor Murashkin
13ad78e9e7 Merge "statsd: Add AID mappings for iorapd" am: 34bd3dfb39
am: 543c688c3b

Change-Id: I7bbdf54070318e3faa962690bbf214c51682bc37
2018-10-08 13:50:54 -07:00
Treehugger Robot
34bd3dfb39 Merge "statsd: Add AID mappings for iorapd" 2018-10-08 20:12:59 +00:00
TreeHugger Robot
10efed0b49 Merge "Remove SMS access for apps other than current SMS handler" 2018-10-06 20:14:06 +00:00
TreeHugger Robot
0ccb5a9705 Merge "pull procstats package process stats section" 2018-10-06 01:19:25 +00:00
Eugene Susla
9351985f7a Remove SMS access for apps other than current SMS handler
Bug: 110098858
Test: atest android.telephony.cts.SmsManagerTest#testContentProviderAccessRestrictions
Change-Id: I9da992565b04ca5fa2656801fd2cfe4b196ef9b4
2018-10-05 16:51:13 -07:00
Igor Murashkin
12bb16c955 statsd: Add AID mappings for iorapd
Bug: 117295673
Change-Id: Ie0c7a7bf823159492259ac1ec6680b45784afb84
2018-10-05 16:25:21 -07:00
Chenjie Yu
b52779e710 pull procstats package process stats section
Test: cts
BUG: b/113075820
Change-Id: Iad37427227181ff41b3630a3c907c7bb7f3efa2b
2018-10-05 23:21:51 +00:00
Igor Murashkin
5fa865fef6 Merge "statsd: Add missing AIDs to UidMap" am: 4593c78168 am: df28b82042
am: 9485d2610f

Change-Id: Id5c86477ab2460139d64f5ea7fecd33cc2331128
2018-10-05 11:58:10 -07:00
Igor Murashkin
9485d2610f Merge "statsd: Add missing AIDs to UidMap" am: 4593c78168
am: df28b82042

Change-Id: I50631821a385b8c7a8b2889f392e5a1dce994517
2018-10-05 11:44:49 -07:00
Treehugger Robot
4593c78168 Merge "statsd: Add missing AIDs to UidMap" 2018-10-05 16:52:11 +00:00
TreeHugger Robot
c1dea6f02e Merge "Fix statsd_test unit tests for TestKeyValuePairsEvent" 2018-10-04 22:41:36 +00:00