diff --git a/opentelemetry/proto/profiles/v1development/profiles.proto b/opentelemetry/proto/profiles/v1development/profiles.proto index f8f0c837..aac32d9d 100644 --- a/opentelemetry/proto/profiles/v1development/profiles.proto +++ b/opentelemetry/proto/profiles/v1development/profiles.proto @@ -138,20 +138,46 @@ message ProfilesData { // corresponding to the given stack tree node. The two arrays must have the // same length. The parent array uses -1 for the root nodes. // - // For example, the following location and stack tree data: + // For example, the following locations and stack tree data: // - // location_table = ["", "main", "foo", "bar", "baz1", "baz2"] - // (stack index) = 0 1 2 3 4 5 - // stack_parent_array = [-1, 0, 1, 2, 2, 1] - // stack_location_index = [ 1, 2, 3, 4, 5, 5] + // +-------------+----------------+--------------------+----------------------+ + // | stack index | location_table | stack_parent_array | stack_location_index | + // +-------------+----------------+--------------------+----------------------+ + // | 0 | "" | -1 | 1 | + // | 1 | "main" | 0 | 2 | + // | 2 | "foo" | 1 | 3 | + // | 3 | "bar" | 2 | 4 | + // | 4 | "baz1" | 2 | 5 | + // | 5 | "baz2" | 1 | 5 | + // +-------------+----------------+--------------------+----------------------+ // // are encoding these stacks (the number is the stack index): // - // main|0 -> foo|1 -> bar|2 - // main|0 -> foo|1 -> bar|2 -> baz1|3 - // main|0 -> foo|1 -> bar|2 -> baz2|4 - // main|0 -> foo|1 -> baz2|5 + // main (0) + // └── foo (1) + // ├── bar (2) + // │ ├── baz1 (3) + // │ └── baz2 (4) + // └── baz2 (5) // + // And here is an example of the operations to decode the stack trace + // "main->foo->bar->baz2" at stack index 4. + // + // 1. Lookup stack_location_index[4] = 5 + // 2. Lookup location_table[5] = "baz2" + // 3. Lookup stack_parent_array[4] = 2 + // + // 4. Lookup stack_location_index[2] = 3 + // 5. Lookup location_table[3] = "bar" + // 6. Lookup stack_parent_array[2] = 1 + // + // 7. Lookup stack_location_index[1] = 2 + // 8. Lookup location_table[2] = "foo" + // 9. Lookup stack_parent_array[1] = 0 + // + // 10. Lookup stack_location_index[0] = 1 + // 11. Lookup location_table[1] = "main" + // 12. Lookup stack_parent_array[0] = -1 repeated int32 stack_parent_array = 9; repeated int32 stack_location_index = 10; }