Commit Graph

15 Commits

Author SHA1 Message Date
Tej Singh
2c96b5acf3 Fix KeyValuePairsAtom
The field of the FieldValue was not properly being set in LogEvent for
many of the types in the KeyValuePairsAtom.

Test: manual inspeciton of logcat
Test: modified unit tests and made sure they passed
Change-Id: I445a2d3051cfa86affe45ea9a3fe69794f962eff
2019-02-04 21:28:49 -08:00
TreeHugger Robot
f69ca4e970 Merge "Skip writing message field in an atom if it's empty" 2018-11-29 22:52:57 +00:00
Yao Chen
8e6f998300 Skip writing message field in an atom if it's empty
Test: unit test added
Change-Id: I825b1ce526944a20fe65705508ad180ece37492c
2018-11-29 10:59:57 -08:00
Chenjie Yu
d7e3a228be Revert "Revert "support work chain in pulled atoms""
This reverts commit 9c7b131996.

Reason for revert: Fixed build failures due to merge

Change-Id: I7d7bfed3a3234b966f3fe3fd6e0cbc63d2bedf83
Test: unit test
2018-11-28 15:53:09 -08:00
Fabian Kozynski
9c7b131996 Revert "support work chain in pulled atoms"
This reverts commit ce8e4dce60.

Reason for revert: breaking multiple targets in master

Change-Id: I3ee74b314e06cb2c4d3d6da82ca116a91aad67d4
2018-11-28 20:13:22 +00:00
Chenjie Yu
ce8e4dce60 support work chain in pulled atoms
+ also rewrite map and merge isolated uid to host uid.

output:
Pull from 10014: { 1541137009000000000 10430748770707
(10014)0x2010101->1[I] 0x2010182->lala1[S] 0x2010201->2[I]
0x2018282->lala2[S] 0x20000->10430750[L]  }

Bug: 119043339
Bug: 117975376
Test: unit test
Change-Id: Ib6e3ea0f76594438ee1b3e12e965d85fefb405d7
2018-11-20 16:15:31 -08:00
Yao Chen
8c43386145 Adding tests and move launcher.proto
Test: statsd_test

Change-Id: I0655f70098d78f8f6dc9381921c4a687d2195bd4
2018-10-26 10:28:05 -07:00
Howard Ro
1a2a399419 Log uid info to KeyValuePairAtom
Bug: 118153464
Test: verified the data via print-logs in logcat
Change-Id: I74fcde1a7d2b2c37eb6d63e40fb5cb40ebb9cff9
2018-10-25 13:26:42 -07:00
Howard Ro
a5b0f1edf1 Fix statsd_test unit tests for TestKeyValuePairsEvent
Test: tested in marlin with 100% passing
Change-Id: I4f3ac89061ec126356a5cc42e1a575599f3302fc
2018-10-02 16:20:43 -07:00
Howard Ro
4078dd4e15 Support int32_t (Java Integer) in KeyValuePair atom
Bug: 116826451
Test: statsd_test + manual verification through logcat
Change-Id: I0157c22033907fea46e26ee4262c723fa8c0b518
2018-09-27 17:51:40 -07:00
Yangster-mac
e124e42582 Interface of writing key value pair atom to socket and parsing from statsd.
Test: statsd unit test
BUG: b/114231161

Change-Id: I3543900934b5e8e0677bf1e7cc454d61064a2475
2018-09-07 11:09:37 -07:00
Yangster-mac
48b3d62bfe Create log event from key value maps.
BUG: b/112816333
Test: statsd test.
Change-Id: Ib66f06186abfacd77807436379e1e142a5b87c99
2018-08-19 22:37:59 +00:00
Yao Chen
9c1debe330 Add annotation to atoms that represent a state change in atoms.proto
+ A state change atom can have one exclusive state field, and any
  number of primary key fields.

  When there is primary key in the atom, it means the state belongs to the primary key.
  For example,
  message UidProcessStateChanged {
    optional int32 uid = 1 [(stateFieldOption).option = PRIMARY];
    optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
  }

  When there is no primary key fields in the atom, the state is global.
  For example,
  message ScreenStateChanged {
     optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
  }

+ The annotation is consumed by stats_log_api_gen to generate a static map from the state
  atoms to its primary fields, and exclusive fields

+ stats_log.proto is splitted into 2 proto files, because statsd needs proto lite, and c++
  lite proto library cannot properly ignore the field options which requires full proto.

 This CL doesn't change any logic in the statsd yet. A separate CL will use the field option
 information to correctly track the state.

Test: added unit tests in stats_log_api_gen_test. and statsd_test pases.
Change-Id: I9e8a979fe81ba60efd4d854bb7087ce4b2b147ec
2018-02-21 16:46:56 -08:00
Yao Chen
8a8d16ceea Statsd CPU optimization.
The key change is to revamp how we parse/store/match a log event, especially how we match repeated
field and attribution nodes, and how we construct dimensions and compare them.

+ We use a integer to encode the field of a log element. And also encode the FieldMatcher into an
integer and a bit mask. The log matching becomes 2 integer operations.

+ Dimension is stored as encoded field and value pair. Checking if 2 dimensions are equal is then
  becoming checking if the underlying integers are equal. The integers are stored contiguously
  in memory, so it's much faster than previous tree structure.

Start review from FieldValue.h

Test: statsd_test + new unit tests

Bug: 72659059

Change-Id: Iec8daeacdd3f39ab297c10ab9cd7b710a9c42e86
2018-02-12 10:38:45 -08:00
Yangster-mac
2087716f2b 1/ Support nested message and repeated fields in statsd.
2/ Filter gauge fields by FieldMatcher.
3/ Wire up wakelock attribution chain.
4/ e2e test: wakelock duration metric with aggregated predicate dimensions.
5/ e2e test: count metric with multiple metric condition links for 2 predicates and 1 non-sliced predicate.

Test: statsd unit test passed.

Change-Id: I89db31cb068184a54e0a892fad710966d3127bc9
2018-01-01 10:01:36 -08:00