@@ -11,7 +11,7 @@ import (
1111)
1212
1313func TestHeapMerge (t * testing.T ) {
14- profiles := getProfilesVtProto (t , "hprof1" , "hprof2" , "hprof3" , "hprof4" )
14+ profiles := getProfilesVtProto (t , false , "hprof1" , "hprof2" , "hprof3" , "hprof4" )
1515 profileMerger := NewProfileMerger ()
1616
1717 // merge profiles
@@ -87,7 +87,7 @@ func TestHeapMerge(t *testing.T) {
8787}
8888
8989func TestMergeWrite (t * testing.T ) {
90- profiles := getProfilesVtProto (t , "hprof1" , "hprof2" , "hprof3" , "hprof4" )
90+ profiles := getProfilesVtProto (t , false , "hprof1" , "hprof2" , "hprof3" , "hprof4" )
9191
9292 profileMerger := NewProfileMerger ()
9393 mergedProfile := profileMerger .Merge (profiles ... )
@@ -112,7 +112,7 @@ func TestMergeWrite(t *testing.T) {
112112 require .Less (t , compressedBB .Len (), noCompactBB .Len ())
113113
114114 // merge profiles with different sample types
115- profiles = getProfilesVtProto (t , "parca_heap" , "parca_cpu" , "parca_goroutine" )
115+ profiles = getProfilesVtProto (t , false , "parca_heap" , "parca_cpu" , "parca_goroutine" )
116116 mergedProfile = profileMerger .Merge (profiles ... )
117117 require .NotNil (t , mergedProfile )
118118
@@ -130,7 +130,7 @@ func TestMergeWrite(t *testing.T) {
130130
131131func TestMergeUnpack (t * testing.T ) {
132132 t .Run ("general merge unpack" , func (t * testing.T ) {
133- profiles := getProfilesVtProto (t , "hprof1" , "hprof2" , "hprof3" , "hprof4" )
133+ profiles := getProfilesVtProto (t , false , "hprof1" , "hprof2" , "hprof3" , "hprof4" )
134134
135135 profileMerger := NewProfileMerger ()
136136 mergedProfile := profileMerger .Merge (profiles ... )
@@ -200,7 +200,7 @@ func TestMergeUnpack(t *testing.T) {
200200
201201func BenchmarkVtProtobufParsing (b * testing.B ) {
202202 for i := 0 ; i < b .N ; i ++ {
203- profiles := getProfilesVtProto (b , "hprof1" , "hprof2" , "hprof3" , "hprof4" )
203+ profiles := getProfilesVtProto (b , false , "hprof1" , "hprof2" , "hprof3" , "hprof4" )
204204 for _ , p := range profiles {
205205 p .ReturnToVTPool ()
206206 }
@@ -214,7 +214,7 @@ func BenchmarkProtobufParsing(b *testing.B) {
214214}
215215
216216func BenchmarkProfileMerger (b * testing.B ) {
217- profiles := getProfilesVtProto (b , "hprof1" , "hprof2" , "hprof3" , "hprof4" )
217+ profiles := getProfilesVtProto (b , false , "hprof1" , "hprof2" , "hprof3" , "hprof4" )
218218
219219 b .ResetTimer ()
220220 for i := 0 ; i < b .N ; i ++ {
@@ -224,7 +224,7 @@ func BenchmarkProfileMerger(b *testing.B) {
224224}
225225
226226func BenchmarkProfileUnPacker (b * testing.B ) {
227- profiles := getProfilesVtProto (b , "hprof1" , "hprof2" , "hprof3" , "hprof4" )
227+ profiles := getProfilesVtProto (b , false , "hprof1" , "hprof2" , "hprof3" , "hprof4" )
228228
229229 profileMerger := NewProfileMerger ()
230230 mergedProfile := profileMerger .Merge (profiles ... )
@@ -252,13 +252,13 @@ func getProfiles(t require.TestingT, paths ...string) []*profile.Profile {
252252 return profiles
253253}
254254
255- func getProfilesVtProto (t require.TestingT , paths ... string ) []* Profile {
255+ func getProfilesVtProto (t require.TestingT , debugGoroutine bool , paths ... string ) []* Profile {
256256 dir := "./testdata/"
257257 var profiles []* Profile
258258 for _ , profileName := range paths {
259259 file , err := os .OpenFile (dir + profileName , os .O_RDONLY , 0666 )
260260 require .NoError (t , err )
261- prof , err := ParseProfile (file )
261+ prof , err := ParseProfile (file , debugGoroutine )
262262 require .NoError (t , err )
263263 profiles = append (profiles , prof )
264264 }
0 commit comments