MCPcopy Create free account
hub / github.com/google/pprof / javaCPUProfile

Function javaCPUProfile

profile/legacy_java_profile.go:42–64  ·  view source on GitHub ↗

javaCPUProfile returns a new Profile from profilez data. b is the profile bytes after the header, period is the profiling period, and parse is a function to parse 8-byte chunks from the profile in its native endianness.

(b []byte, period int64, parse func(b []byte) (uint64, []byte))

Source from the content-addressed store, hash-verified

40// period, and parse is a function to parse 8-byte chunks from the
41// profile in its native endianness.
42func javaCPUProfile(b []byte, period int64, parse func(b []byte) (uint64, []byte)) (*Profile, error) {
43 p := &Profile{
44 Period: period * 1000,
45 PeriodType: &ValueType{Type: "cpu", Unit: "nanoseconds"},
46 SampleType: []*ValueType{{Type: "samples", Unit: "count"}, {Type: "cpu", Unit: "nanoseconds"}},
47 }
48 var err error
49 var locs map[uint64]*Location
50 if b, locs, err = parseCPUSamples(b, parse, false, p); err != nil {
51 return nil, err
52 }
53
54 if err = parseJavaLocations(b, locs, p); err != nil {
55 return nil, err
56 }
57
58 // Strip out addresses for better merge.
59 if err = p.Aggregate(true, true, true, true, false, false); err != nil {
60 return nil, err
61 }
62
63 return p, nil
64}
65
66// parseJavaProfile returns a new profile from heapz or contentionz
67// data. b is the profile bytes after the header.

Callers 1

parseCPUFunction · 0.85

Calls 3

AggregateMethod · 0.95
parseCPUSamplesFunction · 0.85
parseJavaLocationsFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…