Skip to content

Commit 6ac8ddf

Browse files
authored
Merge pull request #15 from pyroscope-io/feat/context_id
Parse "contextId" fields from new async-profiler feature
2 parents 45dba60 + badc14d commit 6ac8ddf

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

parser/event_types.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -622,6 +622,7 @@ type ExecutionSample struct {
622622
SampledThread *Thread
623623
StackTrace *StackTrace
624624
State *ThreadState
625+
ContextId int64
625626
}
626627

627628
func (es *ExecutionSample) parseField(name string, p ParseResolvable) (err error) {
@@ -634,6 +635,8 @@ func (es *ExecutionSample) parseField(name string, p ParseResolvable) (err error
634635
es.StackTrace, err = toStackTrace(p)
635636
case "state":
636637
es.State, err = toThreadState(p)
638+
case "contextId":
639+
es.ContextId, err = toLong(p)
637640
}
638641
return err
639642
}
@@ -846,6 +849,7 @@ type JavaMonitorEnter struct {
846849
MonitorClass *Class
847850
PreviousOwner *Thread
848851
Address int64
852+
ContextId int64
849853
}
850854

851855
func (jme *JavaMonitorEnter) parseField(name string, p ParseResolvable) (err error) {
@@ -864,6 +868,8 @@ func (jme *JavaMonitorEnter) parseField(name string, p ParseResolvable) (err err
864868
jme.PreviousOwner, err = toThread(p)
865869
case "address":
866870
jme.Address, err = toLong(p)
871+
case "contextId":
872+
jme.ContextId, err = toLong(p)
867873
}
868874
return err
869875
}
@@ -1146,6 +1152,7 @@ type ObjectAllocationInNewTLAB struct {
11461152
ObjectClass *Class
11471153
AllocationSize int64
11481154
TLABSize int64
1155+
ContextId int64
11491156
}
11501157

11511158
func (oa *ObjectAllocationInNewTLAB) parseField(name string, p ParseResolvable) (err error) {
@@ -1162,7 +1169,10 @@ func (oa *ObjectAllocationInNewTLAB) parseField(name string, p ParseResolvable)
11621169
oa.AllocationSize, err = toLong(p)
11631170
case "tlabSize":
11641171
oa.TLABSize, err = toLong(p)
1172+
case "contextId":
1173+
oa.ContextId, err = toLong(p)
11651174
}
1175+
11661176
return err
11671177
}
11681178

@@ -1176,6 +1186,7 @@ type ObjectAllocationOutsideTLAB struct {
11761186
StackTrace *StackTrace
11771187
ObjectClass *Class
11781188
AllocationSize int64
1189+
ContextId int64
11791190
}
11801191

11811192
func (oa *ObjectAllocationOutsideTLAB) parseField(name string, p ParseResolvable) (err error) {
@@ -1190,6 +1201,8 @@ func (oa *ObjectAllocationOutsideTLAB) parseField(name string, p ParseResolvable
11901201
oa.ObjectClass, err = toClass(p)
11911202
case "allocationSize":
11921203
oa.AllocationSize, err = toLong(p)
1204+
case "contextId":
1205+
oa.ContextId, err = toLong(p)
11931206
}
11941207
return err
11951208
}
@@ -1552,6 +1565,7 @@ type ThreadPark struct {
15521565
Timeout int64
15531566
Until int64
15541567
Address int64
1568+
ContextId int64
15551569
}
15561570

15571571
func (tp *ThreadPark) parseField(name string, p ParseResolvable) (err error) {
@@ -1572,6 +1586,8 @@ func (tp *ThreadPark) parseField(name string, p ParseResolvable) (err error) {
15721586
tp.Until, err = toLong(p)
15731587
case "address":
15741588
tp.Address, err = toLong(p)
1589+
case "contextId": // todo this one seems to be unimplemented in the profiler yet
1590+
tp.ContextId, err = toLong(p)
15751591
}
15761592
return err
15771593
}

0 commit comments

Comments
 (0)