• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2019 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17syntax = "proto2";
18
19package perfetto.protos;
20
21// Metadata for chrome traces.
22message ChromeMetadataPacket {
23  optional BackgroundTracingMetadata background_tracing_metadata = 1;
24
25  // Version code of Chrome used by Android's Play Store. This field is only set
26  // on Android.
27  optional int32 chrome_version_code = 2;
28
29  // Comma separated list of enabled categories for tracing. The list of
30  // possible category strings are listed in code
31  // base/trace_event/builtin_categories.h.
32  optional string enabled_categories = 3;
33
34  // Finch name and group based on the ActiveGroupId.
35  message FinchHash {
36    optional uint32 name = 1;
37    optional uint32 group = 2;
38  }
39
40  // List of Finch study/groups that apply to this trace.
41  repeated FinchHash field_trial_hashes = 4;
42}
43
44// Metadata related to background tracing scenarios, states and triggers.
45message BackgroundTracingMetadata {
46  // Information about a trigger rule defined in the experiment config.
47  message TriggerRule {
48    enum TriggerType {
49      TRIGGER_UNSPECIFIED = 0;
50
51      // Traces are triggered by specific range of values of an UMA histogram.
52      MONITOR_AND_DUMP_WHEN_SPECIFIC_HISTOGRAM_AND_VALUE = 1;
53
54      // Traces are triggered by specific named events in chromium codebase,
55      // like "second-update-failure".
56      MONITOR_AND_DUMP_WHEN_TRIGGER_NAMED = 2;
57    }
58    optional TriggerType trigger_type = 1;
59
60    // Configuration of histogram trigger.
61    message HistogramRule {
62      // UMA histogram name hash, same as HistogramEventProto.name_hash.
63      optional fixed64 histogram_name_hash = 1;
64
65      // Range of values of the histogram that activates trigger.
66      optional int64 histogram_min_trigger = 2;
67      optional int64 histogram_max_trigger = 3;
68    }
69    optional HistogramRule histogram_rule = 2;
70
71    // Configuration of named trigger.
72    message NamedRule {
73      enum EventType {
74        UNSPECIFIED = 0;
75        SESSION_RESTORE = 1;
76        NAVIGATION = 2;
77        STARTUP = 3;
78        REACHED_CODE = 4;
79        CONTENT_TRIGGER = 5;
80
81        TEST_RULE = 1000;
82      }
83      optional EventType event_type = 1;
84
85      // If |event_type| is CONTENT_TRIGGER, then this stores the hash of the
86      // content-trigger that actually fired.
87      optional fixed64 content_trigger_name_hash = 2;
88    }
89    optional NamedRule named_rule = 3;
90
91    // Hash of the rule name.
92    optional fixed32 name_hash = 4;
93  }
94
95  // Specifies the rule that caused the trace to be uploaded.
96  optional TriggerRule triggered_rule = 1;
97
98  // List of all active triggers in current session, when trace was triggered.
99  repeated TriggerRule active_rules = 2;
100
101  // Hash of the scenario name.
102  optional fixed32 scenario_name_hash = 3;
103}
104