xref: /aosp_15_r20/external/perfetto/protos/perfetto/trace_processor/stack.proto (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1/*
2 * Copyright (C) 2023 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// Representation of a stack. To be used as input to generate flame charts
22// or pprof.
23message Stack {
24  // A stack is an ordered list of these entries. Think of them as frames in the
25  // stack, although we support entire call stacks as an entry (for efficiency,
26  // no need to copy entire stacks around if we can just copy a callsite_id).
27  message Entry {
28    oneof entry {
29      string name = 1;
30      uint32 callsite_id = 2;
31      uint32 annotated_callsite_id = 3;
32      uint32 frame_id = 4;
33    }
34  }
35  // Ordered list of "frames" in the stack. Leaf is at index 0.
36  // Note that we call these entries and not frames because an entire call stack
37  // can be referenced in one entry (via callsite_id).
38  repeated Entry entries = 1;
39}
40