Sync query protocol for cross-process profiling (#54)

diff --git a/dependencies.sh b/dependencies.sh
index 81da54a..97da551 100644
--- a/dependencies.sh
+++ b/dependencies.sh
@@ -18,7 +18,7 @@
 # under the License.
 
 export COLLECT_PROTOCOL_SHA=0da9c8b3e111fb51c9f8854cae16d4519462ecfe
-export QUERY_PROTOCOL_SHA=4749946962b9c685111876d1abe8c745d3cf3253
+export QUERY_PROTOCOL_SHA=a530c33fac3f5890b5ba99f1f782e0eb32b646cd
 export ENVOY_SERVICE_PROTOCOL_SHA=533b32f1b390a3a88ec2008d0561e07c926d879a
 export XDS_SERVICE_PROTOCOL_SHA=25de7278fc844d392d607214f36dbedf50f167ee
 export PROTOC_VALIDATE_SHA=v0.6.1
diff --git a/go.mod b/go.mod
index 3e149cc..c0e06ee 100644
--- a/go.mod
+++ b/go.mod
@@ -7,5 +7,5 @@
 	golang.org/x/net v0.6.0 // indirect
 	google.golang.org/genproto v0.0.0-20210624195500-8bfb893ecb84 // indirect
 	google.golang.org/grpc v1.40.0
-	google.golang.org/protobuf v1.28.1
+	google.golang.org/protobuf v1.29.0
 )
diff --git a/go.sum b/go.sum
index b31cbee..e511671 100644
--- a/go.sum
+++ b/go.sum
@@ -149,8 +149,8 @@
 google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlbajtzgsN7c=
 google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
 google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
-google.golang.org/protobuf v1.28.1 h1:d0NfwRgPtno5B1Wa6L2DAG+KivqkdutMf1UhdNx175w=
-google.golang.org/protobuf v1.28.1/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
+google.golang.org/protobuf v1.29.0 h1:44S3JjaKmLEE4YIkjzexaP+NzZsudE3Zin5Njn/pYX0=
+google.golang.org/protobuf v1.29.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
 gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
 gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
 gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
diff --git a/query/schema.go b/query/schema.go
index 0dd2cbe..77127de 100644
--- a/query/schema.go
+++ b/query/schema.go
@@ -352,8 +352,9 @@
 }
 
 type KVInt struct {
-	ID    string `json:"id"`
-	Value int64  `json:"value"`
+	ID           string `json:"id"`
+	Value        int64  `json:"value"`
+	IsEmptyValue bool   `json:"isEmptyValue"`
 }
 
 type KeyNumericValue struct {
@@ -573,6 +574,8 @@
 type ProfiledSpan struct {
 	SpanID              int          `json:"spanId"`
 	ParentSpanID        int          `json:"parentSpanId"`
+	SegmentID           string       `json:"segmentId"`
+	Refs                []*Ref       `json:"refs"`
 	ServiceCode         string       `json:"serviceCode"`
 	ServiceInstanceName string       `json:"serviceInstanceName"`
 	StartTime           int64        `json:"startTime"`
@@ -585,6 +588,17 @@
 	Layer               *string      `json:"layer,omitempty"`
 	Tags                []*KeyValue  `json:"tags"`
 	Logs                []*LogEntity `json:"logs"`
+	Profiled            bool         `json:"profiled"`
+}
+
+type ProfiledTraceSegments struct {
+	TraceID       string          `json:"traceId"`
+	InstanceID    string          `json:"instanceId"`
+	InstanceName  string          `json:"instanceName"`
+	EndpointNames []string        `json:"endpointNames"`
+	Duration      int             `json:"duration"`
+	Start         string          `json:"start"`
+	Spans         []*ProfiledSpan `json:"spans"`
 }
 
 type Record struct {
@@ -608,6 +622,11 @@
 	Type            RefType `json:"type"`
 }
 
+type SegmentProfileAnalyzeQuery struct {
+	SegmentID string                   `json:"segmentId"`
+	TimeRange *ProfileAnalyzeTimeRange `json:"timeRange,omitempty"`
+}
+
 type SelectedRecord struct {
 	Name  string  `json:"name"`
 	ID    string  `json:"id"`