Skip to content

Commit

Permalink
Merge pull request #15 from pyroscope-io/feat/context_id
Browse files Browse the repository at this point in the history
Parse "contextId" fields from new async-profiler feature
  • Loading branch information
petethepig authored May 13, 2022
2 parents 45dba60 + badc14d commit 6ac8ddf
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions parser/event_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -622,6 +622,7 @@ type ExecutionSample struct {
SampledThread *Thread
StackTrace *StackTrace
State *ThreadState
ContextId int64
}

func (es *ExecutionSample) parseField(name string, p ParseResolvable) (err error) {
Expand All @@ -634,6 +635,8 @@ func (es *ExecutionSample) parseField(name string, p ParseResolvable) (err error
es.StackTrace, err = toStackTrace(p)
case "state":
es.State, err = toThreadState(p)
case "contextId":
es.ContextId, err = toLong(p)
}
return err
}
Expand Down Expand Up @@ -846,6 +849,7 @@ type JavaMonitorEnter struct {
MonitorClass *Class
PreviousOwner *Thread
Address int64
ContextId int64
}

func (jme *JavaMonitorEnter) parseField(name string, p ParseResolvable) (err error) {
Expand All @@ -864,6 +868,8 @@ func (jme *JavaMonitorEnter) parseField(name string, p ParseResolvable) (err err
jme.PreviousOwner, err = toThread(p)
case "address":
jme.Address, err = toLong(p)
case "contextId":
jme.ContextId, err = toLong(p)
}
return err
}
Expand Down Expand Up @@ -1146,6 +1152,7 @@ type ObjectAllocationInNewTLAB struct {
ObjectClass *Class
AllocationSize int64
TLABSize int64
ContextId int64
}

func (oa *ObjectAllocationInNewTLAB) parseField(name string, p ParseResolvable) (err error) {
Expand All @@ -1162,7 +1169,10 @@ func (oa *ObjectAllocationInNewTLAB) parseField(name string, p ParseResolvable)
oa.AllocationSize, err = toLong(p)
case "tlabSize":
oa.TLABSize, err = toLong(p)
case "contextId":
oa.ContextId, err = toLong(p)
}

return err
}

Expand All @@ -1176,6 +1186,7 @@ type ObjectAllocationOutsideTLAB struct {
StackTrace *StackTrace
ObjectClass *Class
AllocationSize int64
ContextId int64
}

func (oa *ObjectAllocationOutsideTLAB) parseField(name string, p ParseResolvable) (err error) {
Expand All @@ -1190,6 +1201,8 @@ func (oa *ObjectAllocationOutsideTLAB) parseField(name string, p ParseResolvable
oa.ObjectClass, err = toClass(p)
case "allocationSize":
oa.AllocationSize, err = toLong(p)
case "contextId":
oa.ContextId, err = toLong(p)
}
return err
}
Expand Down Expand Up @@ -1552,6 +1565,7 @@ type ThreadPark struct {
Timeout int64
Until int64
Address int64
ContextId int64
}

func (tp *ThreadPark) parseField(name string, p ParseResolvable) (err error) {
Expand All @@ -1572,6 +1586,8 @@ func (tp *ThreadPark) parseField(name string, p ParseResolvable) (err error) {
tp.Until, err = toLong(p)
case "address":
tp.Address, err = toLong(p)
case "contextId": // todo this one seems to be unimplemented in the profiler yet
tp.ContextId, err = toLong(p)
}
return err
}
Expand Down

0 comments on commit 6ac8ddf

Please sign in to comment.