syntax = "proto2";

package code.justin.tv.rhys.nursery.profile;
option go_package = "profile";

message Profile {
	repeated ValueType sample_type = 1;
	repeated Sample sample = 2;
	repeated Mapping mapping = 3;
	repeated Location location = 4;
	repeated Function function = 5;
	repeated string string_table = 6;
	optional int64 x_drop_frames = 7;
	optional int64 x_keep_frames = 8;
	optional int64 time_nanos = 9;
	optional int64 duration_nanos = 10;
	optional ValueType period_type = 11;
	optional int64 period = 12;
}

message Function {
	optional uint64 id = 1;
	optional int64 x_name = 2;
	optional int64 x_system_name = 3;
	optional int64 x_filename = 4;
	optional int64 start_line = 5;
}

message Label {
	optional int64 x_key = 1;
	optional int64 x_str = 2;
	optional int64 x_num = 3;
}

message Line {
	optional uint64 function_idx = 1;
	optional int64 line = 2;
}

message Location {
	optional uint64 id = 1;
	optional uint64 mapping_idx = 2;
	optional uint64 address = 3;
	repeated Line line = 4;
}

message Mapping {
	optional uint64 id = 1;
	optional uint64 start = 2;
	optional uint64 limit = 3;
	optional uint64 offset = 4;
	optional int64 x_file = 5;
	optional int64 build_idx = 6;
	optional bool has_functions = 7;
	optional bool has_filenames = 8;
	optional bool has_line_numbers = 9;
	optional bool has_inline_frames = 10;
}

message Sample {
	repeated uint64 location_idx = 1;
	repeated int64 value = 2;
	repeated Label x_label = 3;
}

message ValueType {
	optional int64 x_type = 1;
	optional int64 x_unit = 2;
}
