summaryrefslogtreecommitdiff
path: root/tools/stats_log_api_gen/test.proto
diff options
context:
space:
mode:
Diffstat (limited to 'tools/stats_log_api_gen/test.proto')
-rw-r--r--tools/stats_log_api_gen/test.proto101
1 files changed, 40 insertions, 61 deletions
diff --git a/tools/stats_log_api_gen/test.proto b/tools/stats_log_api_gen/test.proto
index c3e703826be5..aaa488e44fee 100644
--- a/tools/stats_log_api_gen/test.proto
+++ b/tools/stats_log_api_gen/test.proto
@@ -41,21 +41,20 @@ enum AnEnum {
message AllTypesAtom {
repeated android.os.statsd.AttributionNode attribution_chain = 1;
- optional double double_field = 2;
- optional float float_field = 3;
- optional int64 int64_field = 4;
- optional uint64 uint64_field = 5;
- optional int32 int32_field = 6;
- optional fixed64 fixed64_field = 7;
- optional fixed32 fixed32_field = 8;
- optional bool bool_field = 9;
- optional string string_field = 10;
- optional uint32 uint32_field = 11;
- optional AnEnum enum_field = 12;
- optional sfixed32 sfixed32_field = 13;
- optional sfixed64 sfixed64_field = 14;
- optional sint32 sint32_field = 15;
- optional sint64 sint64_field = 16;
+ optional float float_field = 2;
+ optional int64 int64_field = 3;
+ optional uint64 uint64_field = 4;
+ optional int32 int32_field = 5;
+ optional fixed64 fixed64_field = 6;
+ optional fixed32 fixed32_field = 7;
+ optional bool bool_field = 8;
+ optional string string_field = 9;
+ optional uint32 uint32_field = 10;
+ optional AnEnum enum_field = 11;
+ optional sfixed32 sfixed32_field = 12;
+ optional sfixed64 sfixed64_field = 13;
+ optional sint32 sint32_field = 14;
+ optional sint64 sint64_field = 15;
}
message Event {
@@ -70,6 +69,8 @@ message Event {
message BadTypesAtom {
optional IntAtom bad_int_atom = 1;
optional bytes bad_bytes = 2;
+ repeated int32 repeated_field = 3;
+ optional double double_field = 4;
}
message BadTypesEvent {
@@ -148,89 +149,67 @@ message GoodStateAtoms {
// The atom has only primary field but no exclusive state field.
message BadStateAtom1 {
- optional int32 uid = 1
- [(android.os.statsd.state_field_option).option = PRIMARY];
+ optional int32 uid = 1 [(android.os.statsd.state_field_option).primary_field = true];
}
// Only primative types can be annotated.
message BadStateAtom2 {
repeated android.os.statsd.AttributionNode attribution = 1
- [(android.os.statsd.state_field_option).option = PRIMARY];
- optional int32 state = 2
- [(android.os.statsd.state_field_option).option = EXCLUSIVE];
+ [(android.os.statsd.state_field_option).primary_field = true];
+ optional int32 state = 2 [(android.os.statsd.state_field_option).exclusive_state = true];
}
// Having 2 exclusive state field in the atom means the atom is badly designed.
// E.g., putting bluetooth state and wifi state in the same atom.
message BadStateAtom3 {
- optional int32 uid = 1
- [(android.os.statsd.state_field_option).option = PRIMARY];
- optional int32 state = 2
- [(android.os.statsd.state_field_option).option = EXCLUSIVE];
- optional int32 state2 = 3
- [(android.os.statsd.state_field_option).option = EXCLUSIVE];
+ optional int32 uid = 1 [(android.os.statsd.state_field_option).primary_field = true];
+ optional int32 state = 2 [(android.os.statsd.state_field_option).exclusive_state = true];
+ optional int32 state2 = 3 [(android.os.statsd.state_field_option).exclusive_state = true];
}
message GoodStateAtom1 {
- optional int32 uid = 1
- [(android.os.statsd.state_field_option).option = PRIMARY];
- optional int32 state = 2
- [(android.os.statsd.state_field_option).option = EXCLUSIVE];
+ optional int32 uid = 1 [(android.os.statsd.state_field_option).primary_field = true];
+ optional int32 state = 2 [(android.os.statsd.state_field_option).exclusive_state = true];
}
// Atoms can have exclusive state field, but no primary field. That means
// the state is globally exclusive (e.g., DisplayState).
message GoodStateAtom2 {
optional int32 uid = 1;
- optional int32 state = 2
- [(android.os.statsd.state_field_option).option = EXCLUSIVE];
+ optional int32 state = 2 [(android.os.statsd.state_field_option).exclusive_state = true];
}
// We can have more than one primary fields. That means their combination is a
// primary key.
message GoodStateAtom3 {
- optional int32 uid = 1
- [(android.os.statsd.state_field_option).option = PRIMARY];
- optional int32 tid = 2
- [(android.os.statsd.state_field_option).option = PRIMARY];
- optional int32 state = 3
- [(android.os.statsd.state_field_option).option = EXCLUSIVE];
-}
-
-message WhitelistedAtom {
- optional int32 field = 1;
-}
-
-message NonWhitelistedAtom {
- optional int32 field = 1;
-}
-
-message ListedAtoms {
- oneof event {
- // Atoms can be whitelisted i.e. they can be triggered by any source
- WhitelistedAtom whitelisted_atom = 1 [(android.os.statsd.allow_from_any_uid) = true];
- // Atoms are not whitelisted by default, so they can only be triggered
- // by whitelisted sources
- NonWhitelistedAtom non_whitelisted_atom = 2;
- }
+ optional int32 uid = 1 [(android.os.statsd.state_field_option).primary_field = true];
+ optional int32 tid = 2 [(android.os.statsd.state_field_option).primary_field = true];
+ optional int32 state = 3 [(android.os.statsd.state_field_option).exclusive_state = true];
}
message ModuleOneAtom {
- optional int32 field = 1;
+ optional int32 field = 1 [(android.os.statsd.is_uid) = true];
}
message ModuleTwoAtom {
optional int32 field = 1;
}
+message ModuleOneAndTwoAtom {
+ optional int32 field = 1 [(android.os.statsd.state_field_option).exclusive_state = true];
+}
+
message NoModuleAtom {
optional string field = 1;
}
message ModuleAtoms {
oneof event {
- ModuleOneAtom module_one_atom = 1 [(android.os.statsd.log_from_module) = "module1"];
- ModuleTwoAtom module_two_atom = 2 [(android.os.statsd.log_from_module) = "module2"];
- NoModuleAtom no_module_atom = 3;
+ ModuleOneAtom module_one_atom = 1 [(android.os.statsd.module) = "module1"];
+ ModuleTwoAtom module_two_atom = 2 [(android.os.statsd.module) = "module2"];
+ ModuleOneAndTwoAtom module_one_and_two_atom = 3 [
+ (android.os.statsd.module) = "module1", (android.os.statsd.module) = "module2"
+ ];
+ NoModuleAtom no_module_atom = 4;
}
-} \ No newline at end of file
+}